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

Commit 5693bca5 authored by 胡佳晨's avatar 胡佳晨

修改 再次提交申请退款接口

parent 4f1f1769
......@@ -8,22 +8,23 @@ import javax.validation.constraints.NotNull;
@Data
public class GoblinAppOrderRefundParam {
@ApiModelProperty(value = "订单id")
@NotNull(message = "订单ID不能为空")
private String orderId;
@ApiModelProperty(value = "退款原因")
@NotNull(message = "退款原因不能为空")
private String reason;
@ApiModelProperty(value = "退款截图[逗号隔开]")
private String pics;
@ApiModelProperty(value = "详细描述")
private String describes;
@ApiModelProperty(value = "退款类型[1-退款|2-退货]")
private Integer refundType;
@ApiModelProperty(value = "退款orderSkuId[不传为整单退款]")
private String orderSkuId;
@ApiModelProperty(value = "物流公司")
private String company;
@ApiModelProperty(value = "快递单号")
private String mailNo;
@ApiModelProperty(value = "退款订单id")
private String orderBackId;
@ApiModelProperty(value = "详细描述")
private String describes;
@ApiModelProperty(value = "退款截图[逗号隔开]")
private String pics;
@ApiModelProperty(value = "退款原因")
@NotNull(message = "退款原因不能为空")
private String reason;
@ApiModelProperty(value = "退款类型[1-退款|2-退货]")
private Integer refundType;
}
......@@ -23,7 +23,7 @@ public interface IGoblinOrderAppService {
ResponseDto<Boolean> applyRefund(GoblinAppOrderRefundParam param);
ResponseDto<Boolean> againRefund(String orderBackId);
ResponseDto<Boolean> againRefund(GoblinAppOrderRefundParam param);
ResponseDto<List<GoblinBackOrderVo>> refundDetails(String orderId);
......
......@@ -80,8 +80,8 @@ public class GoblinOrderAppController {
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderBackId", value = "退款订单id", example = "1"),
})
public ResponseDto<Boolean> applyRefund(@RequestBody String orderBackId) {
return goblinOrderAppService.againRefund(orderBackId);
public ResponseDto<Boolean> againRefund(@RequestBody GoblinAppOrderRefundParam param) {
return goblinOrderAppService.againRefund(param);
}
@PostMapping("refundDetails")
......
......@@ -338,7 +338,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
backOrder.getOrderCode(), backOrder.getStoreId(), backOrder.getUserId(),
backOrder.getSkuIdNums(), backOrder.getType(), backOrder.getReason(),
backOrder.getDescribes(), backOrder.getRealBackPrice(), backOrder.getBackPriceExpress(), backOrder.getStatus(),
backOrder.getLogisCompanyName(), backOrder.getMailNo(), backOrder.getCreatedAt()
backOrder.getLogisCompanyName(), backOrder.getMailNo(),backOrder.getPics(), backOrder.getCreatedAt()
});
//添加日志
refundLog.add(new Object[]{
......@@ -350,7 +350,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
}
@Override
public ResponseDto<Boolean> againRefund(String orderBackId) {
public ResponseDto<Boolean> againRefund(GoblinAppOrderRefundParam param) {
LinkedList<String> sqls = CollectionUtil.linkedListString();
sqls.add(SqlMapping.get("goblin_order.user.againRefund"));
sqls.add(SqlMapping.get("goblin_order.store.refundLog"));
......@@ -360,7 +360,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
String uid = CurrentUtil.getCurrentUid();
LocalDateTime now = LocalDateTime.now();
GoblinBackOrderVo backOrder = redisUtils.getBackOrderVo(orderBackId);
GoblinBackOrderVo backOrder = redisUtils.getBackOrderVo(param.getOrderBackId());
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(backOrder.getOrderId());
if (!orderVo.getUserId().equals(uid) || !backOrder.getStatus().equals(GoblinStatusConst.Status.ORDER_BACK_STATUS_3.getValue())) {
return ResponseDto.failure("无权操作");
......@@ -379,6 +379,10 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
}
}
backOrder.setStatus(GoblinStatusConst.Status.ORDER_BACK_STATUS_1.getValue());
backOrder.setDescribes(param.getDescribes());
backOrder.setPics(param.getPics());
backOrder.setReason(param.getReason());
backOrder.setType(param.getRefundType());
//添加日志
GoblinBackOrderLog backOrderLog = initBackLog(backOrder.getOrderId(), uid, now);
backOrderLog.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_21.getValue());
......@@ -390,7 +394,9 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
mongoUtils.updateGoblinBackOrderVo(backOrder.getBackOrderId(), backOrder);
//mysql
applyRefund.add(new Object[]{
backOrder.getStatus(), now, backOrder.getBackOrderId()
backOrder.getStatus(),
backOrder.getDescribes(),backOrder.getPics(),backOrder.getReason(),backOrder.getType(),
now, backOrder.getBackOrderId()
});
//添加日志
refundLog.add(new Object[]{
......
......@@ -104,8 +104,8 @@ goblin_order.store.backOrderStatus=UPDATE goblin_back_order SET status = ? , ref
goblin_order.store.orderStatus=UPDATE goblin_store_order SET status = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.applyRefund=UPDATE goblin_back_order SET status = ? ,reason=?,audit_at=?, updated_at = ? WHERE back_order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
#---- 用户订单操作
goblin_order.user.applyRefund=INSERT INTO goblin_back_order (`back_order_id`,`back_code`,`order_id`,`order_code`,`store_id`,`user_id`,`sku_id_nums`,`type`,`reason`,`describes`,`real_back_price`,`back_price_express`,`status`,`logis_company_name`,`mail_no`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_order.user.againRefund=UPDATE goblin_back_order SET status = ? , updated_at=? where back_order_id=?
goblin_order.user.applyRefund=INSERT INTO goblin_back_order (`back_order_id`,`back_code`,`order_id`,`order_code`,`store_id`,`user_id`,`sku_id_nums`,`type`,`reason`,`describes`,`real_back_price`,`back_price_express`,`status`,`logis_company_name`,`mail_no`,`pics`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_order.user.againRefund=UPDATE goblin_back_order SET status = ? , describes = ? , pics = ? , reason = ? , type = ?, updated_at=? where back_order_id=?
#---- 购物车操作
goblin_shop.cart.delete=UPDATE goblin_shopping_cart set del_tag=? where user_id=? and sku_id=?
......
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