记得上下班打卡 | git大法好,push需谨慎

Commit 5c15ddf6 authored by GaoHu's avatar GaoHu

修改演出列表接口

parent 6be3cc87
......@@ -50,11 +50,17 @@ public class SmileShowController {
}
@PostMapping("/price")
@ApiOperation("打款")
@ApiOperation("个人打款打款")
public AjaxResult price(@RequestBody SmilePriceParam smilePriceParam) {
return smileShowService.price(smilePriceParam);
}
@PostMapping("/allPrice")
@ApiOperation("演出标识打款")
public AjaxResult allPrice(String performancesId){
return smileShowService.allPrice(performancesId);
}
@PostMapping("/saleData")
@ApiOperation("销售数据")
public AjaxResult saleData(String performancesId){
......
package com.liquidnet.client.admin.zhengzai.smile.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
......@@ -14,40 +15,60 @@ public class ShowVo {
/**
* 演出id
*/
@ApiModelProperty(value ="演出id")
private String performancesId;
/**
* 演出名
*/
@ApiModelProperty(value ="演出名")
private String title;
/**
* 城市
*/
@ApiModelProperty(value ="城市")
private String cityName;
/**
* 总销售数量 -张 saleGeneral
*/
@ApiModelProperty(value ="总销售数量")
private Integer open;
/**
* 总销售金额 totalSalePrice
*/
@ApiModelProperty(value ="总销售金额")
private BigDecimal totalSalePrice;
/**
* 总销售代理
*/
@ApiModelProperty(value ="总销售代理人数")
private Long totalOutAgent;
/**
* 演出结束时间
*/
@ApiModelProperty(value ="演出结束时间")
private LocalDateTime timeEnd;
/**
* 演出结束时间
*/
private Integer orderNum;
@ApiModelProperty(value ="演出开始时间")
private LocalDateTime timeStart;
/**
* 打款状态
*/
@ApiModelProperty(value ="演出打款状态")
private String status;
/**
* 顺序
*/
@ApiModelProperty(value ="演出排列顺序")
private String comment;
}
package com.liquidnet.client.admin.zhengzai.smile.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
......@@ -8,7 +9,7 @@ import java.math.BigDecimal;
/**
* <p>
*
*
* </p>
*
* @author liquidnet
......@@ -27,26 +28,25 @@ public class SmilePriceParam implements Serializable {
/**
* 演出id
*/
@ApiModelProperty(value = "演出id")
@NotBlank(message = "演出id不能为空")
private String performancesId;
/**
* 票id
*/
@NotBlank(message = "票种id不能为空")
private String ticketsId;
/**
* 用户id
*/
@ApiModelProperty(value = "用户uid")
@NotBlank(message = "用户id不能为空")
private String uid;
/**
* 打款金额
*/
@NotBlank(message = "打款金额不能为空")
@ApiModelProperty(value = "打款金额不能为空")
private BigDecimal price;
@ApiModelProperty(value = "打款标识0打款,1未打款")
@NotBlank(message = "打款标识不能为空")
private Integer status;
}
......@@ -29,4 +29,6 @@ public interface ISmileShowService extends IService<SmileSchool> {
AjaxResult getShowById(String performancesId);
AjaxResult saleData(String performancesId);
AjaxResult allPrice(String performancesId);
}
......@@ -126,6 +126,14 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
vo.setTotalOutAgent(kylinOrderTicketRelationsMapper.concatByAgentDed(kylinPerformances.getPerformancesId()));
//演出结束时间
vo.setTimeEnd(kylinPerformances.getTimeEnd());
//演出开始时间
vo.setTimeStart(kylinPerformances.getTimeStart());
//打款状态
vo.setStatus((String) smileRedisUtils.get(SmileRedisConst.SMILE_SHOW.concat(kylinPerformances.getPerformancesId())));
//演出顺序
vo.setComment(kylinPerformances.getComment());
return vo;
}).collect(Collectors.toList());
......@@ -149,19 +157,22 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
@Override
public AjaxResult price(SmilePriceParam smilePriceParam) {
if (!smileRedisUtils.hasKey(SmileRedisConst.SELL_SHOW_PAYMENT.concat(smilePriceParam.getPerformancesId()))) {
//持久化存儲操作
SmilePrice smilePrice = new SmilePrice();
BeanUtils.copyProperties(smilePriceParam, smilePrice);
smilePrice.setCreatedAt(LocalDateTime.now());
SmilePrice smilePrice = new SmilePrice();
BeanUtils.copyProperties(smilePriceParam, smilePrice);
if (smilePriceParam.getStatus().equals(0)){
smilePrice.setCreatedDate(LocalDateTime.now());
smilePriceMapper.insert(smilePrice);
//打款演出缓存redis
smileRedisUtils.set(SmileRedisConst.SELL_SHOW_PAYMENT.concat(smilePriceParam.getPerformancesId()), 1);
} else {
smileRedisUtils.del(SmileRedisConst.SELL_SHOW_PAYMENT.concat(smilePriceParam.getPerformancesId()));
smilePriceMapper.deleteById(smilePriceParam.getId());
smileRedisUtils.set(SmileRedisConst.SELL_SHOW_PAYMENT.concat(smilePriceParam.getPerformancesId()).concat(":").concat(smilePriceParam.getUid()), 1);
}else {
//删除打款信息
smileRedisUtils.del(SmileRedisConst.SELL_SHOW_PAYMENT.concat(smilePriceParam.getPerformancesId()).concat(":").concat(smilePriceParam.getUid()));
LambdaQueryWrapper<SmilePrice> queryWrapper =Wrappers.lambdaQuery(SmilePrice.class);
queryWrapper.eq(SmilePrice::getPerformancesId,smilePriceParam.getPerformancesId());
queryWrapper.eq(SmilePrice::getUid,smilePriceParam.getUid());
smilePrice.setUpdatedDate(LocalDateTime.now());
smilePrice.setDelTag(1);
smilePriceMapper.update(smilePrice,queryWrapper);
}
return AjaxResult.success();
}
......@@ -291,6 +302,18 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
return AjaxResult.warn("请重试");
}
@Override
public AjaxResult allPrice(String performancesId) {
//缓存redis
String allPrice = (String)smileRedisUtils.get(SmileRedisConst.SELL_SHOW_PAYMENT.concat(performancesId));
if (StringUtils.isNotEmpty(allPrice)){
smileRedisUtils.set(SmileRedisConst.SELL_SHOW_PAYMENT.concat(performancesId),1);
}else {
smileRedisUtils.del(SmileRedisConst.SELL_SHOW_PAYMENT.concat(performancesId));
}
return AjaxResult.success();
}
private UserData getUserData(String performancesId, SmileUser smileUser) {
UserData userData = new UserData();
SellDataVO sellDataVO = (SellDataVO) smileRedisUtils.get(SmileRedisConst.SELL_DATA.concat(smileUser.getUid()).concat(performancesId));
......
......@@ -659,7 +659,7 @@ GROUP BY user_mobile;
</select>
<select id="selectPerIdByAgent" resultType="com.liquidnet.service.kylin.entity.KylinPerformances">
select kp.performances_id,kp.title,kp.city_name,kp.time_end,kp.comment
select kp.performances_id,kp.title,kp.city_name,kp.time_end,kp.time_start,kp.comment
from kylin_performances as kp
left join kylin_ticket_time_relation as kttr on kttr.performance_id = kp.performances_id
left join kylin_ticket_relations as ktr on ktr.times_id = kttr.times_id
......
......@@ -34,11 +34,6 @@ public class SmilePrice implements Serializable {
*/
private String performancesId;
/**
* 票id
*/
private String ticketsId;
/**
* 用户id
*/
......@@ -49,10 +44,22 @@ public class SmilePrice implements Serializable {
*/
private BigDecimal price;
/**
* 0:未删除,1:已删除
*/
private Integer delTag;
/**
* 创建时间
*/
private LocalDateTime createdAt;
private LocalDateTime createdDate;
/**
* 修改时间
*/
private LocalDateTime updatedDate;
}
......@@ -124,13 +124,15 @@ DROP TABLE IF EXISTS `smile_price`;
CREATE TABLE `smile_price` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`performances_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '演出id',
`tickets_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '票id',
`uid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户id',
`price` decimal(10, 2) NOT NULL COMMENT '打款金额',
`created_at` datetime(3) NOT NULL COMMENT '创建时间',
`del_tag` int(1) UNSIGNED ZEROFILL NULL DEFAULT 0 COMMENT '0:未删除,1:已删除',
`created_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
`updated_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
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