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

Commit f79844b4 authored by Administrator's avatar Administrator 🎨

Merge branch 'pre' into 'master'

Pre

See merge request !51
parents a2ceccd7 a518d300
......@@ -254,6 +254,7 @@ create table candy_coupon_code
coupon_id varchar(64) not null comment '~candy_coupon.coupon_id',
state tinyint comment '状态[0-可用|1-已用|2-无效|3-过期|4-失效|5-退回]',
ucoupon_id varchar(64) comment '~candy_user_coupon.ucoupon_id',
redeem_uid varchar(64) comment '兑换用户UID',
redeem_mobile varchar(64) comment '兑换用户手机号',
redeem_at datetime(3) comment '兑换时间',
......@@ -274,7 +275,7 @@ create table candy_user_coupon
(
mid bigint unsigned auto_increment primary key,
ucoupon_id varchar(64) not null,
mcoupon_id varchar(64) not null comment '~candy_mgt_coupon.mcoupon_id',
mcoupon_id varchar(64) comment '~candy_mgt_coupon.mcoupon_id',
uid varchar(64) not null comment '~adam_user.uid',
coupon_id varchar(64) not null comment '~candy_coupon.coupon_id',
state tinyint comment '用户券状态[1-可用|2-无效|3-已过期|5-已使用]',
......
package com.liquidnet.service.kylin.dto.vo.returns;
import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo;
import io.swagger.annotations.ApiModel;
import com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao;
import lombok.Data;
......@@ -21,7 +20,7 @@ import java.util.List;
@ApiModel
public class KylinOrderRefundBatchesPerformanceVo implements Serializable {
private KylinPerformanceMisVo kylinPerformanceMisVo;
private String title;
private List<PerformanceOrderStatisticalDao> performanceOrderStatisticalDao;
}
......@@ -48,4 +48,23 @@ public interface IKylinOrderTicketsService {
//拒绝转赠订单
ResponseDto<String> orderTransferBack(String orderId);
//想要退款详情
ResponseDto<KylinOrderTicketPreVo> toOrderRefundDetails(String orderId);
//退款详情
ResponseDto<OrderRefundVo> orderRefundDetails(String orderId,String orderRefundId);
/**
* 发起退款
* @param orderId 订单id
* @param orderTicketEntitiesId 票单id
* @param reason 退款原因
* @param picList 证据截图
* @return 是否成功
*/
String sendOrderRefund(String orderId, String orderTicketEntitiesId, String reason, String picList);
//退款撤回
ResponseDto<Boolean> orderRefundWithdraw(String orderRefundsId);
}
package com.liquidnet.client.admin.web.controller.zhengzai.kylin;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.common.annotation.Log;
import com.liquidnet.client.admin.common.core.controller.BaseController;
......@@ -13,9 +14,12 @@ import com.liquidnet.service.kylin.dao.OrderRefundBatchDao;
import com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao;
import com.liquidnet.service.kylin.dto.param.RefundBatchApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundBatchSearchParam;
import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo;
import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderRefundBatchesPerformanceVo;
import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderRefundBatchesVo;
import com.liquidnet.service.kylin.entity.KylinPerformanceStatus;
import com.liquidnet.service.kylin.entity.KylinPerformances;
import com.liquidnet.service.kylin.mapper.KylinPerformanceStatusMapper;
import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -45,6 +49,12 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
@Autowired
private KylinPerformancesAdminServiceImpl kylinPerformancesService;
@Autowired
private KylinPerformanceStatusMapper performanceStatusMapper;
@Autowired
private KylinPerformancesMapper performancesMapper;
@RequiresPermissions("kylin:refundBatch:view")
@GetMapping()
public String operlog()
......@@ -83,16 +93,23 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
public AjaxResult applyPerformance(RefundBatchApplyParam refundBatchApplyParam) {
String performancesId = refundBatchApplyParam.getTargetId();
//获取演出详情
KylinPerformanceMisVo performanceMisVo = kylinPerformancesService.performanceDetails(performancesId);
if (null == performanceMisVo) {
KylinPerformances kylinPerformances = performancesMapper.selectOne(Wrappers.lambdaQuery(KylinPerformances.class)
.eq(KylinPerformances::getPerformancesId, performancesId)
.select(KylinPerformances::getTitle)
);
KylinPerformanceStatus kylinPerformanceStatus = performanceStatusMapper.selectOne(Wrappers.lambdaQuery(KylinPerformanceStatus.class)
.eq(KylinPerformanceStatus::getPerformanceId, performancesId)
.select(KylinPerformanceStatus::getStatus)
);
if (null == kylinPerformances) {
return error("未找到该演出数据");
}
if (performanceMisVo.getStatus() != 7) {
if (kylinPerformanceStatus.getStatus() != 7) {
return error("当前演出未下架,不可退款");
}
List<PerformanceOrderStatisticalDao> result = kylinPerformancesService.getPerformanceOrderStatisticalList(performancesId);
KylinOrderRefundBatchesPerformanceVo kylinOrderRefundBatchesPerformanceVo = new KylinOrderRefundBatchesPerformanceVo();
kylinOrderRefundBatchesPerformanceVo.setKylinPerformanceMisVo(performanceMisVo);
kylinOrderRefundBatchesPerformanceVo.setTitle(kylinPerformances.getTitle());
kylinOrderRefundBatchesPerformanceVo.setPerformanceOrderStatisticalDao(result);
return AjaxResult.success(kylinOrderRefundBatchesPerformanceVo);
}
......
......@@ -61,7 +61,7 @@
layer.msg(result.msg);
return false;
}
$("#performanceTitle").text(result.data.kylinPerformanceMisVo.title);
$("#performanceTitle").text(result.data.title);
var options = {
data: result.data.performanceOrderStatisticalDao,
pagination: false,
......
......@@ -90,11 +90,6 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
public KylinPerformanceMisVo performanceDetails(String performancesId) {
log.info(" PERFORMANCE mis演出详情");
KylinPerformanceMisVo createMisVo = performanceVoUtils.getPerformanceMisVo(performancesId);
KylinPerformanceStatus kylinPerformanceStatus = performanceStatusMapper.selectOne(Wrappers.lambdaQuery(KylinPerformanceStatus.class)
.eq(KylinPerformanceStatus::getPerformanceId, performancesId)
.select(KylinPerformanceStatus::getStatus)
);
createMisVo.setStatus(kylinPerformanceStatus.getStatus());
return createMisVo;
}
......
......@@ -39,10 +39,16 @@ public class CandyCouponCode implements Serializable {
*/
private Integer state;
/**
* ~candy_user_coupon.ucoupon_id
*/
private String ucouponId;
/**
* 兑换用户UID
*/
private String redeemUid;
/**
* 兑换用户手机号
*/
......
......@@ -140,7 +140,7 @@ public class AdamUserInfoServiceImpl implements IAdamUserInfoService {
s = System.currentTimeMillis();
toMqSqls.add(SqlMapping.get("adam_user.complete"));
updateUserObjs.add(new Object[]{1, existUserInfoVo.getUpdatedAt(), existUserInfoVo.getUid()});
updateUserObjs.add(new Object[]{existUserInfoVo.getIsComplete(), existUserInfoVo.getUpdatedAt(), existUserInfoVo.getUid()});
toMqSqls.add(SqlMapping.get("adam_user_info.edit"));
updateUserInfoObjs.add(new Object[]{
existUserInfoVo.getNickname(), sexStr, existUserInfoVo.getBirthday(), existUserInfoVo.getArea(),
......
......@@ -90,6 +90,7 @@ create table candy_coupon_code
coupon_id varchar(64) not null comment '~candy_coupon.coupon_id',
state tinyint comment '状态[0-可用|1-已用|2-无效|3-过期|4-失效|5-退回]',
ucoupon_id varchar(64) comment '~candy_user_coupon.ucoupon_id',
redeem_uid varchar(64) comment '兑换用户UID',
redeem_mobile varchar(64) comment '兑换用户手机号',
redeem_at datetime(3) comment '兑换时间',
......@@ -110,7 +111,7 @@ create table candy_user_coupon
(
mid bigint unsigned auto_increment primary key,
ucoupon_id varchar(64) not null,
mcoupon_id varchar(64) not null comment '~candy_mgt_coupon.mcoupon_id',
mcoupon_id varchar(64) comment '~candy_mgt_coupon.mcoupon_id',
uid varchar(64) not null comment '~adam_user.uid',
coupon_id varchar(64) not null comment '~candy_coupon.coupon_id',
state tinyint comment '用户券状态[1-可用|2-无效|3-已过期|5-已使用]',
......
......@@ -484,8 +484,8 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
objsCouponCode = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("candy_coupon.receive"));
objsUserCoupon.add(new Object[]{uCouponId, uid, 1, infoDto.getCouponId(), ccode, now, now, infoDto.getExpireAt()});
toMqSqls.add(SqlMapping.get("candy_coupon_code.receive"));
objsCouponCode.add(new Object[]{uid, mobile, now, now, dto.getCouponId(), ccode});
toMqSqls.add(SqlMapping.get("candy_coupon_code.receive"));// state:状态[0-可用|1-已用]
objsCouponCode.add(new Object[]{1, uCouponId, uid, mobile, now, now, dto.getCouponId(), ccode});
queueUtils.sendMsgByRedis(
MQConst.CandyQueue.COUPON_RECEIVE.getKey(),
SqlMapping.gets(toMqSqls, objsUserCoupon, objsCouponCode)
......
......@@ -6,4 +6,4 @@ candy_coupon.use_insert=INSERT INTO candy_user_coupon (ucoupon_id , uid , state
candy_coupon.back=UPDATE candy_user_coupon SET state = 1 WHERE uid = ? AND ucoupon_id = ?
# -- 领取券 --
candy_coupon.receive=INSERT INTO candy_user_coupon (ucoupon_id , uid , state , coupon_id , ccode , bind_at , created_at , dued_at) VALUE ( ? , ? , ? , ? , ? , ? , ? , ?)
candy_coupon_code.receive=UPDATE candy_coupon_code SET redeem_uid=?,redeem_mobile=?,redeem_at=?,updated_at=? WHERE coupon_id=? AND ccode=?
candy_coupon_code.receive=UPDATE candy_coupon_code SET state=?,ucoupon_id=?,redeem_uid=?,redeem_mobile=?,redeem_at=?,updated_at=? WHERE coupon_id=? AND ccode=?
......@@ -153,4 +153,43 @@ public class KylinOrderTicketsController {
public ResponseDto<String> orderTransferBack(@RequestParam(value = "orderId") String orderId) {
return orderTicketsService.orderTransferBack(orderId);
}
@GetMapping("toOrderRefundDetails")
@ApiOperation("想要退款订单详情")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<KylinOrderTicketPreVo> toOrderRefundDetails(@RequestParam(value = "orderId", required = false) @NotNull(message = "订单ID不能为空") String orderId) {
return orderTicketsService.toOrderRefundDetails(orderId);
}
@PostMapping("sendOrderRefunds")
@ApiOperation("发起退款申请")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<HashMap<String, String>> sendOrderRefund(@RequestParam(value = "orderId", required = true) @NotNull(message = "订单ID不能为空") String orderId,
@RequestParam(value = "orderTicketEntitiesId", required = true) @NotNull(message = "票单ID不能为空") String orderTicketEntitiesId,
@RequestParam(value = "reason", required = true) @NotNull(message = "退款原因不能为空") String reason,
@RequestParam(value = "picList", required = false) String picList) {
String orderRefundId = orderTicketsService.sendOrderRefund(orderId, orderTicketEntitiesId, reason, picList);
if (orderRefundId.length() > 10) {
HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("orderRefundsId", orderRefundId);
return ResponseDto.success(map);
} else {
return ResponseDto.failure(orderRefundId);
}
}
@GetMapping("orderRefundDetails")
@ApiOperation("退款申请详情")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<OrderRefundVo> orderRefundDetails(@RequestParam(value = "orderId", required = true) @NotNull(message = "订单ID不能为空") String orderId,
@RequestParam(value = "orderRefundId", required = true) @NotNull(message = "退款订单ID不能为空") String orderRefundId) {
return orderTicketsService.orderRefundDetails(orderId, orderRefundId);
}
@PostMapping("orderRefundWithdraw")
@ApiOperation("发起退款撤回")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> orderRefundWithdraw(@RequestParam(value = "orderRefundId", required = true) @NotNull(message = "退款订单ID不能为空") String orderRefundId) {
return orderTicketsService.orderRefundWithdraw(orderRefundId);
}
}
......@@ -196,4 +196,159 @@ public class KylinRefundsStatusServiceImpl {
return "";
}
}
public String userOrderTicketRefunding(
KylinOrderTicketVo orderInfo,
double refundPrice,
String orderEntitiesId,
String reason,
String picList,
String uid,
String username,
int refundCount
) {
try {
LocalDateTime time = LocalDateTime.now();
String strTime = DateUtil.Formatter.yyyyMMddHHmmss.format(time);
// 订单状态表 和 缓存
KylinOrderTicketStatus orderStatusTable = new KylinOrderTicketStatus();
orderStatusTable.setStatus(KylinTableStatusConst.ORDER_STATUS3);
orderStatusTable.setUpdatedAt(time);
KylinOrderTicketVo kylinOrderTicketVo = KylinOrderTicketVo.getNew();
kylinOrderTicketVo.setStatus(KylinTableStatusConst.ORDER_STATUS3);
kylinOrderTicketVo.setUpdatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(time));
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(kylinOrderTicketVo)));
mongoTemplate.getCollection(KylinOrderTicketVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderTicketsId").is(orderInfo.getOrderTicketsId())).getQueryObject(),
orderObject
);
dataUtils.delOrderTicketRedis(orderInfo.getOrderTicketsId());
log.info("orderInfo.getUserId() = "+ orderInfo.getUserId());
orderUtils.resetOrderListVo(orderInfo.getUserId(), 2, orderInfo.getOrderTicketsId(), null);
// 订单入场人表 和 缓存
KylinOrderTicketEntities entitiesTable = new KylinOrderTicketEntities();
entitiesTable.setIsPayment(KylinTableStatusConst.ENTITIES_IS_PAYMENT2);
entitiesTable.setUpdatedAt(time);
// BigDecimal oldRefundPrice = BigDecimal.valueOf(0);
// for (KylinOrderTicketEntitiesVo item :orderInfo.getEntitiesVoList()) {
// if(item.getOrderTicketEntitiesId().equalsIgnoreCase(orderEntitiesId)){
// oldRefundPrice = item.getRefundPrice();
// break;
// }
// }
KylinOrderTicketEntitiesVo kylinOrderTicketEntitiesVo = KylinOrderTicketEntitiesVo.getNew();
kylinOrderTicketEntitiesVo.setIsPayment(KylinTableStatusConst.ENTITIES_IS_PAYMENT2);
// kylinOrderTicketEntitiesVo.setRefundPrice(oldRefundPrice.add(BigDecimal.valueOf(refundPrice)));
kylinOrderTicketEntitiesVo.setUpdatedAt(strTime);
BasicDBObject entitiesObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(kylinOrderTicketEntitiesVo)));
mongoTemplate.getCollection(KylinOrderTicketEntitiesVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderTicketEntitiesId").is(orderEntitiesId)).getQueryObject(),
entitiesObject
);
dataUtils.delOrderTicketEntitiesRedis(orderEntitiesId);
// 退款明细
KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds();
String orderRefundsId = IDGenerator.nextSnowId();
kylinOrderRefunds.setOrderRefundsId(orderRefundsId);
kylinOrderRefunds.setOrderTicketsId(orderInfo.getOrderTicketsId());
String orderRefundCode = orderInfo.getOrderCode();
String codeNum = StringUtils.leftPad(String.valueOf(refundCount), 3, "0");
kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(codeNum));
kylinOrderRefunds.setPrice(BigDecimal.valueOf(refundPrice));
kylinOrderRefunds.setPriceExpress(orderInfo.getPriceExpress());
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY);
kylinOrderRefunds.setType(KylinTableStatusConst.ORDER_REFUND_TYPE_APPLY);
kylinOrderRefunds.setApplicantId(uid);
kylinOrderRefunds.setApplicantName(username);
kylinOrderRefunds.setApplicantAt(time);
kylinOrderRefunds.setReason(reason);
kylinOrderRefunds.setCreatedAt(time);
KylinOrderRefundsVo orderRefundsVo = KylinOrderRefundsVo.getNew();
BeanUtils.copyProperties(kylinOrderRefunds, orderRefundsVo);
orderRefundsVo.setCreatedAt(time);
orderRefundsVo.setApplicantAt(time);
mongoTemplate.insert(orderRefundsVo, KylinOrderRefundsVo.class.getSimpleName());
// 退款入场人表
KylinOrderRefundEntities kylinOrderRefundEntities = new KylinOrderRefundEntities();
String orderRefundsEntitiesId = IDGenerator.nextSnowId();
kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId);
kylinOrderRefundEntities.setOrderRefundsId(orderRefundsId);
kylinOrderRefundEntities.setRefundPrice(BigDecimal.valueOf(refundPrice));
kylinOrderRefundEntities.setOrderTicketEntitiesId(orderEntitiesId);
kylinOrderRefundEntities.setCreatedAt(time);
KylinOrderRefundEntitiesVo orderRefundEntitiesVo = KylinOrderRefundEntitiesVo.getNew();
BeanUtils.copyProperties(kylinOrderRefundEntities, orderRefundEntitiesVo);
orderRefundEntitiesVo.setCreatedAt(strTime);
mongoTemplate.insert(orderRefundEntitiesVo, KylinOrderRefundEntitiesVo.class.getSimpleName());
//退款图片
KylinOrderRefundPic orderRefundPic = new KylinOrderRefundPic();
orderRefundPic.setRefundPicId(IDGenerator.nextSnowId());
orderRefundPic.setOrderRefundsId(kylinOrderRefunds.getOrderRefundsId());
orderRefundPic.setPicUrl(picList);
orderRefundPic.setCreatedAt(time);
KylinOrderRefundPicVo orderRefundPicVo = new KylinOrderRefundPicVo();
BeanUtils.copyProperties(orderRefundPic, orderRefundPicVo);
orderRefundPicVo.setCreatedAt(strTime);
mongoTemplate.insert(orderRefundPicVo, KylinOrderRefundPicVo.class.getSimpleName());
dataUtils.delOrderRefundVoByOrderId(orderInfo.getOrderTicketsId());
//MQ
LinkedList<String> sqls = CollectionUtil.linkedListString();
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> sqlsDataB = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> sqlsDataC = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> sqlsDataD = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> sqlsDataE = CollectionUtil.linkedListObjectArr();
sqls.add(SqlMapping.get("kylin_order_ticket_status.refund"));
sqls.add(SqlMapping.get("kylin_order_ticket_entities.refund"));
sqls.add(SqlMapping.get("kylin_order_refund.refund"));
sqls.add(SqlMapping.get("kylin_order_refund_entities.refund"));
sqls.add(SqlMapping.get("kylin_order_refund_pic.refund"));
LocalDateTime now1 = LocalDateTime.now();
sqlsDataA.add(new Object[]{
orderStatusTable.getStatus(), orderStatusTable.getUpdatedAt(), orderInfo.getOrderTicketsId(),now1, now1
});
sqlsDataB.add(new Object[]{
entitiesTable.getIsPayment(), entitiesTable.getUpdatedAt(), orderEntitiesId,now1, now1
});
sqlsDataC.add(new Object[]{
kylinOrderRefunds.getOrderRefundsId(), kylinOrderRefunds.getOrderTicketsId(), kylinOrderRefunds.getOrderRefundCode(),
kylinOrderRefunds.getPrice(), kylinOrderRefunds.getPriceExpress(), 0, kylinOrderRefunds.getStatus(),
kylinOrderRefunds.getType(), kylinOrderRefunds.getApplicantId(), kylinOrderRefunds.getApplicantName(),
kylinOrderRefunds.getApplicantAt(), kylinOrderRefunds.getReason(), kylinOrderRefunds.getCreatedAt()
});
sqlsDataD.add(new Object[]{
kylinOrderRefundEntities.getOrderRefundsEntitiesId(), kylinOrderRefundEntities.getOrderRefundsId(), kylinOrderRefundEntities.getRefundPrice(),
kylinOrderRefundEntities.getOrderTicketEntitiesId(), kylinOrderRefundEntities.getCreatedAt()
});
sqlsDataE.add(new Object[]{
orderRefundPic.getOrderRefundsId(), orderRefundPic.getOrderRefundsId(), orderRefundPic.getPicUrl(), orderRefundPic.getCreatedAt()
});
queueUtils.sendMsgByRedis(MQConst.KylinQueue.SQL_ORDER_REFUND.getKey(),
SqlMapping.gets(sqls, sqlsDataA, sqlsDataB, sqlsDataC, sqlsDataD, sqlsDataE));
return kylinOrderRefunds.getOrderRefundsId();
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
}
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