添加积分修改金额表单
This commit is contained in:
parent
e1cfa8e6bb
commit
a9dd3986b7
@ -0,0 +1,35 @@
|
||||
package com.cpop.oam.business.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-05-29 11:18
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "续费订单请求对象")
|
||||
public class RenewOrderBo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotBlank(message = "id不能为空")
|
||||
@ApiModelProperty(value = "id",required = true)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@NotNull(message = "价格不能为空")
|
||||
@ApiModelProperty(value = "价格",required = true)
|
||||
private BigDecimal price;
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package com.cpop.oam.business.controller.backstage;
|
||||
|
||||
import com.cpop.common.utils.StringUtils;
|
||||
import com.cpop.core.base.R;
|
||||
import com.cpop.core.base.entity.PageDomain;
|
||||
import com.cpop.core.utils.sql.SqlUtils;
|
||||
import com.cpop.oam.business.bo.RenewOrderBo;
|
||||
import com.cpop.oam.business.vo.BrandManagePageVo;
|
||||
import com.cpop.oam.business.vo.RenewOrderPageVo;
|
||||
import com.cpop.system.business.vo.BrandListVo;
|
||||
import com.mybatisflex.core.datasource.DataSourceKey;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.row.DbChain;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-05-29 10:19
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "订单接口")
|
||||
@RequestMapping("/backstage/order")
|
||||
public class BackstageOrderController {
|
||||
|
||||
|
||||
/**
|
||||
* 获取续订订单分页
|
||||
*
|
||||
* @param storeName 校区名
|
||||
* @return {@link R }<{@link Page }<{@link BrandManagePageVo }>>
|
||||
* @author DB
|
||||
* @since 2024/05/29
|
||||
*/
|
||||
@ApiOperation("获取续订订单分页")
|
||||
@GetMapping("/getRenewOrderPage")
|
||||
@PreAuthorize("@aps.hasPermission('order:storeRenew:list')")
|
||||
public R<Page<RenewOrderPageVo>> getRenewOrderPage(@RequestParam(value = "storeName", required = false) String storeId) {
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
Page<RenewOrderPageVo> page = DataSourceKey.use("jambox", () -> {
|
||||
if (StringUtils.isNotBlank(storeId)) {
|
||||
return DbChain.table("t_signContract_ticket")
|
||||
.select("tst.ticket_id as id", "tst.store_list as storeList", "tst.price as price", "if(tst.pay_status='PAY','已支付','待支付') as payStatus",
|
||||
"tst.creation_time as createTime")
|
||||
.select("(select tmi.mechanism from t_mechanism_info tmi where tmi.store_id = tst.store_list) as storeName")
|
||||
.from("t_signContract_ticket").as("tst")
|
||||
.where("pay_status = 'UNPAY'")
|
||||
.and("store_list = ?", storeId)
|
||||
.and("deleted = 1")
|
||||
.orderBy("creation_time desc")
|
||||
.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), RenewOrderPageVo.class);
|
||||
} else {
|
||||
return DbChain.table("t_signContract_ticket")
|
||||
.select("tst.ticket_id as id", "tst.store_list as storeList", "tst.price as price", "if(tst.pay_status='PAY','已支付','待支付') as payStatus",
|
||||
"tst.creation_time as createTime")
|
||||
.select("(select tmi.mechanism from t_mechanism_info tmi where tmi.store_id = tst.store_list) as storeName")
|
||||
.from("t_signContract_ticket").as("tst")
|
||||
.where("pay_status = 'UNPAY'")
|
||||
.and("deleted = 1")
|
||||
.orderBy("creation_time desc")
|
||||
.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), RenewOrderPageVo.class);
|
||||
}
|
||||
});
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新续订订单
|
||||
*
|
||||
* @param query 查询
|
||||
* @return {@link R }<{@link List }<{@link BrandListVo }>>
|
||||
* @author DB
|
||||
* @since 2024/05/29
|
||||
*/
|
||||
@ApiOperation("更新续订订单")
|
||||
@PutMapping("/updateRenewOrder")
|
||||
public R<List<BrandListVo>> updateRenewOrder(@RequestBody @Validated RenewOrderBo bo) {
|
||||
DataSourceKey.use("jambox", () -> {
|
||||
DbChain.table("t_signContract_ticket")
|
||||
.set("price", bo.getPrice())
|
||||
.set("last_modification_date", LocalDateTime.now())
|
||||
.where("ticket_id = ?", bo.getId())
|
||||
.update();
|
||||
});
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.cpop.oam.business.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-05-29 10:22
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "续费订单返回对象")
|
||||
public class RenewOrderPageVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 校区列表
|
||||
*/
|
||||
@ApiModelProperty("校区列表")
|
||||
private String storeList;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ApiModelProperty("价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
@ApiModelProperty("支付状态")
|
||||
private String payStatus;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 校区名
|
||||
*/
|
||||
@ApiModelProperty("校区名")
|
||||
private String storeName;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user