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

Commit 2e749112 authored by 胡佳晨's avatar 胡佳晨

修改 订单详情 显示券的问题

退款订单 显示活动数据问题
资金相关bug
parent 2787a95e
......@@ -82,6 +82,8 @@ public class GoblinBackOrderDetailsVo implements Serializable, Cloneable {
private String userName;
@ApiModelProperty(value = "下单时手机号")
private String userMobile;
@ApiModelProperty(value = " 活动名称")
private String marketName;
@ApiModelProperty(value = "订单SkuVo")
List<GoblinOrderSkuVo> orderSkuVoList;
......
......@@ -48,10 +48,10 @@ public class GoblinOrderLogVo implements Cloneable {
public BigDecimal getSkuPriceActualBig() {
long a = getSkuPriceActual();
if (a != 0) {
return new BigDecimal(a / 100);
if(a==0L){
return BigDecimal.ZERO;
} else {
return skuPriceActualBig;
return new BigDecimal(a / 100);
}
}
......
......@@ -29,6 +29,16 @@ public class GoblinStoreOrderListVo implements Cloneable {
private String expressAddressDetail;
@ApiModelProperty(value = " 收货人省市县")
private String expressAddress;
@ApiModelProperty(value = " 平台券id")
private String platformUcouponId;
@ApiModelProperty(value = " 平台券名称")
private String platformUcouponName;
@ApiModelProperty(value = " 店铺券id")
private String storeUcouponId;
@ApiModelProperty(value = " 店铺券名称")
private String storeUcouponName;
@ApiModelProperty(value = " 付款金额")
private BigDecimal priceActual;
@ApiModelProperty(value = " 快递费")
......
......@@ -66,7 +66,7 @@ public class GoblinStoreMoneyController {
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "type2", value = "[1-收入|2-支出]"),
})
public ResponseDto<PageInfo<GoblinOrderLogVo>> getOrderOperaList(@RequestParam(value = "spuId", required = false) String spuId,
public ResponseDto<PageInfo<GoblinOrderLogVo>> getOrderOperaList(@RequestParam(value = "spuId", required = true) String spuId,
@RequestParam(value = "orderCode", required = false) String orderCode,
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "st", required = false) String st,
......
......@@ -619,6 +619,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
logVo.setSkuId(orderSkuVo.getSkuId());
logVo.setSkuPriceActual(orderSkuVo.getSkuPriceActual().multiply(BigDecimal.valueOf(100)).negate().longValue());
logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue());
logVo.setRemark("申请退款,orderSkuVoId="+orderSkuVo.getOrderSkuId());
logVo.setOperationId(orderVo.getUserId());
logVo.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_2.getValue());
logVo.setCreatedAt(now);
......
......@@ -905,6 +905,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
logVo.setSkuId(backOrderSkuVo.getSkuId());
logVo.setSkuPriceActual(price.multiply(BigDecimal.valueOf(100)).negate().longValue());
logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue());
logVo.setRemark("订单退款");
logVo.setOperationId(backOrderVo.getUserId());
logVo.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_2.getValue());
logVo.setCreatedAt(now);
......
......@@ -86,6 +86,12 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer
vo.setIsMember(orderVo.getIsMember());
vo.setUserName(orderVo.getUserName());
vo.setUserMobile(orderVo.getUserMobile());
if (orderVo.getMarketId() == null || orderVo.getMarketId().equals("")) {
vo.setMarketName("");
} else {
GoblinSelfMarketingVo marketingVo = redisUtils.getSelfMarket(orderVo.getMarketId().split("ZZ")[1]);
vo.setMarketName(marketingVo.getName());
}
List<GoblinOrderSkuVo> orderSkuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (String orderSkuVoId : orderVo.getOrderSkuVoIds()) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoId);
......
......@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.candy.vo.CandyCouponVo;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinBackOrder;
......@@ -127,6 +128,22 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
vo.setStatus(orderVo.getStatus());
vo.setPayTime(orderVo.getPayTime());
vo.setPriceExpress(orderVo.getPriceExpress());
if (!(orderVo.getUcouponId() == null || orderVo.getUcouponId().equals(""))) {
CandyCouponVo candyCouponVo = orderUtils.getCouponDetails(orderVo.getUcouponId());
vo.setPlatformUcouponId(candyCouponVo.getUcouponId());
vo.setPlatformUcouponName(candyCouponVo.getTitle());
} else {
vo.setPlatformUcouponId("");
vo.setPlatformUcouponName("");
}
if (!(orderVo.getStoreCouponId() == null || orderVo.getStoreCouponId().equals(""))) {
GoblinStoreCouponVo storeVo = redisUtils.getStoreCouponVo(orderVo.getStoreCouponId());
vo.setStoreUcouponId(storeVo.getStoreCouponId());
vo.setStoreUcouponName(storeVo.getTitle());
} else {
vo.setStoreUcouponId("");
vo.setStoreUcouponName("");
}
if (orderVo.getMarketId() == null || orderVo.getMarketId().equals("")) {
vo.setMarketName("");
} else {
......@@ -247,7 +264,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
orderVo.setPriceExpress(price);
GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_17.getValue());
log.setRemark("expressPress=[" + price + "]");
log.setRemark("修改快递价格,expressPress=[" + price + "]");
//redis
redisUtils.setGoblinOrder(orderId, orderVo);
//mongo
......@@ -290,7 +307,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
orderVo.getOrderAttrVo().setExpressPhone(expressPhone);
GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_17.getValue());
log.setRemark("expressContacts=[" + expressContacts + "],expressPhone=[" + expressPhone + "],expressAddressDetail=[" + expressAddressDetail + "]");
log.setRemark("修改收货地址,expressContacts=[" + expressContacts + "],expressPhone=[" + expressPhone + "],expressAddressDetail=[" + expressAddressDetail + "]");
//redis
redisUtils.setGoblinOrder(orderId, orderVo);
//mongo
......@@ -341,7 +358,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
orderVo.setPriceActual(orderVo.getPriceActual().subtract(voucherPrice));
GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_12.getValue());
log.setRemark("orderSkuId=[" + orderSkuId + "],price=[" + price + "]");
log.setRemark("修改金额,orderSkuId=[" + orderSkuId + "],price=[" + price + "]");
//redis
redisUtils.setGoblinOrder(orderId, orderVo);
redisUtils.setGoblinOrderSku(orderSkuId, orderSkuVo);
......
......@@ -809,8 +809,14 @@ public class GoblinMongoUtils {
Aggregation.match(criteria),
Aggregation.group("spuId")
.first("spuId").as("spuId")
.first("skuPriceActual").as("skuPriceActual")
.sum("skuPriceActualBig").as("skuPriceActualBig"));
.sum("skuPriceActual").as("skuPriceActual"));
// aggregation = Aggregation.newAggregation(
// Aggregation.match(criteria),
// Aggregation.project("spuId", "skuPriceActual"),
// Aggregation.group("spuId")
// .first("spuId").as("spuId")
// .sum("skuPriceActual").as("skuPriceActual")
// );
} else {
aggregation = Aggregation.newAggregation(
Aggregation.match(criteria),
......@@ -891,7 +897,16 @@ public class GoblinMongoUtils {
//查询销量
int size = 20;
int skipCount = ((page - 1) * size);
Criteria criteria = Criteria.where("status").in(GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue()).and("spuId").is(spuId);
Criteria criteria = Criteria.where("status").in(
GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_12.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_13.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_14.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_15.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_16.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_21.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_23.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_24.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_25.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_26.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_27.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_28.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_29.getValue()
).and("spuId").is(spuId);
if (st != null && et != null) {
criteria = criteria.and("createdAt").gte(st).lt(et);
}
......
......@@ -9,6 +9,7 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.adam.dto.vo.AdamRscPolymer01Vo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.candy.param.BackCouponParam;
import com.liquidnet.service.candy.vo.CandyCouponVo;
import com.liquidnet.service.candy.vo.CandyUseResultVo;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.extern.slf4j.Slf4j;
......@@ -93,7 +94,7 @@ public class GoblinOrderUtils {
* @param totalPrice 订单总价
* @return
*/
public HashMap<String, Object> useCoupon(String uCouponId, String content, BigDecimal totalPrice, String spuId,String uid) {
public HashMap<String, Object> useCoupon(String uCouponId, String content, BigDecimal totalPrice, String spuId, String uid) {
HashMap<String, Object> hashMap = CollectionUtil.mapStringObject();
try {
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
......@@ -165,6 +166,27 @@ public class GoblinOrderUtils {
}
}
public CandyCouponVo getCouponDetails(String uCouponId) {
try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Authorization", "Bearer " + CurrentUtil.getToken());
header.add("Accept", "application/json;charset=UTF-8");
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("uCouponIds", uCouponId);
String returnData = HttpUtil.post(candyUrl + " /candy-coupon/receive/ListById", params, header);
ResponseDto<CandyCouponVo> innerReturnVo = JsonUtils.fromJson(returnData, new TypeReference<ResponseDto<CandyCouponVo>>() {
});
return innerReturnVo.getData();
} catch (Exception e) {
log.error("回退券ERROR:{}", e);
CandyCouponVo vo = CandyCouponVo.getNew();
vo.setUcouponId(uCouponId);
vo.setTitle("");
return vo;
}
}
public void doTask(String uid, BigDecimal price) {
try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
......
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