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

Commit c51580bd authored by 胡佳晨's avatar 胡佳晨

修改出货接口 和 汇付支付回调(回调成功直接出货)

parent 35e33853
......@@ -18,6 +18,8 @@ public class GoblinZhengzaiPushVo implements Serializable, Cloneable {
private String skuSpecs;
@ApiModelProperty(position = 11, value = "数量")
private Integer num;
@ApiModelProperty(position = 11, value = "状态[同订单状态]")
private int status;
private static final GoblinZhengzaiPushVo obj = new GoblinZhengzaiPushVo();
......
......@@ -40,7 +40,14 @@ public interface IGoblinAppZhengzaiService {
* @param offCode 出货码
* @return
*/
ResponseDto<List<GoblinZhengzaiPushVo>> orderPush(String offCode);
ResponseDto<Boolean> orderPush(String offCode,String marketId);
/**
* 正在下单出货详情
* @param offCode 出货码
* @return
*/
ResponseDto<List<GoblinZhengzaiPushVo>> orderPushDetails(String offCode,String marketId);
/**
* 订单绑定
......
......@@ -92,17 +92,31 @@ public class GoblinAppZhengzaiController {
return goblinOrderAppService.orderDetails(orderId, uid);
}
@PostMapping("checkPayment_dup1")
@PostMapping("orderPush")
@ApiOperation("正在下单-出货")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "offCode", value = "取货码", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
})
public ResponseDto<Boolean> orderPush(@RequestParam("offCode") @Valid String offCode,
@RequestParam("marketId") @Valid String marketId) {
return goblinAppZhengzaiService.orderPush(offCode,marketId);
}
@PostMapping("orderPushDetails")
@ApiOperation("正在下单-出货详情")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "offCode", value = "取货码", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
})
public ResponseDto<List<GoblinZhengzaiPushVo>> orderPush(@RequestParam("offCode") @Valid String offCode) {
return goblinAppZhengzaiService.orderPush(offCode);
public ResponseDto<List<GoblinZhengzaiPushVo>> orderPushDetails(@RequestParam("offCode") @Valid String offCode,
@RequestParam("marketId") @Valid String marketId) {
return goblinAppZhengzaiService.orderPushDetails(offCode,marketId);
}
@PostMapping("checkPayment_dup2")
@PostMapping("orderBind")
@ApiOperation("正在下单-绑定订单号")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
......
package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
......@@ -82,23 +83,36 @@ public class GoblinAppZhengzaiServiceImpl implements IGoblinAppZhengzaiService {
}
@Override
public ResponseDto<List<GoblinZhengzaiPushVo>> orderPush(String offCode) {
public ResponseDto<Boolean> orderPush(String offCode, String marketId) {
String[] orderIds = redisUtils.getOffCode(offCode);
List<GoblinZhengzaiPushVo> listVo = ObjectUtil.getGoblinZhengzaiPushVoArrayList();
LocalDateTime now = LocalDateTime.now();
LinkedList<String> sqls = CollectionUtil.linkedListString();
LinkedList<Object[]> sqlDataOrder = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> sqlDataSku = CollectionUtil.linkedListObjectArr();
sqls.add(SqlMapping.get("goblin_order.store.orderStatus"));
sqls.add(SqlMapping.get("goblin_order.store.orderSkuStatus"));
String uid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVoByUid(uid);
if (storeInfoVo == null) {
return ResponseDto.failure("参数错误");
}
if (orderIds == null) {
return ResponseDto.failure("订单不存在");
} else {
for (String orderId : orderIds) {
GoblinStoreOrderVo storeOrderVo = redisUtils.getGoblinOrder(orderId);
if (!storeOrderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_2.getValue())) {
if (!storeInfoVo.getStoreId().equals(storeOrderVo.getStoreId())) {
return ResponseDto.failure("店铺异常");
}
if (storeOrderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_0.getValue())) {
return ResponseDto.failure("出货失败,订单未支付");
}
if (storeOrderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_4.getValue())) {
return ResponseDto.failure("出货失败,订单已核销");
}
if (!storeOrderVo.getMarketId().equals(marketId)) {
return ResponseDto.failure("出货失败,活动不符");
}
storeOrderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
sqlDataOrder.add(new Object[]{
storeOrderVo.getStatus(), now,
......@@ -106,12 +120,7 @@ public class GoblinAppZhengzaiServiceImpl implements IGoblinAppZhengzaiService {
});
List<String> skuIds = storeOrderVo.getOrderSkuVoIds();
for (String skuId : skuIds) {
GoblinZhengzaiPushVo vo = GoblinZhengzaiPushVo.getNew();
GoblinOrderSkuVo skuInfoVo = redisUtils.getGoblinOrderSkuVo(skuId);
vo.setSkuName(skuInfoVo.getSkuName());
vo.setNum(skuInfoVo.getNum());
vo.setSkuSpecs(skuInfoVo.getSkuSpecs());
vo.setSpuName(skuInfoVo.getSpuName());
skuInfoVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
sqlDataSku.add(new Object[]{
skuInfoVo.getStatus(), now,
......@@ -126,6 +135,47 @@ public class GoblinAppZhengzaiServiceImpl implements IGoblinAppZhengzaiService {
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_ORDER_CREATE_PAY.getKey(),
SqlMapping.gets(sqls, sqlDataOrder, sqlDataSku));
}
return ResponseDto.success();
}
@Override
public ResponseDto<List<GoblinZhengzaiPushVo>> orderPushDetails(String offCode, String marketId) {
String[] orderIds = redisUtils.getOffCode(offCode);
List<GoblinZhengzaiPushVo> listVo = ObjectUtil.getGoblinZhengzaiPushVoArrayList();
String uid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVoByUid(uid);
if (storeInfoVo == null) {
return ResponseDto.failure("参数错误");
}
if (orderIds == null) {
return ResponseDto.failure("订单不存在");
} else {
for (String orderId : orderIds) {
GoblinStoreOrderVo storeOrderVo = redisUtils.getGoblinOrder(orderId);
if (!storeInfoVo.getStoreId().equals(storeOrderVo.getStoreId())) {
return ResponseDto.failure("店铺异常");
}
if (storeOrderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_0.getValue())) {
return ResponseDto.failure("出货失败,订单未支付");
}
if (storeOrderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_4.getValue())) {
return ResponseDto.failure("出货失败,订单已核销");
}
if (!storeOrderVo.getMarketId().equals(marketId)) {
return ResponseDto.failure("出货失败,活动不符");
}
List<String> skuIds = storeOrderVo.getOrderSkuVoIds();
for (String skuId : skuIds) {
GoblinZhengzaiPushVo vo = GoblinZhengzaiPushVo.getNew();
GoblinOrderSkuVo skuInfoVo = redisUtils.getGoblinOrderSkuVo(skuId);
vo.setSkuName(skuInfoVo.getSkuName());
vo.setNum(skuInfoVo.getNum());
vo.setSkuSpecs(skuInfoVo.getSkuSpecs());
vo.setSpuName(skuInfoVo.getSpuName());
vo.setStatus(skuInfoVo.getStatus());
}
}
}
return ResponseDto.success(listVo);
}
......
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