更新若干功能,今日预定订单改为使用多表查询插件
This commit is contained in:
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.booking.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.booking.service.EmergencyService;
|
||||||
|
import com.gxwebsoft.booking.entity.Emergency;
|
||||||
|
import com.gxwebsoft.booking.param.EmergencyParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急联系人管理控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 21:25:00
|
||||||
|
*/
|
||||||
|
@Api(tags = "紧急联系人管理管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/booking/emergency")
|
||||||
|
public class EmergencyController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private EmergencyService emergencyService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询紧急联系人管理")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Emergency>> page(EmergencyParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(emergencyService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部紧急联系人管理")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Emergency>> list(EmergencyParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(emergencyService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询紧急联系人管理")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Emergency> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(emergencyService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加紧急联系人管理")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Emergency emergency) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
emergency.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (emergencyService.save(emergency)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改紧急联系人管理")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Emergency emergency) {
|
||||||
|
if (emergencyService.updateById(emergency)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除紧急联系人管理")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (emergencyService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加紧急联系人管理")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Emergency> list) {
|
||||||
|
if (emergencyService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改紧急联系人管理")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Emergency> batchParam) {
|
||||||
|
if (batchParam.update(emergencyService, "emergency_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除紧急联系人管理")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (emergencyService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,9 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.github.yulichang.toolkit.JoinWrappers;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.gxwebsoft.booking.entity.Field;
|
import com.gxwebsoft.booking.entity.Field;
|
||||||
import com.gxwebsoft.booking.param.FieldParam;
|
import com.gxwebsoft.booking.param.FieldParam;
|
||||||
import com.gxwebsoft.booking.service.FieldService;
|
import com.gxwebsoft.booking.service.FieldService;
|
||||||
@@ -20,8 +23,10 @@ import com.gxwebsoft.common.core.web.PageParam;
|
|||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.shop.entity.ChatConversation;
|
||||||
import com.gxwebsoft.shop.entity.Order;
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||||
|
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||||
import com.gxwebsoft.shop.service.OrderService;
|
import com.gxwebsoft.shop.service.OrderService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -88,7 +93,8 @@ public class PeriodController extends BaseController {
|
|||||||
|
|
||||||
// 今日订单信息 按Key分组(组合规则:日期+时间段+场馆id+场地id)
|
// 今日订单信息 按Key分组(组合规则:日期+时间段+场馆id+场地id)
|
||||||
Map<String, List<OrderInfo>> collectKey;
|
Map<String, List<OrderInfo>> collectKey;
|
||||||
List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getDateTime, param.getDateTime()).eq(OrderInfo::getMerchantId,param.getMerchantId()).gt(OrderInfo::getExpirationTime, LocalDateTime.now()));
|
List<OrderInfo> orderInfoList = orderInfoService.getTodayOrder(param);
|
||||||
|
// List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getDateTime, param.getDateTime()).eq(OrderInfo::getMerchantId,param.getMerchantId()).gt(OrderInfo::getExpirationTime, LocalDateTime.now()));
|
||||||
collectKey = orderInfoList.stream().collect(Collectors.groupingBy(OrderInfo::getOrderCode));
|
collectKey = orderInfoList.stream().collect(Collectors.groupingBy(OrderInfo::getOrderCode));
|
||||||
|
|
||||||
// 查询是否含有未支付订单
|
// 查询是否含有未支付订单
|
||||||
@@ -104,9 +110,9 @@ public class PeriodController extends BaseController {
|
|||||||
fieldParam.setIsStatus(param.getIsStatus());
|
fieldParam.setIsStatus(param.getIsStatus());
|
||||||
fieldParam.setMerchantId(param.getMerchantId());
|
fieldParam.setMerchantId(param.getMerchantId());
|
||||||
fieldParam.setIsHalf(param.getHalf());
|
fieldParam.setIsHalf(param.getHalf());
|
||||||
System.out.println("fieldParam = " + fieldParam);
|
// System.out.println("fieldParam = " + fieldParam);
|
||||||
List<Field> fields = fieldService.listRel(fieldParam);
|
List<Field> fields = fieldService.listRel(fieldParam);
|
||||||
System.out.println("fields = " + fields);
|
// System.out.println("fields = " + fields);
|
||||||
|
|
||||||
// 为空处理
|
// 为空处理
|
||||||
if (CollectionUtils.isEmpty(fields)) {
|
if (CollectionUtils.isEmpty(fields)) {
|
||||||
@@ -123,10 +129,13 @@ public class PeriodController extends BaseController {
|
|||||||
fieldList.forEach(f -> {
|
fieldList.forEach(f -> {
|
||||||
final String key = getKey(param.getDateTime().concat(d.getTimePeriod().concat(d.getMerchantId().toString()).concat(f.getFieldId().toString())));
|
final String key = getKey(param.getDateTime().concat(d.getTimePeriod().concat(d.getMerchantId().toString()).concat(f.getFieldId().toString())));
|
||||||
final List<OrderInfo> orderInfos = collectKey.get(key);
|
final List<OrderInfo> orderInfos = collectKey.get(key);
|
||||||
|
System.out.println("orderInfos = " + orderInfos);
|
||||||
if (!CollectionUtils.isEmpty(orderInfos)) {
|
if (!CollectionUtils.isEmpty(orderInfos)) {
|
||||||
final OrderInfo orderInfo = orderInfos.get(0);
|
final OrderInfo orderInfo = orderInfos.get(0);
|
||||||
if (orderInfo.getOrderCode().equals(key)) {
|
if (orderInfo.getOrderCode().equals(key)) {
|
||||||
f.setSold(true);
|
f.setSold(true);
|
||||||
|
f.setOrderInfoList(orderInfos);
|
||||||
|
f.setOrderId(orderInfo.getOrderId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
f.setOrderKey(key);
|
f.setOrderKey(key);
|
||||||
|
|||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.gxwebsoft.booking.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.booking.vo.UserCouponVO;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.booking.service.UserCouponService;
|
||||||
|
import com.gxwebsoft.booking.entity.UserCoupon;
|
||||||
|
import com.gxwebsoft.booking.param.UserCouponParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的优惠券控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 22:41:17
|
||||||
|
*/
|
||||||
|
@Api(tags = "我的优惠券管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/booking/user-coupon")
|
||||||
|
public class UserCouponController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private UserCouponService userCouponService;
|
||||||
|
|
||||||
|
@ApiOperation("统计分析")
|
||||||
|
@GetMapping("/data")
|
||||||
|
public ApiResult<?> data(){
|
||||||
|
final UserCouponVO.Payload payload = new UserCouponVO.Payload();
|
||||||
|
payload.setToBeUsed(userCouponService.count(new LambdaUpdateWrapper<UserCoupon>().eq(UserCoupon::getUserId,getLoginUserId()).eq(UserCoupon::getStatus,0)));
|
||||||
|
payload.setUsed(userCouponService.count(new LambdaUpdateWrapper<UserCoupon>().eq(UserCoupon::getUserId,getLoginUserId()).eq(UserCoupon::getStatus,1)));
|
||||||
|
payload.setInvalid(userCouponService.count(new LambdaUpdateWrapper<UserCoupon>().eq(UserCoupon::getUserId,getLoginUserId()).eq(UserCoupon::getStatus,2)));
|
||||||
|
return success(payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页查询我的优惠券")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<UserCoupon>> page(UserCouponParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(userCouponService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部我的优惠券")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<UserCoupon>> list(UserCouponParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(userCouponService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('booking:userCoupon:list')")
|
||||||
|
@ApiOperation("根据id查询我的优惠券")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<UserCoupon> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(userCouponService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加我的优惠券")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody UserCoupon userCoupon) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
userCoupon.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (userCouponService.save(userCoupon)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改我的优惠券")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody UserCoupon userCoupon) {
|
||||||
|
if (userCouponService.updateById(userCoupon)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除我的优惠券")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (userCouponService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加我的优惠券")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<UserCoupon> list) {
|
||||||
|
if (userCouponService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改我的优惠券")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserCoupon> batchParam) {
|
||||||
|
if (batchParam.update(userCouponService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除我的优惠券")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (userCouponService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.gxwebsoft.booking.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急联系人管理
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 21:24:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Emergency对象", description = "紧急联系人管理")
|
||||||
|
@TableName("booking_emergency")
|
||||||
|
public class Emergency implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "emergency_id", type = IdType.AUTO)
|
||||||
|
private Integer emergencyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联用户")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -104,4 +104,8 @@ public class Field extends CloneSupport<Field> implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "被预定的订单号")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer orderId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.gxwebsoft.booking.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的优惠券
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 22:41:17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "UserCoupon对象", description = "我的优惠券")
|
||||||
|
public class UserCoupon implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "优惠劵id")
|
||||||
|
private Integer couponId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "优惠券名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "优惠券类型(10满减券 20折扣券)")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "满减券-减免金额")
|
||||||
|
private BigDecimal reducePrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "折扣券-折扣率(0-100)")
|
||||||
|
private Integer discount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最低消费金额")
|
||||||
|
private BigDecimal minPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "到期类型(10领取后生效 20固定时间)")
|
||||||
|
private Integer expireType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领取后生效-有效天数")
|
||||||
|
private Integer expireDay;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "有效期开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "有效期结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用范围(10全部商品 20指定商品)")
|
||||||
|
private Integer applyRange;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用范围配置(json格式)")
|
||||||
|
private String applyRangeConfig;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否过期(0未过期 1已过期)")
|
||||||
|
private Integer isExpire;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已使用(0未使用 1已使用)")
|
||||||
|
private Integer isUse;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0待使用, 1已使用, 2已失效")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领取时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.booking.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.booking.entity.Emergency;
|
||||||
|
import com.gxwebsoft.booking.param.EmergencyParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急联系人管理Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 21:24:59
|
||||||
|
*/
|
||||||
|
public interface EmergencyMapper extends BaseMapper<Emergency> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Emergency>
|
||||||
|
*/
|
||||||
|
List<Emergency> selectPageRel(@Param("page") IPage<Emergency> page,
|
||||||
|
@Param("param") EmergencyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Emergency> selectListRel(@Param("param") EmergencyParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.booking.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.booking.entity.UserCoupon;
|
||||||
|
import com.gxwebsoft.booking.param.UserCouponParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的优惠券Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 22:41:17
|
||||||
|
*/
|
||||||
|
public interface UserCouponMapper extends BaseMapper<UserCoupon> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<UserCoupon>
|
||||||
|
*/
|
||||||
|
List<UserCoupon> selectPageRel(@Param("page") IPage<UserCoupon> page,
|
||||||
|
@Param("param") UserCouponParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<UserCoupon> selectListRel(@Param("param") UserCouponParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?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.gxwebsoft.booking.mapper.EmergencyMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM booking_emergency a
|
||||||
|
<where>
|
||||||
|
<if test="param.emergencyId != null">
|
||||||
|
AND a.emergency_id = #{param.emergencyId}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.phone != null">
|
||||||
|
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.booking.entity.Emergency">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.booking.entity.Emergency">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*
|
SELECT a.*,b.merchant_code
|
||||||
FROM booking_period a
|
FROM booking_period a
|
||||||
|
LEFT JOIN shop_merchant b ON a.merchant_id = b.merchant_id
|
||||||
<where>
|
<where>
|
||||||
<if test="param.periodId != null">
|
<if test="param.periodId != null">
|
||||||
AND a.period_id = #{param.periodId}
|
AND a.period_id = #{param.periodId}
|
||||||
@@ -37,6 +38,9 @@
|
|||||||
<if test="param.merchantId != null">
|
<if test="param.merchantId != null">
|
||||||
AND a.merchant_id = #{param.merchantId}
|
AND a.merchant_id = #{param.merchantId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.merchantCode != null">
|
||||||
|
AND b.merchant_code = #{param.merchantCode}
|
||||||
|
</if>
|
||||||
<if test="param.isStatus != null">
|
<if test="param.isStatus != null">
|
||||||
AND a.is_status = #{param.isStatus}
|
AND a.is_status = #{param.isStatus}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<?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.gxwebsoft.booking.mapper.UserCouponMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM user_coupon a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.couponId != null">
|
||||||
|
AND a.coupon_id = #{param.couponId}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
|
<if test="param.reducePrice != null">
|
||||||
|
AND a.reduce_price = #{param.reducePrice}
|
||||||
|
</if>
|
||||||
|
<if test="param.discount != null">
|
||||||
|
AND a.discount = #{param.discount}
|
||||||
|
</if>
|
||||||
|
<if test="param.minPrice != null">
|
||||||
|
AND a.min_price = #{param.minPrice}
|
||||||
|
</if>
|
||||||
|
<if test="param.expireType != null">
|
||||||
|
AND a.expire_type = #{param.expireType}
|
||||||
|
</if>
|
||||||
|
<if test="param.expireDay != null">
|
||||||
|
AND a.expire_day = #{param.expireDay}
|
||||||
|
</if>
|
||||||
|
<if test="param.startTime != null">
|
||||||
|
AND a.start_time = #{param.startTime}
|
||||||
|
</if>
|
||||||
|
<if test="param.endTime != null">
|
||||||
|
AND a.end_time = #{param.endTime}
|
||||||
|
</if>
|
||||||
|
<if test="param.applyRange != null">
|
||||||
|
AND a.apply_range = #{param.applyRange}
|
||||||
|
</if>
|
||||||
|
<if test="param.applyRangeConfig != null">
|
||||||
|
AND a.apply_range_config LIKE CONCAT('%', #{param.applyRangeConfig}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.isExpire != null">
|
||||||
|
AND a.is_expire = #{param.isExpire}
|
||||||
|
</if>
|
||||||
|
<if test="param.isUse != null">
|
||||||
|
AND a.is_use = #{param.isUse}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.booking.entity.UserCoupon">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.booking.entity.UserCoupon">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.gxwebsoft.booking.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急联系人管理查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 21:24:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "EmergencyParam对象", description = "紧急联系人管理查询参数")
|
||||||
|
public class EmergencyParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer emergencyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联用户")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -84,4 +84,8 @@ public class PeriodParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer half;
|
private Integer half;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户编号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private String merchantCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.gxwebsoft.booking.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的优惠券查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 22:41:17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "UserCouponParam对象", description = "我的优惠券查询参数")
|
||||||
|
public class UserCouponParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "优惠劵id")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer couponId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "优惠券名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "优惠券类型(10满减券 20折扣券)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "满减券-减免金额")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal reducePrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "折扣券-折扣率(0-100)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer discount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最低消费金额")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal minPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "到期类型(10领取后生效 20固定时间)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer expireType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领取后生效-有效天数")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer expireDay;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "有效期开始时间")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "有效期结束时间")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用范围(10全部商品 20指定商品)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer applyRange;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用范围配置(json格式)")
|
||||||
|
private String applyRangeConfig;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否过期(0未过期 1已过期)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer isExpire;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已使用(0未使用 1已使用)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer isUse;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0待使用, 1已使用, 2已失效")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.booking.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.booking.entity.Emergency;
|
||||||
|
import com.gxwebsoft.booking.param.EmergencyParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急联系人管理Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 21:24:59
|
||||||
|
*/
|
||||||
|
public interface EmergencyService extends IService<Emergency> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<Emergency>
|
||||||
|
*/
|
||||||
|
PageResult<Emergency> pageRel(EmergencyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Emergency>
|
||||||
|
*/
|
||||||
|
List<Emergency> listRel(EmergencyParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param emergencyId ID
|
||||||
|
* @return Emergency
|
||||||
|
*/
|
||||||
|
Emergency getByIdRel(Integer emergencyId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.booking.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.booking.entity.UserCoupon;
|
||||||
|
import com.gxwebsoft.booking.param.UserCouponParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的优惠券Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 22:41:17
|
||||||
|
*/
|
||||||
|
public interface UserCouponService extends IService<UserCoupon> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<UserCoupon>
|
||||||
|
*/
|
||||||
|
PageResult<UserCoupon> pageRel(UserCouponParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<UserCoupon>
|
||||||
|
*/
|
||||||
|
List<UserCoupon> listRel(UserCouponParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id id
|
||||||
|
* @return UserCoupon
|
||||||
|
*/
|
||||||
|
UserCoupon getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.booking.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.booking.mapper.EmergencyMapper;
|
||||||
|
import com.gxwebsoft.booking.service.EmergencyService;
|
||||||
|
import com.gxwebsoft.booking.entity.Emergency;
|
||||||
|
import com.gxwebsoft.booking.param.EmergencyParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急联系人管理Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 21:24:59
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EmergencyServiceImpl extends ServiceImpl<EmergencyMapper, Emergency> implements EmergencyService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<Emergency> pageRel(EmergencyParam param) {
|
||||||
|
PageParam<Emergency, EmergencyParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<Emergency> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Emergency> listRel(EmergencyParam param) {
|
||||||
|
List<Emergency> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<Emergency, EmergencyParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Emergency getByIdRel(Integer emergencyId) {
|
||||||
|
EmergencyParam param = new EmergencyParam();
|
||||||
|
param.setEmergencyId(emergencyId);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.gxwebsoft.booking.service.impl;
|
package com.gxwebsoft.booking.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gxwebsoft.booking.entity.Field;
|
import com.gxwebsoft.booking.entity.Field;
|
||||||
import com.gxwebsoft.booking.entity.Period;
|
import com.gxwebsoft.booking.entity.Period;
|
||||||
@@ -16,6 +17,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -48,6 +50,18 @@ public class FieldServiceImpl extends ServiceImpl<FieldMapper, Field> implements
|
|||||||
// 排序
|
// 排序
|
||||||
PageParam<Field, FieldParam> page = new PageParam<>();
|
PageParam<Field, FieldParam> page = new PageParam<>();
|
||||||
page.setDefaultOrder("sort_number desc, create_time desc");
|
page.setDefaultOrder("sort_number desc, create_time desc");
|
||||||
|
|
||||||
|
// 是否查询场地预定信息
|
||||||
|
// if (param.getSceneType() != null && param.getSceneType().equals("showSoldStatus")) {
|
||||||
|
// final List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaUpdateWrapper<OrderInfo>().eq(OrderInfo::getExpirationTime, LocalDateTime.now()).eq(OrderInfo::getDateTime, param.getDateTime()));
|
||||||
|
// Map<Integer, List<OrderInfo>> collect = orderInfoList.stream().collect(Collectors.groupingBy(OrderInfo::getFieldId));
|
||||||
|
// list.forEach(d -> {
|
||||||
|
// List<OrderInfo> orderInfos = collect.get(d.getFieldId());
|
||||||
|
// if (!CollectionUtils.isEmpty(orderInfos)) {
|
||||||
|
// d.setSold(true);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
return page.sortRecords(list);
|
return page.sortRecords(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.booking.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.booking.mapper.UserCouponMapper;
|
||||||
|
import com.gxwebsoft.booking.service.UserCouponService;
|
||||||
|
import com.gxwebsoft.booking.entity.UserCoupon;
|
||||||
|
import com.gxwebsoft.booking.param.UserCouponParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的优惠券Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-22 22:41:17
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class UserCouponServiceImpl extends ServiceImpl<UserCouponMapper, UserCoupon> implements UserCouponService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<UserCoupon> pageRel(UserCouponParam param) {
|
||||||
|
PageParam<UserCoupon, UserCouponParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<UserCoupon> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserCoupon> listRel(UserCouponParam param) {
|
||||||
|
List<UserCoupon> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<UserCoupon, UserCouponParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserCoupon getByIdRel(Integer id) {
|
||||||
|
UserCouponParam param = new UserCouponParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.gxwebsoft.booking.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class PushMessageVO implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("推送消息")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty("推送消息内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private Set<Integer> userIds;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("推送透传数据obj格式")
|
||||||
|
private Payload payload;
|
||||||
|
|
||||||
|
|
||||||
|
private Set<String> push_clientid;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Payload {
|
||||||
|
private String type;
|
||||||
|
private Object data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.gxwebsoft.booking.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class UserCouponVO implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("待使用数量")
|
||||||
|
private Integer toBeUsed;
|
||||||
|
|
||||||
|
@ApiModelProperty("已使用数量")
|
||||||
|
private Integer used;
|
||||||
|
|
||||||
|
@ApiModelProperty("已失效数量")
|
||||||
|
private Integer invalid;
|
||||||
|
@Data
|
||||||
|
public static class Payload {
|
||||||
|
private Integer toBeUsed;
|
||||||
|
private Integer used;
|
||||||
|
private Integer invalid;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -63,7 +63,9 @@ public class MybatisPlusConfig {
|
|||||||
"sys_tenant",
|
"sys_tenant",
|
||||||
"sys_dictionary",
|
"sys_dictionary",
|
||||||
"sys_dictionary_data",
|
"sys_dictionary_data",
|
||||||
"apps_test_data"
|
"apps_test_data",
|
||||||
|
"shop_order",
|
||||||
|
"shop_order_info"
|
||||||
).contains(tableName);
|
).contains(tableName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import cn.hutool.core.date.DateField;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||||
@@ -18,6 +20,7 @@ import com.gxwebsoft.common.core.annotation.OperationLog;
|
|||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.aspectj.weaver.ast.Or;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -91,6 +94,7 @@ public class OrderController extends BaseController {
|
|||||||
if(order.getOrderId() != null){
|
if(order.getOrderId() != null){
|
||||||
Order order1 = orderService.getByIdRel(order.getOrderId());
|
Order order1 = orderService.getByIdRel(order.getOrderId());
|
||||||
order1.setOpenid(loginUser.getOpenid());
|
order1.setOpenid(loginUser.getOpenid());
|
||||||
|
order.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId()));
|
||||||
System.out.println("已下过订单 = " + order1);
|
System.out.println("已下过订单 = " + order1);
|
||||||
// 微信统一下单接口
|
// 微信统一下单接口
|
||||||
if (order.getPayType().equals(1)) {
|
if (order.getPayType().equals(1)) {
|
||||||
@@ -133,6 +137,10 @@ public class OrderController extends BaseController {
|
|||||||
@ApiOperation("修改订单")
|
@ApiOperation("修改订单")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody Order order) {
|
public ApiResult<?> update(@RequestBody Order order) {
|
||||||
|
if(order.getOrderStatus().equals(2)){
|
||||||
|
order.setExpirationTime(DateUtil.date());
|
||||||
|
orderInfoService.update(new LambdaUpdateWrapper<OrderInfo>().eq(OrderInfo::getOrderId,order.getOrderId()).set(OrderInfo::getExpirationTime,DateUtil.date()));
|
||||||
|
}
|
||||||
if (orderService.updateById(order)) {
|
if (orderService.updateById(order)) {
|
||||||
return success("操作成功");
|
return success("操作成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateField;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.shop.entity.Order;
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
|
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||||
import com.gxwebsoft.shop.entity.Payment;
|
import com.gxwebsoft.shop.entity.Payment;
|
||||||
|
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||||
import com.gxwebsoft.shop.service.OrderService;
|
import com.gxwebsoft.shop.service.OrderService;
|
||||||
import com.wechat.pay.java.core.notification.NotificationConfig;
|
import com.wechat.pay.java.core.notification.NotificationConfig;
|
||||||
import com.wechat.pay.java.core.notification.NotificationParser;
|
import com.wechat.pay.java.core.notification.NotificationParser;
|
||||||
@@ -20,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,6 +44,8 @@ public class WxPayNotifyController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private OrderService orderService;
|
private OrderService orderService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private OrderInfoService orderInfoService;
|
||||||
|
@Resource
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
@Resource
|
@Resource
|
||||||
private ConfigProperties conf;
|
private ConfigProperties conf;
|
||||||
@@ -100,24 +109,21 @@ public class WxPayNotifyController extends BaseController {
|
|||||||
// 1. 查询要处理的订单
|
// 1. 查询要处理的订单
|
||||||
Order order = orderService.getByOutTradeNo(outTradeNo);
|
Order order = orderService.getByOutTradeNo(outTradeNo);
|
||||||
// 2. 已支付则跳过
|
// 2. 已支付则跳过
|
||||||
if (order.getPayStatus().equals(true)) {
|
if (order.getPayStatus().equals(1)) {
|
||||||
return "SUCCESS";
|
return "SUCCESS";
|
||||||
}
|
}
|
||||||
// 2. 未支付则处理更新订单状态
|
// 2. 未支付则处理更新订单状态
|
||||||
if (order.getPayStatus().equals(false)) {
|
if (order.getPayStatus().equals(0)) {
|
||||||
// 5. TODO 处理订单状态
|
// 5. TODO 处理订单状态
|
||||||
order.setPayTime(DateUtil.date());
|
order.setPayTime(DateUtil.date());
|
||||||
order.setPayStatus(1);
|
order.setPayStatus(1);
|
||||||
order.setTransactionId(transactionId);
|
order.setTransactionId(transactionId);
|
||||||
// 实际付款金额:Integer除以100后转BigDecimal
|
order.setPayPrice(new BigDecimal(NumberUtil.decimalFormat("0.00", total * 0.01)));
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
order.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 10));
|
||||||
final String format = df.format(total / 100);
|
System.out.println("实际付款金额 = " + order.getPayPrice());
|
||||||
order.setPayPrice(new BigDecimal(format));
|
|
||||||
System.out.println("实际付款金额 = " + order);
|
|
||||||
orderService.updateByOutTradeNo(order);
|
orderService.updateByOutTradeNo(order);
|
||||||
// 6. TODO 同步更新订单明细的支付状态
|
// 6. TODO 同步更新订单明细的支付状态
|
||||||
|
orderInfoService.updateByOutTradeNo(order);
|
||||||
|
|
||||||
return "SUCCESS";
|
return "SUCCESS";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ public class Order implements Serializable {
|
|||||||
@TableId(value = "order_id", type = IdType.AUTO)
|
@TableId(value = "order_id", type = IdType.AUTO)
|
||||||
private Integer orderId;
|
private Integer orderId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单类型,0商城订单 1客户预定 2俱乐部训练场 3活动订场")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "订单编号")
|
@ApiModelProperty(value = "订单编号")
|
||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ public class OrderInfo implements Serializable {
|
|||||||
@ApiModelProperty(value = "关联订单表id")
|
@ApiModelProperty(value = "关联订单表id")
|
||||||
private Integer orderId;
|
private Integer orderId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单编号")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
|
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
|
||||||
private String orderCode;
|
private String orderCode;
|
||||||
|
|
||||||
@@ -67,6 +71,10 @@ public class OrderInfo implements Serializable {
|
|||||||
@ApiModelProperty(value = "0 未付款 1已付款,2无需付款或占用状态")
|
@ApiModelProperty(value = "0 未付款 1已付款,2无需付款或占用状态")
|
||||||
private Integer payStatus;
|
private Integer payStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer orderStatus;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否免费:0收费、1免费")
|
@ApiModelProperty(value = "是否免费:0收费、1免费")
|
||||||
private Boolean isFree;
|
private Boolean isFree;
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class Users implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@TableId(value = "user_id", type = IdType.AUTO)
|
@TableId(value = "user_id", type = IdType.AUTO)
|
||||||
private Integer userId;
|
private Integer uid;
|
||||||
|
|
||||||
@ApiModelProperty(value = "用户唯一小程序id")
|
@ApiModelProperty(value = "用户唯一小程序id")
|
||||||
private String openid;
|
private String openid;
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
package com.gxwebsoft.shop.mapper;
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||||
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -14,7 +18,7 @@ import java.util.List;
|
|||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-05-14 13:20:04
|
* @since 2024-05-14 13:20:04
|
||||||
*/
|
*/
|
||||||
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
|
public interface OrderInfoMapper extends MPJBaseMapper<OrderInfo> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
@@ -34,4 +38,7 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
|
|||||||
*/
|
*/
|
||||||
List<OrderInfo> selectListRel(@Param("param") OrderInfoParam param);
|
List<OrderInfo> selectListRel(@Param("param") OrderInfoParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
void updateByOutTradeNo(@Param("param") Order order);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*, b.pay_status
|
SELECT a.*, b.pay_status,b.order_status,b.order_no
|
||||||
FROM shop_order_info a
|
FROM shop_order_info a
|
||||||
LEFT JOIN shop_order b ON a.order_id = b.order_id
|
LEFT JOIN shop_order b ON a.order_id = b.order_id
|
||||||
<where>
|
<where>
|
||||||
@@ -103,4 +103,9 @@
|
|||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 更新订单状态 -->
|
||||||
|
<select id="updateByOutTradeNo" resultType="com.gxwebsoft.shop.entity.OrderInfo">
|
||||||
|
UPDATE shop_order_info SET pay_status = 2,expiration_time = #{param.expirationTime} WHERE order_id = #{param.orderId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
|
|
||||||
<!-- 更新订单状态 -->
|
<!-- 更新订单状态 -->
|
||||||
<select id="updateByOutTradeNo" resultType="com.gxwebsoft.shop.entity.Order">
|
<select id="updateByOutTradeNo" resultType="com.gxwebsoft.shop.entity.Order">
|
||||||
UPDATE shop_order SET pay_status = #{param.payStatus}, pay_time = #{param.payTime}, pay_price = #{param.payPrice}, transaction_id = #{param.transactionId} WHERE order_no = #{param.orderNo}
|
UPDATE shop_order SET pay_status = #{param.payStatus}, pay_time = #{param.payTime}, pay_price = #{param.payPrice}, transaction_id = #{param.transactionId},expiration_time = #{param.expirationTime} WHERE order_no = #{param.orderNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询过期订单 -->
|
<!-- 查询过期订单 -->
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
SELECT a.*
|
SELECT a.*
|
||||||
FROM shop_users a
|
FROM shop_users a
|
||||||
<where>
|
<where>
|
||||||
<if test="param.userId != null">
|
<if test="param.uid != null">
|
||||||
AND a.user_id = #{param.userId}
|
AND a.uid = #{param.uid}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.openid != null">
|
<if test="param.openid != null">
|
||||||
AND a.openid LIKE CONCAT('%', #{param.openid}, '%')
|
AND a.openid LIKE CONCAT('%', #{param.openid}, '%')
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.gxwebsoft.shop.param;
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
@@ -106,4 +108,8 @@ public class OrderInfoParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前时间")
|
||||||
|
@QueryField(type = QueryType.GT)
|
||||||
|
private Date expirationTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ public class OrderParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer orderId;
|
private Integer orderId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单类型,0商城订单 1客户预定 2俱乐部训练场 3活动订场")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "订单编号")
|
@ApiModelProperty(value = "订单编号")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class UsersParam extends BaseParam {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer userId;
|
private Integer uid;
|
||||||
|
|
||||||
@ApiModelProperty(value = "用户唯一小程序id")
|
@ApiModelProperty(value = "用户唯一小程序id")
|
||||||
private String openid;
|
private String openid;
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.gxwebsoft.shop.service;
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.booking.param.PeriodParam;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||||
|
|
||||||
@@ -39,4 +41,8 @@ public interface OrderInfoService extends IService<OrderInfo> {
|
|||||||
*/
|
*/
|
||||||
OrderInfo getByIdRel(Integer id);
|
OrderInfo getByIdRel(Integer id);
|
||||||
|
|
||||||
|
void updateByOutTradeNo(Order order);
|
||||||
|
|
||||||
|
List<OrderInfo> getTodayOrder(PeriodParam param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
package com.gxwebsoft.shop.service.impl;
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.toolkit.JoinWrappers;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.gxwebsoft.booking.param.PeriodParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.shop.entity.ChatConversation;
|
||||||
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.shop.mapper.OrderInfoMapper;
|
import com.gxwebsoft.shop.mapper.OrderInfoMapper;
|
||||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||||
@@ -9,6 +15,7 @@ import com.gxwebsoft.common.core.web.PageParam;
|
|||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,4 +51,24 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
return param.getOne(baseMapper.selectListRel(param));
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateByOutTradeNo(Order order) {
|
||||||
|
baseMapper.updateByOutTradeNo(order);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderInfo> getTodayOrder(PeriodParam param) {
|
||||||
|
// 多表查询
|
||||||
|
MPJLambdaWrapper<OrderInfo> mpjLambdaWrapper = new MPJLambdaWrapper<>();
|
||||||
|
mpjLambdaWrapper.selectAll(OrderInfo.class)
|
||||||
|
.select(Order::getOrderNo)
|
||||||
|
.select(Order::getOrderStatus)
|
||||||
|
.leftJoin(Order.class,Order::getOrderId,OrderInfo::getOrderId)
|
||||||
|
.eq(OrderInfo::getDateTime,param.getDateTime())
|
||||||
|
.eq(OrderInfo::getMerchantId,param.getMerchantId())
|
||||||
|
.eq(Order::getOrderStatus,0)
|
||||||
|
.gt(OrderInfo::getExpirationTime, LocalDateTime.now());
|
||||||
|
return baseMapper.selectJoinList(OrderInfo.class, mpjLambdaWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,15 +101,23 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
param.setOrderId(orderId);
|
param.setOrderId(orderId);
|
||||||
Order order = param.getOne(baseMapper.selectListRel(param));
|
Order order = param.getOne(baseMapper.selectListRel(param));
|
||||||
if (order != null) {
|
if (order != null) {
|
||||||
final OrderInfoParam orderInfoParam = new OrderInfoParam();
|
final List<OrderInfo> list = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getOrderId, orderId));
|
||||||
orderInfoParam.setOrderId(orderId);
|
order.setOrderInfoList(list);
|
||||||
order.setOrderInfoList(orderInfoService.listRel(orderInfoParam));
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
final OrderInfo orderInfo = list.get(0);
|
||||||
|
final int i = orderInfo.getDateTime().compareTo(DateUtil.today());
|
||||||
|
System.out.println("order = " + orderInfo.getDateTime());
|
||||||
|
System.out.println("DateUtil.today() = " + DateUtil.today());
|
||||||
|
System.out.println("iiiiiiii = " + i);
|
||||||
}
|
}
|
||||||
return order;
|
return order;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建微信支付
|
* 创建微信支付
|
||||||
|
*
|
||||||
* @param order
|
* @param order
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -163,18 +171,19 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
if (active.equals("dev")) {
|
if (active.equals("dev")) {
|
||||||
amount.setTotal(1);
|
amount.setTotal(1);
|
||||||
request.setAmount(amount);
|
request.setAmount(amount);
|
||||||
request.setNotifyUrl("https://server.gxwebsoft.com/api/system/wx-pay/notify/" + order.getTenantId()); // 默认回调地址
|
request.setNotifyUrl("http://jimei-api.natapp1.cc/api/shop/wx-pay/notify/" + order.getTenantId()); // 默认回调地址
|
||||||
}
|
}
|
||||||
// 生成环境
|
// 生成环境
|
||||||
if (active.equals("prod")) {
|
if (active.equals("prod")) {
|
||||||
amount.setTotal(10);
|
amount.setTotal(2);
|
||||||
request.setAmount(amount);
|
request.setAmount(amount);
|
||||||
request.setNotifyUrl("https://server.gxwebsoft.com/api/system/wx-pay/notify/" + order.getTenantId()); // 默认回调地址
|
request.setNotifyUrl("https://modules.gxwebsoft.com/api/shop/wx-pay/notify/" + order.getTenantId()); // 默认回调地址
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(payment.getNotifyUrl())) {
|
if (StrUtil.isNotBlank(payment.getNotifyUrl())) {
|
||||||
// 后台配置的回调地址
|
// 后台配置的回调地址
|
||||||
request.setNotifyUrl(payment.getNotifyUrl().concat("/").concat(order.getTenantId().toString()));
|
request.setNotifyUrl(payment.getNotifyUrl().concat("/").concat(order.getTenantId().toString()));
|
||||||
}
|
}
|
||||||
|
System.out.println("request = " + request);
|
||||||
PrepayWithRequestPaymentResponse response = service.prepayWithRequestPayment(request);
|
PrepayWithRequestPaymentResponse response = service.prepayWithRequestPayment(request);
|
||||||
orderInfo.put("provider", "wxpay");
|
orderInfo.put("provider", "wxpay");
|
||||||
orderInfo.put("timeStamp", response.getTimeStamp());
|
orderInfo.put("timeStamp", response.getTimeStamp());
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Users getByIdRel(Integer userId) {
|
public Users getByIdRel(Integer uid) {
|
||||||
UsersParam param = new UsersParam();
|
UsersParam param = new UsersParam();
|
||||||
param.setUserId(userId);
|
param.setUid(uid);
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.shop.task;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.ServerTimeVO;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
|
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||||
|
import com.gxwebsoft.shop.mapper.OrderMapper;
|
||||||
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
|
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单结算任务
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-14 13:20:04
|
||||||
|
*/
|
||||||
|
@Api(tags = "订单结算任务")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/order-info")
|
||||||
|
public class OrderInfoTask extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private OrderInfoService orderInfoService;
|
||||||
|
/**
|
||||||
|
* 自动处理过期订单任务
|
||||||
|
*/
|
||||||
|
// @Scheduled(cron="*/10 * * * * *")
|
||||||
|
// @Transactional(rollbackFor = {Exception.class})
|
||||||
|
public void settledExpirationOrder() {
|
||||||
|
// final List<OrderInfo> list = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getOrderStatus, 0));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-10
@@ -1,13 +1,10 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
package com.gxwebsoft.shop.task;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.shop.entity.Order;
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.shop.mapper.OrderMapper;
|
import com.gxwebsoft.shop.mapper.OrderMapper;
|
||||||
import com.gxwebsoft.shop.param.OrderParam;
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
|
||||||
import com.gxwebsoft.shop.service.OrderService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -26,25 +23,22 @@ import java.util.List;
|
|||||||
@Api(tags = "订单结算任务")
|
@Api(tags = "订单结算任务")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/shop/order")
|
@RequestMapping("/api/shop/order")
|
||||||
public class OrderTaskController extends BaseController {
|
public class OrderTask extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private OrderMapper orderMapper;
|
private OrderMapper orderMapper;
|
||||||
@Resource
|
|
||||||
private OrderInfoService orderInfoService;
|
|
||||||
/**
|
/**
|
||||||
* 自动处理过期订单任务
|
* 自动处理过期订单任务
|
||||||
*/
|
*/
|
||||||
@Scheduled(fixedDelay = 2000, initialDelay = 2000)
|
@Scheduled(fixedDelay = 2000, initialDelay = 2000)
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public void settledUserPlanLog() {
|
public void settledExpirationOrder() {
|
||||||
final OrderParam p = new OrderParam();
|
final OrderParam p = new OrderParam();
|
||||||
p.setOrderStatus(0);
|
p.setOrderStatus(0);
|
||||||
p.setExpirationTime(DateUtil.date());
|
p.setExpirationTime(DateUtil.date());
|
||||||
final List<Order> list = orderMapper.selectExpirationOrder(p);
|
final List<Order> list = orderMapper.selectExpirationOrder(p);
|
||||||
list.forEach(d -> {
|
list.forEach(d -> {
|
||||||
System.out.println("自动处理过期订单任务 = " + d);
|
System.out.println("任务1:处理未支付订单超时自动关闭 = " + d);
|
||||||
orderMapper.updateExpirationOrder(d.getOrderId());
|
orderMapper.updateExpirationOrder(d.getOrderId());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
package com.gxwebsoft;
|
package com.gxwebsoft;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.NumberFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by WebSoft on 2020-03-23 23:37
|
* Created by WebSoft on 2020-03-23 23:37
|
||||||
*/
|
*/
|
||||||
@@ -13,6 +19,9 @@ public class TestMain {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGenJwtKey() {
|
public void testGenJwtKey() {
|
||||||
|
|
||||||
|
BigDecimal bigDecimal = new BigDecimal(NumberUtil.decimalFormat("0.00", 1 * 0.01));
|
||||||
|
System.out.println("实际付款金额 = " + bigDecimal);
|
||||||
// System.out.println(JwtUtil.encodeKey(JwtUtil.randomKey()));
|
// System.out.println(JwtUtil.encodeKey(JwtUtil.randomKey()));
|
||||||
|
|
||||||
// final String encrypt = CommonUtil.encrypt("123456");
|
// final String encrypt = CommonUtil.encrypt("123456");
|
||||||
@@ -21,4 +30,20 @@ public class TestMain {
|
|||||||
// final String decrypt = CommonUtil.decrypt(encrypt);
|
// final String decrypt = CommonUtil.decrypt(encrypt);
|
||||||
// System.out.println("decrypt = " + decrypt);
|
// System.out.println("decrypt = " + decrypt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String fenToYuan(String amount){
|
||||||
|
NumberFormat format = NumberFormat.getInstance();
|
||||||
|
try{
|
||||||
|
Number number = format.parse(amount);
|
||||||
|
double temp = number.doubleValue() / 100.0;
|
||||||
|
format.setGroupingUsed(false);
|
||||||
|
// 设置返回的小数部分所允许的最大位数
|
||||||
|
format.setMaximumFractionDigits(2);
|
||||||
|
amount = format.format(temp);
|
||||||
|
} catch (ParseException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ public class BookingGenerator {
|
|||||||
// "booking_integral",
|
// "booking_integral",
|
||||||
// "booking_integral_log"
|
// "booking_integral_log"
|
||||||
// "booking_order"
|
// "booking_order"
|
||||||
|
// "booking_emergency",
|
||||||
|
"user_coupon"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
@@ -132,10 +132,10 @@ public class ${table.controllerName} {
|
|||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody ${entity} ${table.entityPath}) {
|
public ApiResult<?> save(@RequestBody ${entity} ${table.entityPath}) {
|
||||||
// 记录当前登录用户id
|
// 记录当前登录用户id
|
||||||
// User loginUser = getLoginUser();
|
User loginUser = getLoginUser();
|
||||||
// if (loginUser != null) {
|
if (loginUser != null) {
|
||||||
// ${table.entityPath}.setUserId(loginUser.getUserId());
|
${table.entityPath}.setUserId(loginUser.getUserId());
|
||||||
// }
|
}
|
||||||
if (${serviceIns}.save(${table.entityPath})) {
|
if (${serviceIns}.save(${table.entityPath})) {
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user