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

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

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

退款订单 显示活动数据问题
资金相关bug
parent 2787a95e
...@@ -82,6 +82,8 @@ public class GoblinBackOrderDetailsVo implements Serializable, Cloneable { ...@@ -82,6 +82,8 @@ public class GoblinBackOrderDetailsVo implements Serializable, Cloneable {
private String userName; private String userName;
@ApiModelProperty(value = "下单时手机号") @ApiModelProperty(value = "下单时手机号")
private String userMobile; private String userMobile;
@ApiModelProperty(value = " 活动名称")
private String marketName;
@ApiModelProperty(value = "订单SkuVo") @ApiModelProperty(value = "订单SkuVo")
List<GoblinOrderSkuVo> orderSkuVoList; List<GoblinOrderSkuVo> orderSkuVoList;
......
...@@ -48,10 +48,10 @@ public class GoblinOrderLogVo implements Cloneable { ...@@ -48,10 +48,10 @@ public class GoblinOrderLogVo implements Cloneable {
public BigDecimal getSkuPriceActualBig() { public BigDecimal getSkuPriceActualBig() {
long a = getSkuPriceActual(); long a = getSkuPriceActual();
if (a != 0) { if(a==0L){
return new BigDecimal(a / 100); return BigDecimal.ZERO;
} else { } else {
return skuPriceActualBig; return new BigDecimal(a / 100);
} }
} }
......
...@@ -29,6 +29,16 @@ public class GoblinStoreOrderListVo implements Cloneable { ...@@ -29,6 +29,16 @@ public class GoblinStoreOrderListVo implements Cloneable {
private String expressAddressDetail; private String expressAddressDetail;
@ApiModelProperty(value = " 收货人省市县") @ApiModelProperty(value = " 收货人省市县")
private String expressAddress; 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 = " 付款金额") @ApiModelProperty(value = " 付款金额")
private BigDecimal priceActual; private BigDecimal priceActual;
@ApiModelProperty(value = " 快递费") @ApiModelProperty(value = " 快递费")
......
...@@ -66,7 +66,7 @@ public class GoblinStoreMoneyController { ...@@ -66,7 +66,7 @@ public class GoblinStoreMoneyController {
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "type2", value = "[1-收入|2-支出]"), @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 = "orderCode", required = false) String orderCode,
@RequestParam(value = "type", required = false) Integer type, @RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "st", required = false) String st, @RequestParam(value = "st", required = false) String st,
......
...@@ -619,6 +619,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -619,6 +619,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
logVo.setSkuId(orderSkuVo.getSkuId()); logVo.setSkuId(orderSkuVo.getSkuId());
logVo.setSkuPriceActual(orderSkuVo.getSkuPriceActual().multiply(BigDecimal.valueOf(100)).negate().longValue()); logVo.setSkuPriceActual(orderSkuVo.getSkuPriceActual().multiply(BigDecimal.valueOf(100)).negate().longValue());
logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue()); logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue());
logVo.setRemark("申请退款,orderSkuVoId="+orderSkuVo.getOrderSkuId());
logVo.setOperationId(orderVo.getUserId()); logVo.setOperationId(orderVo.getUserId());
logVo.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_2.getValue()); logVo.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_2.getValue());
logVo.setCreatedAt(now); logVo.setCreatedAt(now);
......
...@@ -905,6 +905,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -905,6 +905,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
logVo.setSkuId(backOrderSkuVo.getSkuId()); logVo.setSkuId(backOrderSkuVo.getSkuId());
logVo.setSkuPriceActual(price.multiply(BigDecimal.valueOf(100)).negate().longValue()); logVo.setSkuPriceActual(price.multiply(BigDecimal.valueOf(100)).negate().longValue());
logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue()); logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue());
logVo.setRemark("订单退款");
logVo.setOperationId(backOrderVo.getUserId()); logVo.setOperationId(backOrderVo.getUserId());
logVo.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_2.getValue()); logVo.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_2.getValue());
logVo.setCreatedAt(now); logVo.setCreatedAt(now);
......
...@@ -86,6 +86,12 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer ...@@ -86,6 +86,12 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer
vo.setIsMember(orderVo.getIsMember()); vo.setIsMember(orderVo.getIsMember());
vo.setUserName(orderVo.getUserName()); vo.setUserName(orderVo.getUserName());
vo.setUserMobile(orderVo.getUserMobile()); 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(); List<GoblinOrderSkuVo> orderSkuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (String orderSkuVoId : orderVo.getOrderSkuVoIds()) { for (String orderSkuVoId : orderVo.getOrderSkuVoIds()) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoId);
......
...@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.*; ...@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; 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.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinBackOrder; import com.liquidnet.service.goblin.entity.GoblinBackOrder;
...@@ -127,6 +128,22 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -127,6 +128,22 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
vo.setStatus(orderVo.getStatus()); vo.setStatus(orderVo.getStatus());
vo.setPayTime(orderVo.getPayTime()); vo.setPayTime(orderVo.getPayTime());
vo.setPriceExpress(orderVo.getPriceExpress()); 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("")) { if (orderVo.getMarketId() == null || orderVo.getMarketId().equals("")) {
vo.setMarketName(""); vo.setMarketName("");
} else { } else {
...@@ -247,7 +264,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -247,7 +264,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
orderVo.setPriceExpress(price); orderVo.setPriceExpress(price);
GoblinOrderOperationLog log = initLog(orderId, uid, now); GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_17.getValue()); log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_17.getValue());
log.setRemark("expressPress=[" + price + "]"); log.setRemark("修改快递价格,expressPress=[" + price + "]");
//redis //redis
redisUtils.setGoblinOrder(orderId, orderVo); redisUtils.setGoblinOrder(orderId, orderVo);
//mongo //mongo
...@@ -290,7 +307,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -290,7 +307,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
orderVo.getOrderAttrVo().setExpressPhone(expressPhone); orderVo.getOrderAttrVo().setExpressPhone(expressPhone);
GoblinOrderOperationLog log = initLog(orderId, uid, now); GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_17.getValue()); 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 //redis
redisUtils.setGoblinOrder(orderId, orderVo); redisUtils.setGoblinOrder(orderId, orderVo);
//mongo //mongo
...@@ -341,7 +358,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -341,7 +358,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
orderVo.setPriceActual(orderVo.getPriceActual().subtract(voucherPrice)); orderVo.setPriceActual(orderVo.getPriceActual().subtract(voucherPrice));
GoblinOrderOperationLog log = initLog(orderId, uid, now); GoblinOrderOperationLog log = initLog(orderId, uid, now);
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_12.getValue()); log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_12.getValue());
log.setRemark("orderSkuId=[" + orderSkuId + "],price=[" + price + "]"); log.setRemark("修改金额,orderSkuId=[" + orderSkuId + "],price=[" + price + "]");
//redis //redis
redisUtils.setGoblinOrder(orderId, orderVo); redisUtils.setGoblinOrder(orderId, orderVo);
redisUtils.setGoblinOrderSku(orderSkuId, orderSkuVo); redisUtils.setGoblinOrderSku(orderSkuId, orderSkuVo);
......
...@@ -809,8 +809,14 @@ public class GoblinMongoUtils { ...@@ -809,8 +809,14 @@ public class GoblinMongoUtils {
Aggregation.match(criteria), Aggregation.match(criteria),
Aggregation.group("spuId") Aggregation.group("spuId")
.first("spuId").as("spuId") .first("spuId").as("spuId")
.first("skuPriceActual").as("skuPriceActual") .sum("skuPriceActual").as("skuPriceActual"));
.sum("skuPriceActualBig").as("skuPriceActualBig")); // aggregation = Aggregation.newAggregation(
// Aggregation.match(criteria),
// Aggregation.project("spuId", "skuPriceActual"),
// Aggregation.group("spuId")
// .first("spuId").as("spuId")
// .sum("skuPriceActual").as("skuPriceActual")
// );
} else { } else {
aggregation = Aggregation.newAggregation( aggregation = Aggregation.newAggregation(
Aggregation.match(criteria), Aggregation.match(criteria),
...@@ -891,7 +897,16 @@ public class GoblinMongoUtils { ...@@ -891,7 +897,16 @@ public class GoblinMongoUtils {
//查询销量 //查询销量
int size = 20; int size = 20;
int skipCount = ((page - 1) * size); 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) { if (st != null && et != null) {
criteria = criteria.and("createdAt").gte(st).lt(et); criteria = criteria.and("createdAt").gte(st).lt(et);
} }
......
...@@ -9,6 +9,7 @@ import com.liquidnet.commons.lang.util.JsonUtils; ...@@ -9,6 +9,7 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.adam.dto.vo.AdamRscPolymer01Vo; import com.liquidnet.service.adam.dto.vo.AdamRscPolymer01Vo;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.candy.param.BackCouponParam; import com.liquidnet.service.candy.param.BackCouponParam;
import com.liquidnet.service.candy.vo.CandyCouponVo;
import com.liquidnet.service.candy.vo.CandyUseResultVo; import com.liquidnet.service.candy.vo.CandyUseResultVo;
import com.sun.org.apache.xpath.internal.operations.Bool; import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -93,7 +94,7 @@ public class GoblinOrderUtils { ...@@ -93,7 +94,7 @@ public class GoblinOrderUtils {
* @param totalPrice 订单总价 * @param totalPrice 订单总价
* @return * @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(); HashMap<String, Object> hashMap = CollectionUtil.mapStringObject();
try { try {
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString(); MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
...@@ -165,6 +166,27 @@ public class GoblinOrderUtils { ...@@ -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) { public void doTask(String uid, BigDecimal price) {
try { try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString(); 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