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

Commit 6c2accda authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/dev' into dev

parents 1b6d0bdf 1eb145ca
...@@ -14,7 +14,8 @@ public class AdamEntersParam implements java.io.Serializable { ...@@ -14,7 +14,8 @@ public class AdamEntersParam implements java.io.Serializable {
@ApiModelProperty(position = 10, required = false, value = "入场人ID,编辑时必传[50]") @ApiModelProperty(position = 10, required = false, value = "入场人ID,编辑时必传[50]")
private String entersId; private String entersId;
@ApiModelProperty(position = 11, required = true, value = "入场人姓名[50]", example = "测试") @ApiModelProperty(position = 11, required = true, value = "入场人姓名[50]", example = "测试")
@Pattern(regexp = LnsRegex.Valid.CHINESE_HANZI, message = "姓名必须为2~20位汉字") // @Pattern(regexp = LnsRegex.Valid.CHINESE_HANZI, message = "姓名必须为2~20位汉字")
@Size(min = 1, max = 30)
private String name; private String name;
@ApiModelProperty(position = 12, required = true, value = "入场人手机号[11]", example = "13100000000") @ApiModelProperty(position = 12, required = true, value = "入场人手机号[11]", example = "13100000000")
@Pattern(regexp = "\\d{11}", message = "手机号格式有误") @Pattern(regexp = "\\d{11}", message = "手机号格式有误")
...@@ -22,7 +23,8 @@ public class AdamEntersParam implements java.io.Serializable { ...@@ -22,7 +23,8 @@ public class AdamEntersParam implements java.io.Serializable {
@ApiModelProperty(position = 13, required = true, value = "证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证", allowableValues = "1,2,3,4,5") @ApiModelProperty(position = 13, required = true, value = "证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证", allowableValues = "1,2,3,4,5")
@NotNull @Min(1) @Max(5) @NotNull @Min(1) @Max(5)
private Integer type; private Integer type;
@ApiModelProperty(position = 14, required = true, value = "入场人证件号[11]", example = "110101110001010111") @ApiModelProperty(position = 14, required = true, value = "入场人证件号[30]", example = "110101110001010111")
// @Pattern(regexp = LnsRegex.Valid.CHINESE_ID_CARD, message = "身份证号格式有误") @Pattern(regexp = LnsRegex.Valid.LETTER_NUMBER, message = "证件号格式有误")
@Size(min = 1, max = 30)
private String idCard; private String idCard;
} }
...@@ -21,4 +21,5 @@ public class KylinOrderTicketEntitiesPreRefundVo implements Serializable, Clonea ...@@ -21,4 +21,5 @@ public class KylinOrderTicketEntitiesPreRefundVo implements Serializable, Clonea
private BigDecimal priceActual; private BigDecimal priceActual;
private BigDecimal priceCanRefund; private BigDecimal priceCanRefund;
private String ticketTitle; private String ticketTitle;
private Integer isPayment;
} }
...@@ -59,7 +59,7 @@ public interface IKylinOrderTicketsService { ...@@ -59,7 +59,7 @@ public interface IKylinOrderTicketsService {
* @param picList 证据截图 * @param picList 证据截图
* @return 是否成功 * @return 是否成功
*/ */
ResponseDto<String> sendOrderRefund(String orderId, String orderTicketEntitiesId, String reason, String picList); String sendOrderRefund(String orderId, String orderTicketEntitiesId, String reason, String picList);
//退款撤回 //退款撤回
ResponseDto<Boolean> orderRefundWithdraw(String orderRefundsId); ResponseDto<Boolean> orderRefundWithdraw(String orderRefundsId);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-refund-edit" th:object="${performanceRefundConfigVo}"> <form class="form-horizontal m" id="form-refund-edit" th:object="${performanceRefundConfigVo}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">performances_id:</label> <label class="col-sm-3 control-label is-required">演出id:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="performancesId" th:field="*{performancesId}" class="form-control" type="text" readonly> <input name="performancesId" th:field="*{performancesId}" class="form-control" type="text" readonly>
</div> </div>
...@@ -80,12 +80,17 @@ ...@@ -80,12 +80,17 @@
refundOpenTime: $("input[name^='refundOpenTime']").val(), refundOpenTime: $("input[name^='refundOpenTime']").val(),
refundCloseTime: $("input[name^='refundCloseTime']").val() refundCloseTime: $("input[name^='refundCloseTime']").val()
} }
if ($("input[name^='refundCloseTime']").val() == "" || $("input[name^='refundOpenTime']").val() == "") {
alert("定时时间不能为空");
} else {
$.operate.post(prefix + "/refundConfig/change", $.operate.post(prefix + "/refundConfig/change",
param, param,
function (res) { function (res) {
location.reload(); location.reload();
}); });
} }
}
</script> </script>
</body> </body>
</html> </html>
...@@ -22,5 +22,9 @@ public class LnsRegex { ...@@ -22,5 +22,9 @@ public class LnsRegex {
* 身份证号(15位||18位) * 身份证号(15位||18位)
*/ */
public static final String CHINESE_ID_CARD = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)"; public static final String CHINESE_ID_CARD = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)";
/**
* 字母、数字组合
*/
public static final String LETTER_NUMBER = "^[A-Z0-9]+$";
} }
} }
...@@ -2,6 +2,8 @@ package com.liquidnet.service.adam.controller; ...@@ -2,6 +2,8 @@ package com.liquidnet.service.adam.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport; import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.common.exception.constant.ErrorCode;
import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.commons.lang.util.CurrentUtil; import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.SensitizeUtil; import com.liquidnet.commons.lang.util.SensitizeUtil;
import com.liquidnet.service.adam.dto.AdamEntersParam; import com.liquidnet.service.adam.dto.AdamEntersParam;
...@@ -23,6 +25,7 @@ import javax.validation.Valid; ...@@ -23,6 +25,7 @@ import javax.validation.Valid;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.regex.Pattern;
/** /**
* <p> * <p>
...@@ -48,6 +51,12 @@ public class AdamEntersController { ...@@ -48,6 +51,12 @@ public class AdamEntersController {
@ApiOperation(value = "添加入场人") @ApiOperation(value = "添加入场人")
@PostMapping("add") @PostMapping("add")
public ResponseDto<String> add(@RequestBody @Valid AdamEntersParam parameter) { public ResponseDto<String> add(@RequestBody @Valid AdamEntersParam parameter) {
if (1 == parameter.getType()) {
if (!Pattern.matches(LnsRegex.Valid.CHINESE_HANZI, parameter.getName())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "姓名必须为2~20位汉字");
}
}
List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(CurrentUtil.getCurrentUid()); List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(CurrentUtil.getCurrentUid());
Optional<AdamEntersVo> any = vos.stream().filter(r -> (r.getIdCard().equals(parameter.getIdCard())) && r.getType().equals(parameter.getType())).findAny(); Optional<AdamEntersVo> any = vos.stream().filter(r -> (r.getIdCard().equals(parameter.getIdCard())) && r.getType().equals(parameter.getType())).findAny();
...@@ -93,6 +102,11 @@ public class AdamEntersController { ...@@ -93,6 +102,11 @@ public class AdamEntersController {
@ApiOperation(value = "编辑入场人") @ApiOperation(value = "编辑入场人")
@PostMapping("edit") @PostMapping("edit")
public ResponseDto<Object> edit(@RequestBody @Valid AdamEntersParam parameter) { public ResponseDto<Object> edit(@RequestBody @Valid AdamEntersParam parameter) {
if (1 == parameter.getType()) {
if (!Pattern.matches(LnsRegex.Valid.CHINESE_HANZI, parameter.getName())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "姓名必须为2~20位汉字");
}
}
if (StringUtils.isBlank(parameter.getEntersId())) { if (StringUtils.isBlank(parameter.getEntersId())) {
return ResponseDto.failure(ErrorMapping.get("10015")); return ResponseDto.failure(ErrorMapping.get("10015"));
} }
......
...@@ -40,45 +40,14 @@ public class ConsumerProcessor { ...@@ -40,45 +40,14 @@ public class ConsumerProcessor {
@Autowired @Autowired
private KylinUtils kylinUtils; private KylinUtils kylinUtils;
// @RabbitListener(bindings = @QueueBinding(
// exchange = @Exchange(MQConst.EXCHANGES_LIQUIDNET_SQL), key = MQConst.ROUTING_KEY_SQL,
// value = @Queue(MQConst.QUEUES_SQL_MAIN)
// ))
//// @RabbitListener(queues = MQConst.QUEUES_SQL_MAIN)
// public void consumerSql(Message msg, Channel channel) {
// SqlMapping.SqlMessage sqlMessage = JsonUtils.fromJson(new String(msg.getBody()), SqlMapping.SqlMessage.class);
// log.debug("consumer sql ==> Preparing:{}", JsonUtils.toJson(sqlMessage.getSqls()));
// log.debug("consumer sql ==> Parameters:{}", JsonUtils.toJson(sqlMessage.getArgs()));
//
// try {
// Boolean rstBatchSqls = baseDao.batchSqls(sqlMessage.getSqls(), sqlMessage.getArgs());
// log.debug("consumer sql result of execution:{}", rstBatchSqls);
// if (rstBatchSqls) {
// channel.basicAck(msg.getMessageProperties().getDeliveryTag(), false);
// } else {
// channel.basicReject(msg.getMessageProperties().getDeliveryTag(), true);
// }
// } catch (Exception e) {
// log.error("error:consumer sql:{}", JsonUtils.toJson(sqlMessage), e);
// try {
// channel.basicReject(msg.getMessageProperties().getDeliveryTag(), true);
// } catch (IOException ioException) {
// log.error("error:consumer sql:basicReject.msg.tag:{}", msg.getMessageProperties().getDeliveryTag(), ioException);
// }
// }
// }
private void consumerSqlDaoHandler(Message msg, Channel channel) { private void consumerSqlDaoHandler(Message msg, Channel channel) {
MessageProperties properties = msg.getMessageProperties(); MessageProperties properties = msg.getMessageProperties();
String consumerQueue = properties.getConsumerQueue(); String consumerQueue = properties.getConsumerQueue();
long deliveryTag = properties.getDeliveryTag(); long deliveryTag = properties.getDeliveryTag();
log.info("CONSUMER SQL ==> [consumerQueue:{},deliveryTag:{}]", consumerQueue, deliveryTag);
SqlMapping.SqlMessage sqlMessage = JsonUtils.fromJson(new String(msg.getBody()), SqlMapping.SqlMessage.class); SqlMapping.SqlMessage sqlMessage = JsonUtils.fromJson(new String(msg.getBody()), SqlMapping.SqlMessage.class);
log.debug("CONSUMER SQL ==> Preparing:{}", JsonUtils.toJson(sqlMessage.getSqls()));
log.debug("CONSUMER SQL ==> Parameters:{}", JsonUtils.toJson(sqlMessage.getArgs()));
try { try {
Boolean rstBatchSqls = baseDao.batchSqls(sqlMessage.getSqls(), sqlMessage.getArgs()); Boolean rstBatchSqls = baseDao.batchSqls(sqlMessage.getSqls(), sqlMessage.getArgs());
log.debug("CONSUMER SQL result of execution:{}", rstBatchSqls);
if (rstBatchSqls) { if (rstBatchSqls) {
channel.basicAck(deliveryTag, false); channel.basicAck(deliveryTag, false);
} else { } else {
...@@ -97,7 +66,6 @@ public class ConsumerProcessor { ...@@ -97,7 +66,6 @@ public class ConsumerProcessor {
long deliveryTag = properties.getDeliveryTag(); long deliveryTag = properties.getDeliveryTag();
String jsonStr = StringEscapeUtils.unescapeJava(new String(msg.getBody())); String jsonStr = StringEscapeUtils.unescapeJava(new String(msg.getBody()));
OrderCloseMapping.orderCloseMessage mqMessage = JsonUtils.fromJson(jsonStr.substring(1, jsonStr.length() - 1), OrderCloseMapping.orderCloseMessage.class); OrderCloseMapping.orderCloseMessage mqMessage = JsonUtils.fromJson(jsonStr.substring(1, jsonStr.length() - 1), OrderCloseMapping.orderCloseMessage.class);
log.debug("CONSUMER SQL ==> orderCloseMessage.orderTicketIds:{}", mqMessage.getOrderTicketIds());
try { try {
for (int x = 0; x< mqMessage.getOrderTicketIds().size(); x++) { for (int x = 0; x< mqMessage.getOrderTicketIds().size(); x++) {
String t = mqMessage.getOrderTicketIds().get(x); String t = mqMessage.getOrderTicketIds().get(x);
...@@ -120,33 +88,6 @@ public class ConsumerProcessor { ...@@ -120,33 +88,6 @@ public class ConsumerProcessor {
} }
} }
// // 用户注册
// @RabbitListener(bindings = @QueueBinding(
// exchange = @Exchange(MQConst.EX_LNS_SQL_UCENTER), key = MQConst.RK_SQL_UREGISTER,
// value = @Queue(MQConst.QUEUES_SQL_UREGISTER)
// ))
// public void consumerSqlForURegister(Message msg, Channel channel) {
// this.consumerSqlDaoHandler(msg, channel);
// }
//
// // 用户信息
// @RabbitListener(bindings = @QueueBinding(
// exchange = @Exchange(MQConst.EX_LNS_SQL_UCENTER), key = MQConst.RK_SQL_UCENTER,
// value = @Queue(MQConst.QUEUES_SQL_UCENTER)
// ))
// public void consumerSqlForUCenter(Message msg, Channel channel) {
// this.consumerSqlDaoHandler(msg, channel);
// }
//
// // 会员购买
// @RabbitListener(bindings = @QueueBinding(
// exchange = @Exchange(MQConst.EX_LNS_SQL_UCENTER), key = MQConst.RK_SQL_UMEMBER,
// value = @Queue(MQConst.QUEUES_SQL_UMEMBER)
// ))
// public void consumerSqlForUMember(Message msg, Channel channel) {
// this.consumerSqlDaoHandler(msg, channel);
// }
// 验票更新 // 验票更新
@RabbitListener(bindings = @QueueBinding( @RabbitListener(bindings = @QueueBinding(
exchange = @Exchange(MQConst.EX_LNS_SQL_STATION), key = MQConst.RK_SQL_STATION, exchange = @Exchange(MQConst.EX_LNS_SQL_STATION), key = MQConst.RK_SQL_STATION,
...@@ -162,7 +103,6 @@ public class ConsumerProcessor { ...@@ -162,7 +103,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate(Message msg, Channel channel) { public void consumerOrderCreate(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -171,7 +111,6 @@ public class ConsumerProcessor { ...@@ -171,7 +111,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate1(Message msg, Channel channel) { public void consumerOrderCreate1(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -180,7 +119,6 @@ public class ConsumerProcessor { ...@@ -180,7 +119,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate2(Message msg, Channel channel) { public void consumerOrderCreate2(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -189,7 +127,6 @@ public class ConsumerProcessor { ...@@ -189,7 +127,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate3(Message msg, Channel channel) { public void consumerOrderCreate3(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -198,7 +135,6 @@ public class ConsumerProcessor { ...@@ -198,7 +135,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate4(Message msg, Channel channel) { public void consumerOrderCreate4(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -207,7 +143,6 @@ public class ConsumerProcessor { ...@@ -207,7 +143,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate5(Message msg, Channel channel) { public void consumerOrderCreate5(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -216,7 +151,6 @@ public class ConsumerProcessor { ...@@ -216,7 +151,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate6(Message msg, Channel channel) { public void consumerOrderCreate6(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -225,7 +159,6 @@ public class ConsumerProcessor { ...@@ -225,7 +159,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate7(Message msg, Channel channel) { public void consumerOrderCreate7(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -234,7 +167,6 @@ public class ConsumerProcessor { ...@@ -234,7 +167,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate8(Message msg, Channel channel) { public void consumerOrderCreate8(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -243,7 +175,6 @@ public class ConsumerProcessor { ...@@ -243,7 +175,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CREATE)
)) ))
public void consumerOrderCreate9(Message msg, Channel channel) { public void consumerOrderCreate9(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CREATE ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -253,7 +184,6 @@ public class ConsumerProcessor { ...@@ -253,7 +184,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_AGAIN) value = @Queue(MQConst.QUEUES_SQL_ORDER_AGAIN)
)) ))
public void consumerOrderPayAgain(Message msg, Channel channel) { public void consumerOrderPayAgain(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY_AGAIN ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -263,7 +193,6 @@ public class ConsumerProcessor { ...@@ -263,7 +193,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose(Message msg, Channel channel) { public void consumerOrderClose(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -272,7 +201,6 @@ public class ConsumerProcessor { ...@@ -272,7 +201,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose1(Message msg, Channel channel) { public void consumerOrderClose1(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -281,7 +209,6 @@ public class ConsumerProcessor { ...@@ -281,7 +209,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose2(Message msg, Channel channel) { public void consumerOrderClose2(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -290,7 +217,6 @@ public class ConsumerProcessor { ...@@ -290,7 +217,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose3(Message msg, Channel channel) { public void consumerOrderClose3(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -299,7 +225,6 @@ public class ConsumerProcessor { ...@@ -299,7 +225,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose4(Message msg, Channel channel) { public void consumerOrderClose4(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -308,7 +233,6 @@ public class ConsumerProcessor { ...@@ -308,7 +233,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose5(Message msg, Channel channel) { public void consumerOrderClose5(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -317,7 +241,6 @@ public class ConsumerProcessor { ...@@ -317,7 +241,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose6(Message msg, Channel channel) { public void consumerOrderClose6(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -326,7 +249,6 @@ public class ConsumerProcessor { ...@@ -326,7 +249,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose7(Message msg, Channel channel) { public void consumerOrderClose7(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -335,7 +257,6 @@ public class ConsumerProcessor { ...@@ -335,7 +257,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose8(Message msg, Channel channel) { public void consumerOrderClose8(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -344,7 +265,6 @@ public class ConsumerProcessor { ...@@ -344,7 +265,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE) value = @Queue(MQConst.QUEUES_SQL_ORDER_CLOSE)
)) ))
public void consumerOrderClose9(Message msg, Channel channel) { public void consumerOrderClose9(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_CLOSE ===");
this.consumerOperationOrderClose(msg, channel); this.consumerOperationOrderClose(msg, channel);
} }
...@@ -355,7 +275,6 @@ public class ConsumerProcessor { ...@@ -355,7 +275,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay(Message msg, Channel channel) { public void consumerOrderPay(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -364,7 +283,6 @@ public class ConsumerProcessor { ...@@ -364,7 +283,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay1(Message msg, Channel channel) { public void consumerOrderPay1(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -373,7 +291,6 @@ public class ConsumerProcessor { ...@@ -373,7 +291,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay2(Message msg, Channel channel) { public void consumerOrderPay2(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -382,7 +299,6 @@ public class ConsumerProcessor { ...@@ -382,7 +299,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay3(Message msg, Channel channel) { public void consumerOrderPay3(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -391,7 +307,6 @@ public class ConsumerProcessor { ...@@ -391,7 +307,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay4(Message msg, Channel channel) { public void consumerOrderPay4(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -400,7 +315,6 @@ public class ConsumerProcessor { ...@@ -400,7 +315,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay5(Message msg, Channel channel) { public void consumerOrderPay5(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -409,7 +323,6 @@ public class ConsumerProcessor { ...@@ -409,7 +323,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay6(Message msg, Channel channel) { public void consumerOrderPay6(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -418,7 +331,6 @@ public class ConsumerProcessor { ...@@ -418,7 +331,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay7(Message msg, Channel channel) { public void consumerOrderPay7(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -427,7 +339,6 @@ public class ConsumerProcessor { ...@@ -427,7 +339,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay8(Message msg, Channel channel) { public void consumerOrderPay8(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -436,7 +347,6 @@ public class ConsumerProcessor { ...@@ -436,7 +347,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY) value = @Queue(MQConst.QUEUES_SQL_ORDER_PAY)
)) ))
public void consumerOrderPay9(Message msg, Channel channel) { public void consumerOrderPay9(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_PAY ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -451,7 +361,6 @@ public class ConsumerProcessor { ...@@ -451,7 +361,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_PERFORMANCE_LACK) value = @Queue(MQConst.QUEUES_SQL_PERFORMANCE_LACK)
)) ))
public void consumerPerformanceLack(Message msg, Channel channel) { public void consumerPerformanceLack(Message msg, Channel channel) {
log.info("=== CONSUMER_PERFORMANCE_LACK ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -461,7 +370,6 @@ public class ConsumerProcessor { ...@@ -461,7 +370,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND) value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND)
)) ))
public void consumerOrderRefund(Message msg, Channel channel) { public void consumerOrderRefund(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_REFUND ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -470,7 +378,6 @@ public class ConsumerProcessor { ...@@ -470,7 +378,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND) value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND)
)) ))
public void consumerOrderRefund1(Message msg, Channel channel) { public void consumerOrderRefund1(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_REFUND ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -479,7 +386,6 @@ public class ConsumerProcessor { ...@@ -479,7 +386,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND) value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND)
)) ))
public void consumerOrderRefund2(Message msg, Channel channel) { public void consumerOrderRefund2(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_REFUND ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -488,7 +394,6 @@ public class ConsumerProcessor { ...@@ -488,7 +394,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND) value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND)
)) ))
public void consumerOrderRefund3(Message msg, Channel channel) { public void consumerOrderRefund3(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_REFUND ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -497,7 +402,6 @@ public class ConsumerProcessor { ...@@ -497,7 +402,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND) value = @Queue(MQConst.QUEUES_SQL_ORDER_REFUND)
)) ))
public void consumerOrderRefund4(Message msg, Channel channel) { public void consumerOrderRefund4(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_REFUND ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -507,7 +411,6 @@ public class ConsumerProcessor { ...@@ -507,7 +411,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW) value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW)
)) ))
public void consumerOrderRefundWithDraw(Message msg, Channel channel) { public void consumerOrderRefundWithDraw(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_WITHDRAW ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -516,7 +419,6 @@ public class ConsumerProcessor { ...@@ -516,7 +419,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW) value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW)
)) ))
public void consumerOrderRefundWithDraw1(Message msg, Channel channel) { public void consumerOrderRefundWithDraw1(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_WITHDRAW ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -525,7 +427,6 @@ public class ConsumerProcessor { ...@@ -525,7 +427,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW) value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW)
)) ))
public void consumerOrderRefundWithDraw2(Message msg, Channel channel) { public void consumerOrderRefundWithDraw2(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_WITHDRAW ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -534,7 +435,6 @@ public class ConsumerProcessor { ...@@ -534,7 +435,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW) value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW)
)) ))
public void consumerOrderRefundWithDraw3(Message msg, Channel channel) { public void consumerOrderRefundWithDraw3(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_WITHDRAW ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -543,7 +443,6 @@ public class ConsumerProcessor { ...@@ -543,7 +443,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW) value = @Queue(MQConst.QUEUES_SQL_ORDER_WITHDRAW)
)) ))
public void consumerOrderRefundWithDraw4(Message msg, Channel channel) { public void consumerOrderRefundWithDraw4(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_WITHDRAW ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
...@@ -553,7 +452,6 @@ public class ConsumerProcessor { ...@@ -553,7 +452,6 @@ public class ConsumerProcessor {
value = @Queue(MQConst.QUEUES_SQL_ORDER_OVERTIME_REFUND) value = @Queue(MQConst.QUEUES_SQL_ORDER_OVERTIME_REFUND)
)) ))
public void consumerOrderOvertimeRefund(Message msg, Channel channel) { public void consumerOrderOvertimeRefund(Message msg, Channel channel) {
log.info("=== CONSUMER_ORDER_OVERTIME_REFUND ===");
this.consumerSqlDaoHandler(msg, channel); this.consumerSqlDaoHandler(msg, channel);
} }
} }
...@@ -100,14 +100,18 @@ public class KylinOrderTicketsController { ...@@ -100,14 +100,18 @@ public class KylinOrderTicketsController {
@PostMapping("sendOrderRefunds") @PostMapping("sendOrderRefunds")
@ApiOperation("发起退款申请") @ApiOperation("发起退款申请")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<HashMap<String,String>> sendOrderRefund(@RequestParam(value = "orderId", required = true) @NotNull(message = "订单id不能为空") String orderId, 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 = "orderTicketEntitiesId", required = true) @NotNull(message = "票单id不能为空") String orderTicketEntitiesId,
@RequestParam(value = "reason", required = true) @NotNull(message = "退款原因不能为空") String reason, @RequestParam(value = "reason", required = true) @NotNull(message = "退款原因不能为空") String reason,
@RequestParam(value = "picList", required = false) String picList) { @RequestParam(value = "picList", required = false) String picList) {
String orderRefundId = orderTicketsService.sendOrderRefund(orderId, orderTicketEntitiesId, reason, picList).getData(); String orderRefundId = orderTicketsService.sendOrderRefund(orderId, orderTicketEntitiesId, reason, picList);
HashMap<String,String> map = new HashMap<String,String>(); if (orderRefundId.length() > 10) {
map.put("orderRefundsId",orderRefundId); HashMap<String, String> map = new HashMap<String, String>();
map.put("orderRefundsId", orderRefundId);
return ResponseDto.success(map); return ResponseDto.success(map);
} else {
return ResponseDto.failure(orderRefundId);
}
} }
@GetMapping("orderRefundDetails") @GetMapping("orderRefundDetails")
...@@ -115,7 +119,7 @@ public class KylinOrderTicketsController { ...@@ -115,7 +119,7 @@ public class KylinOrderTicketsController {
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<OrderRefundVo> orderRefundDetails(@RequestParam(value = "orderId", required = true) @NotNull(message = "订单id不能为空") String orderId, public ResponseDto<OrderRefundVo> orderRefundDetails(@RequestParam(value = "orderId", required = true) @NotNull(message = "订单id不能为空") String orderId,
@RequestParam(value = "orderRefundId", required = true) @NotNull(message = "退款订单id不能为空") String orderRefundId) { @RequestParam(value = "orderRefundId", required = true) @NotNull(message = "退款订单id不能为空") String orderRefundId) {
return ResponseDto.success(orderTicketsService.orderRefundDetails(orderId, orderRefundId)); return orderTicketsService.orderRefundDetails(orderId, orderRefundId) == null ? ResponseDto.failure("获取失败") : ResponseDto.success(orderTicketsService.orderRefundDetails(orderId, orderRefundId));
} }
@PostMapping("orderRefundWithdraw") @PostMapping("orderRefundWithdraw")
......
...@@ -36,6 +36,7 @@ import com.taobao.api.response.AlibabaDamaiMevOpenBatchpushticketResponse; ...@@ -36,6 +36,7 @@ import com.taobao.api.response.AlibabaDamaiMevOpenBatchpushticketResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils; import org.apache.commons.lang.time.DateUtils;
import org.bson.Document;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -849,7 +850,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -849,7 +850,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
log.info(UserPathDto.setData("订单支付成功回调", syncOrderParam, "")); log.info(UserPathDto.setData("订单支付成功回调", syncOrderParam, ""));
return "success"; return "success";
} catch (Exception e) { } catch (Exception e) {
log.error("SYNCE ORDER E = "+e.getMessage()); log.error("SYNCE ORDER E = " + e.getMessage());
e.printStackTrace(); e.printStackTrace();
return "fail"; return "fail";
} }
...@@ -990,7 +991,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -990,7 +991,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
if (null != performanceVo.getIsCanRefund() && performanceVo.getIsCanRefund() == 1) { if (null != performanceVo.getIsCanRefund() && performanceVo.getIsCanRefund() == 1) {
LocalDateTime refundOpenDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundOpenTime()); LocalDateTime refundOpenDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundOpenTime());
LocalDateTime refundCloseDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundCloseTime()); LocalDateTime refundCloseDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundCloseTime());
if (LocalDateTime.now().isAfter(refundOpenDate) && LocalDateTime.now().isBefore(refundCloseDate) && !orderTicketVo.getExpressAddress().trim().equals("")) { if (LocalDateTime.now().isAfter(refundOpenDate) && LocalDateTime.now().isBefore(refundCloseDate) && orderTicketVo.getExpressAddress().trim().equals("") && ticketVo.getCounts()==1) {
vo.setIsCanRefund(1); vo.setIsCanRefund(1);
} else { } else {
vo.setIsCanRefund(0); vo.setIsCanRefund(0);
...@@ -1121,6 +1122,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -1121,6 +1122,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
@Override @Override
public OrderRefundVo orderRefundDetails(String orderId, String orderRefundId) { public OrderRefundVo orderRefundDetails(String orderId, String orderRefundId) {
try {
OrderRefundVo vo = new OrderRefundVo(); OrderRefundVo vo = new OrderRefundVo();
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
KylinOrderTicketVo orderTicketVo = dataUtils.getOrderTicketVo(orderId); KylinOrderTicketVo orderTicketVo = dataUtils.getOrderTicketVo(orderId);
...@@ -1134,18 +1136,47 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -1134,18 +1136,47 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
vo.setKylinOrderRefundsVoBaseList(kylinOrderRefundsVoBase); vo.setKylinOrderRefundsVoBaseList(kylinOrderRefundsVoBase);
vo.setOrderTicketVo(orderTicketVo); vo.setOrderTicketVo(orderTicketVo);
return vo; return vo;
} catch (Exception e) {
return null;
}
} }
@Override @Override
public ResponseDto<String> sendOrderRefund(String orderId, String orderTicketEntitiesId, String reason, String picList) { public String sendOrderRefund(String orderId, String orderTicketEntitiesId, String reason, String picList) {
KylinOrderTicketEntitiesVo orderTicketEntitiesVo = null; KylinOrderTicketEntitiesVo orderTicketEntitiesVo = null;
try { try {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
KylinOrderTicketVo orderTicketVo = dataUtils.getOrderTicketVo(orderId); KylinOrderTicketVo orderTicketVo = dataUtils.getOrderTicketVo(orderId);
List<KylinOrderRefundsVo> kylinOrderRefundsVoBaseList = dataUtils.getOrderRefundVoByOrderId(orderTicketVo.getOrderTicketsId()); List<KylinOrderRefundsVo> kylinOrderRefundsVoBaseList = dataUtils.getOrderRefundVoByOrderId(orderTicketVo.getOrderTicketsId());
String ticketId = orderTicketVo.getTicketId();
if (!orderTicketVo.getUserId().equals(uid)) { if (!orderTicketVo.getUserId().equals(uid)) {
return ResponseDto.failure(ErrorMapping.get("20003")); return "无权查看";
}
KylinPerformanceVo performanceVo = dataUtils.getPerformanceVo(orderTicketVo.getPerformanceId());
KylinTicketVo ticketVo = null;
//获取购票数据
for (int x = 0; x < performanceVo.getTicketTimeList().size(); x++) {
KylinTicketTimesVo timeItem = performanceVo.getTicketTimeList().get(x);
for (int y = 0; y < timeItem.getTicketList().size(); y++) {
KylinTicketVo ticketItem = timeItem.getTicketList().get(y);
if (ticketItem.getTicketsId().equals(orderTicketVo.getTicketId())) {
ticketVo = ticketItem;
break;
}
}
}
if (null != performanceVo.getIsCanRefund() && performanceVo.getIsCanRefund() == 1) {
LocalDateTime refundOpenDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundOpenTime());
LocalDateTime refundCloseDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundCloseTime());
if (LocalDateTime.now().isAfter(refundOpenDate) && LocalDateTime.now().isBefore(refundCloseDate) && orderTicketVo.getExpressAddress().trim().equals("") && ticketVo.getCounts()==1) {
} else {
return "暂不支持退款";
}
} else {
return "暂不支持退款";
} }
List<KylinOrderTicketEntitiesVo> entitiesVos = orderTicketVo.getEntitiesVoList(); List<KylinOrderTicketEntitiesVo> entitiesVos = orderTicketVo.getEntitiesVoList();
...@@ -1155,24 +1186,24 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -1155,24 +1186,24 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
} }
} }
if (null == orderTicketEntitiesVo) { if (null == orderTicketEntitiesVo) {
return ResponseDto.failure(ErrorMapping.get("20004")); return "订单不存在";
} }
BigDecimal refundSinglePrice = dataUtils.getCanRefundOrderEntitiesPrice(orderTicketVo, kylinOrderRefundsVoBaseList, orderTicketEntitiesId); BigDecimal refundSinglePrice = dataUtils.getCanRefundOrderEntitiesPrice(orderTicketVo, kylinOrderRefundsVoBaseList, orderTicketEntitiesId);
if (refundSinglePrice.doubleValue() <= 0) { if (refundSinglePrice.compareTo(BigDecimal.ZERO)<=0) {
return ResponseDto.failure(ErrorMapping.get("20022")); return "申请金额不得小于0";
} }
Map token = CurrentUtil.getTokenClaims(); Map token = CurrentUtil.getTokenClaims();
String username = StringUtils.defaultString(((String) token.get("nickname")), ""); String username = StringUtils.defaultString(((String) token.get("nickname")), "");
String result = refundsStatusService.userOrderTicketRefunding(orderTicketVo, refundSinglePrice.doubleValue(), orderTicketEntitiesId, reason, picList, uid, username, kylinOrderRefundsVoBaseList.size()); String result = refundsStatusService.userOrderTicketRefunding(orderTicketVo, refundSinglePrice.doubleValue(), orderTicketEntitiesId, reason, picList, uid, username, kylinOrderRefundsVoBaseList.size());
if (result != "") { if (result != "") {
return ResponseDto.success(result); return result;
} else { } else {
return ResponseDto.failure(ErrorMapping.get("20019")); return "申请失败";
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return ResponseDto.failure(ErrorMapping.get("20019")); return "申请失败";
} }
} }
...@@ -1295,17 +1326,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -1295,17 +1326,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL);
kylinOrderRefunds.setUpdatedAt(LocalDateTime.now()); kylinOrderRefunds.setUpdatedAt(LocalDateTime.now());
KylinOrderRefundsVo orderRefundsVoBase = new KylinOrderRefundsVo();
orderRefundsVoBase.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL);
orderRefundsVoBase.setUpdatedAt(time);
BasicDBObject refundObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(orderRefundsVoBase)));
mongoTemplate.getCollection(KylinOrderRefundsVo.class.getSimpleName()).updateOne( mongoTemplate.getCollection(KylinOrderRefundsVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderRefundsId").is(orderRefundsId)).getQueryObject(), Query.query(Criteria.where("orderRefundsId").is(orderRefundsId)).getQueryObject(),
refundObject new Document("$set", new Document("status", KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL).append("updatedAt", time))
); );
sqlsDataC.add(new Object[]{ sqlsDataC.add(new Object[]{
orderRefundsVoBase.getStatus(), orderRefundsVoBase.getUpdatedAt(), orderRefundsId KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL, time, orderRefundsId
}); });
dataUtils.delOrderRefundVo(orderRefundsId); dataUtils.delOrderRefundVo(orderRefundsId);
...@@ -1367,14 +1394,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -1367,14 +1394,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
); );
dataUtils.delOrderTicketEntitiesRedis(orderRefundVo.getOrderRefundEntitiesVoList().get(0).getOrderTicketEntitiesId()); dataUtils.delOrderTicketEntitiesRedis(orderRefundVo.getOrderRefundEntitiesVoList().get(0).getOrderTicketEntitiesId());
// 订单退款表 MONGO // 订单退款表 MONGO
KylinOrderRefundsVo orderRefundsVo = new KylinOrderRefundsVo();
orderRefundsVo.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY);
orderRefundsVo.setUpdatedAt(time);
orderRefundsVo.setApplicantAt(time);
BasicDBObject refundObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(orderRefundsVo)));
mongoTemplate.getCollection(KylinOrderRefundsVo.class.getSimpleName()).updateOne( mongoTemplate.getCollection(KylinOrderRefundsVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderRefundsId").is(orderRefundVo.getOrderRefundsId())).getQueryObject(), Query.query(Criteria.where("orderRefundsId").is(orderRefundVo.getOrderRefundsId())).getQueryObject(),
refundObject new Document("$set", new Document("status", KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY)
.append("updatedAt", time)
.append("applicantAt",time))
); );
return null; return null;
......
...@@ -624,6 +624,7 @@ public class DataUtils { ...@@ -624,6 +624,7 @@ public class DataUtils {
canRefundSinglePrice = singlePrice.subtract(item.getRefundPrice()==null?BigDecimal.valueOf(0.00):item.getRefundPrice()); canRefundSinglePrice = singlePrice.subtract(item.getRefundPrice()==null?BigDecimal.valueOf(0.00):item.getRefundPrice());
} }
} }
System.out.println("单票剩余未退款金额 : "+canRefundSinglePrice);
//订单锁定金额 //订单锁定金额
BigDecimal orderLockPrice = new BigDecimal("0.00"); BigDecimal orderLockPrice = new BigDecimal("0.00");
for (KylinOrderRefundsVo refundVo : kylinOrderRefundsVoBaseList) { for (KylinOrderRefundsVo refundVo : kylinOrderRefundsVoBaseList) {
...@@ -637,8 +638,10 @@ public class DataUtils { ...@@ -637,8 +638,10 @@ public class DataUtils {
} }
} }
} }
System.out.println("订单锁定金额 : "+orderLockPrice);
//订单可退金额 //订单可退金额
BigDecimal refundSinglePrice = canRefundSinglePrice.subtract(orderLockPrice); BigDecimal refundSinglePrice = canRefundSinglePrice.subtract(orderLockPrice);
System.out.println("订单可退金额 : "+refundSinglePrice);
//是否包含快递费 //是否包含快递费
if (orderTicketVo.getPriceActual().subtract(orderTicketVo.getPriceExpress()).subtract(orderTicketVo.getPriceRefund()).compareTo(canRefundSinglePrice) == 0) { if (orderTicketVo.getPriceActual().subtract(orderTicketVo.getPriceExpress()).subtract(orderTicketVo.getPriceRefund()).compareTo(canRefundSinglePrice) == 0) {
refundSinglePrice = refundSinglePrice.add(orderTicketVo.getPriceExpress()); refundSinglePrice = refundSinglePrice.add(orderTicketVo.getPriceExpress());
......
...@@ -247,12 +247,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -247,12 +247,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
int surplusGeneral = dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), -payOrderParam.getNumber()); int surplusGeneral = dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), -payOrderParam.getNumber());
currentTime = System.currentTimeMillis() - currentTime; currentTime = System.currentTimeMillis() - currentTime;
log.debug("redis 获取库存 -> time:" + (currentTime) + "毫秒"); log.debug("redis 获取库存 -> time:" + (currentTime) + "毫秒");
log.debug("TAG_REDIS 正常 剩余库存 -> count:" + surplusGeneral);
if (surplusGeneral < 0) {//库存回滚 if (surplusGeneral < 0) {//库存回滚
currentTime = System.currentTimeMillis(); currentTime = System.currentTimeMillis();
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber()); dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
currentTime = System.currentTimeMillis() - currentTime; currentTime = System.currentTimeMillis() - currentTime;
log.debug("redis 修改库存 售罄 -> time:" + (currentTime) + "毫秒"); log.debug("redis 修改库存 售罄 -> time:" + (currentTime) + "毫秒");
log.debug("TAG_REDIS 售罄 回滚库存1 -> count:" + payOrderParam.getNumber());
// redisLockUtil.unlock(lock); // redisLockUtil.unlock(lock);
return ResponseDto.failure(ErrorMapping.get("20016"));//没抢到 return ResponseDto.failure(ErrorMapping.get("20016"));//没抢到
} else { } else {
...@@ -270,6 +272,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -270,6 +272,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
if (age > 25) { if (age > 25) {
// redisLockUtil.unlock(lock); // redisLockUtil.unlock(lock);
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber()); dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
log.debug("TAG_REDIS 学生票 回滚库存2 -> count:" + payOrderParam.getNumber());
return ResponseDto.failure(ErrorMapping.get("20017"));//年龄超了 return ResponseDto.failure(ErrorMapping.get("20017"));//年龄超了
} }
} }
...@@ -287,6 +290,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -287,6 +290,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
if (!res1.equals("")) { if (!res1.equals("")) {
// redisLockUtil.unlock(lock); // redisLockUtil.unlock(lock);
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber()); dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
log.debug("TAG_REDIS 限购 回滚库存3 -> count:" + payOrderParam.getNumber());
return ResponseDto.failure(res1);//乱七八糟异常 return ResponseDto.failure(res1);//乱七八糟异常
} }
} }
...@@ -300,6 +304,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -300,6 +304,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
if (!res1.equals("")) { if (!res1.equals("")) {
// redisLockUtil.unlock(lock); // redisLockUtil.unlock(lock);
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber()); dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
log.debug("TAG_REDIS 限购 回滚库存3 -> count:" + payOrderParam.getNumber());
return ResponseDto.failure(res1);//乱七八糟异常 return ResponseDto.failure(res1);//乱七八糟异常
} }
currentTime = System.currentTimeMillis() - currentTime; currentTime = System.currentTimeMillis() - currentTime;
...@@ -316,6 +321,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -316,6 +321,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
if (isDownGeneral) { if (isDownGeneral) {
currentTime = System.currentTimeMillis(); currentTime = System.currentTimeMillis();
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber()); dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
log.debug("TAG_REDIS 异常 回滚库存4 -> count:" + payOrderParam.getNumber());
currentTime = System.currentTimeMillis() - currentTime; currentTime = System.currentTimeMillis() - currentTime;
log.debug("redis 修改库存 异常 -> time:" + (currentTime) + "毫秒"); log.debug("redis 修改库存 异常 -> time:" + (currentTime) + "毫秒");
for (AdamEntersVo enters : entersVoList) { for (AdamEntersVo enters : entersVoList) {
...@@ -973,7 +979,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -973,7 +979,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
} }
@Override @Override
public ResponseDto<String> sendOrderRefund(String orderId, String orderTicketEntitiesId, String reason, String picList) { public String sendOrderRefund(String orderId, String orderTicketEntitiesId, String reason, String picList) {
return null; return null;
} }
......
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