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

Commit ed08ecaf authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/jxl_2269_payStatus' into jxl_2267_saleTime

parents 03e1ffc1 5334c00d
...@@ -134,6 +134,7 @@ public class GoblinRedisConst { ...@@ -134,6 +134,7 @@ public class GoblinRedisConst {
public static final String REDIS_GOBLIN_NFT_GOODS_LIST_INFO = PREFIX.concat("nft:goodsList:info:");// nft商品列表单藏品详情 skuId public static final String REDIS_GOBLIN_NFT_GOODS_LIST_INFO = PREFIX.concat("nft:goodsList:info:");// nft商品列表单藏品详情 skuId
public static final String REDIS_GOBLIN_NFT_NUM_ACCOUNT = PREFIX.concat("nft:account:");// nft用户数字账户是否开通 userId public static final String REDIS_GOBLIN_NFT_NUM_ACCOUNT = PREFIX.concat("nft:account:");// nft用户数字账户是否开通 userId
public static final String REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO = PREFIX.concat("nft:account:info:");// nft用户数字账户开通信息 userId public static final String REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO = PREFIX.concat("nft:account:info:");// nft用户数字账户开通信息 userId
public static final String REDIS_GOBLIN_NFT_NOT_PAY_NUM = PREFIX.concat("nft:notPay:");// nft藏品待支付订单数量 skuId:listId
/** /**
* {goblin:nft:certmeta:{idType+idNo},{idname,mobile}} * {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
*/ */
......
...@@ -94,19 +94,23 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -94,19 +94,23 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
@ApiModelProperty(position = 65, value = "是否开启兑换 1未开启 2已开启") @ApiModelProperty(position = 65, value = "是否开启兑换 1未开启 2已开启")
private int isExchange; private int isExchange;
@ApiModelProperty(position = 65, value = "单品AR文件URL-iOS版") @ApiModelProperty(position = 66, value = "待支付订单数量")
private int notPayNum;
@ApiModelProperty(position = 67, value = "单品AR文件URL-iOS版")
private String arUrlIos; private String arUrlIos;
@ApiModelProperty(position = 66, value = "单品AR文件URL-Android版") @ApiModelProperty(position = 68, value = "单品AR文件URL-Android版")
private String arUrlAndroid; private String arUrlAndroid;
@ApiModelProperty(position = 67, value = "标签[0-提前购买|1-分段购买]")
@ApiModelProperty(position = 69, value = "标签[0-提前购买|1-分段购买]")
private Integer tagType; private Integer tagType;
@ApiModelProperty(position = 68, value = "分批购活动id") @ApiModelProperty(position = 70, value = "分批购活动id")
private String listId; private String listId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 69, value = "sku正常开售时间") @ApiModelProperty(position = 71, value = "sku正常开售时间")
private LocalDateTime baseSaleStartTime; private LocalDateTime baseSaleStartTime;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 70, value = "下个分段购开始时间,如果为null则没有") @ApiModelProperty(position = 72, value = "下个分段购开始时间,如果为null则没有")
private LocalDateTime nextSaleStartTime; private LocalDateTime nextSaleStartTime;
private static final GoblinNftGoodsSkuInfoVo obj = new GoblinNftGoodsSkuInfoVo(); private static final GoblinNftGoodsSkuInfoVo obj = new GoblinNftGoodsSkuInfoVo();
......
package com.liquidnet.service.goblin.dto;
import lombok.Data;
@Data
public class PlatformGoblinNftOrderNotPayDto {
private String skuId;
private String listId;
private int notPayNum;
}
package com.liquidnet.service.goblin.mapper; package com.liquidnet.service.goblin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.goblin.dto.PlatformGoblinNftOrderNotPayDto;
import com.liquidnet.service.goblin.dto.admin.GoblinNftOrderListDto; import com.liquidnet.service.goblin.dto.admin.GoblinNftOrderListDto;
import com.liquidnet.service.goblin.entity.GoblinNftOrder; import com.liquidnet.service.goblin.entity.GoblinNftOrder;
...@@ -19,4 +20,5 @@ public interface GoblinNftOrderMapper extends BaseMapper<GoblinNftOrder> { ...@@ -19,4 +20,5 @@ public interface GoblinNftOrderMapper extends BaseMapper<GoblinNftOrder> {
List<GoblinNftOrderListDto> searchList(Map<String, Object> convertBeanToMap); List<GoblinNftOrderListDto> searchList(Map<String, Object> convertBeanToMap);
List<PlatformGoblinNftOrderNotPayDto> selectOrderList();
} }
...@@ -55,4 +55,18 @@ ...@@ -55,4 +55,18 @@
-- order by a.created_at desc -- order by a.created_at desc
order by a.mid desc order by a.mid desc
</select> </select>
<select id="selectOrderList" resultType="com.liquidnet.service.goblin.dto.PlatformGoblinNftOrderNotPayDto">
select sku_id,
list_id,
sum(if(status = 1, num, 0)) as notPayNum
-- # select status, created_at,pay_time,updated_at,cancel_time,sku_id,list_id
from goblin_nft_order
where 1 > 0
-- # and sku_title = '正在现场盲盒 正在现场盲盒'
and pay_type != 'EXCODE'
-- # and status = 3
and created_at > DATE_SUB(NOW(), INTERVAL 10 MINUTE)
-- # and created_at > DATE_SUB('2022-06-07 12:10:24', INTERVAL 10 MINUTE)
group by sku_id, list_id;
</select>
</mapper> </mapper>
...@@ -4,6 +4,7 @@ import com.liquidnet.service.base.ResponseDto; ...@@ -4,6 +4,7 @@ import com.liquidnet.service.base.ResponseDto;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
...@@ -30,4 +31,6 @@ public interface FeignPlatformGoblinTaskClient { ...@@ -30,4 +31,6 @@ public interface FeignPlatformGoblinTaskClient {
ResponseDto<String> codeCount(); ResponseDto<String> codeCount();
@GetMapping("task/nft/order/notPayNum")
ResponseDto<String> getNotPayNum();
} }
...@@ -53,4 +53,14 @@ public class PlatformGoblinTaskHandler { ...@@ -53,4 +53,14 @@ public class PlatformGoblinTaskHandler {
} }
} }
@XxlJob(value = "sev-platform:getNotPayNum")
public void getNotPayNum() {// 查询待支付订单数量
try {
XxlJobHelper.handleSuccess("结果:" + feignPlatformGoblinTaskClient.getNotPayNum().toJson());
} catch (Exception e) {
XxlJobHelper.log(e);
XxlJobHelper.handleFail();
}
}
} }
...@@ -145,6 +145,9 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService { ...@@ -145,6 +145,9 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
// 1 // 1
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
HashMap<String, Object> map = goblinRedisUtils.getGoodsSkuInfoVo(now, skuId); HashMap<String, Object> map = goblinRedisUtils.getGoodsSkuInfoVo(now, skuId);
if (null == map) {
return null;
}
GoblinGoodsSkuInfoVo skuInfoVo = (GoblinGoodsSkuInfoVo) map.get("vo"); GoblinGoodsSkuInfoVo skuInfoVo = (GoblinGoodsSkuInfoVo) map.get("vo");
Integer tagType = (Integer) map.get("tagType"); Integer tagType = (Integer) map.get("tagType");
String listId = (String) map.get("listId"); String listId = (String) map.get("listId");
...@@ -181,9 +184,10 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService { ...@@ -181,9 +184,10 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
nftGoodsSkuInfoVo.setListId(listId); nftGoodsSkuInfoVo.setListId(listId);
nftGoodsSkuInfoVo.setBaseSaleStartTime(baseSaleStartTime); nftGoodsSkuInfoVo.setBaseSaleStartTime(baseSaleStartTime);
nftGoodsSkuInfoVo.setNextSaleStartTime(nextSaleStartTime); nftGoodsSkuInfoVo.setNextSaleStartTime(nextSaleStartTime);
// 是否开启兑换 // 是否开启兑换
nftGoodsSkuInfoVo.setIsExchange(goblinRedisUtils.getIsExchange(skuId)); nftGoodsSkuInfoVo.setIsExchange(goblinRedisUtils.getIsExchange(skuId));
// 待支付订单数量
nftGoodsSkuInfoVo.setNotPayNum(goblinRedisUtils.getNotPayNum(skuId, listId));
return nftGoodsSkuInfoVo; return nftGoodsSkuInfoVo;
} else { } else {
return null; return null;
......
...@@ -809,6 +809,9 @@ public class GoblinRedisUtils { ...@@ -809,6 +809,9 @@ public class GoblinRedisUtils {
*/ */
public HashMap<String, Object> getGoodsSkuInfoVo(LocalDateTime now, String skuId) { public HashMap<String, Object> getGoodsSkuInfoVo(LocalDateTime now, String skuId) {
GoblinGoodsSkuInfoVo vo = getGoodsSkuInfoVo(skuId); GoblinGoodsSkuInfoVo vo = getGoodsSkuInfoVo(skuId);
if (null == vo) {
return null;
}
HashMap<String, Object> map = CollectionUtil.mapStringObject(); HashMap<String, Object> map = CollectionUtil.mapStringObject();
LocalDateTime nextSaleStartTime = null; LocalDateTime nextSaleStartTime = null;
if (null == vo.getSaleStartTime() || now.isAfter(vo.getSaleStartTime())) {//普通商品已开售 if (null == vo.getSaleStartTime() || now.isAfter(vo.getSaleStartTime())) {//普通商品已开售
...@@ -2083,6 +2086,19 @@ public class GoblinRedisUtils { ...@@ -2083,6 +2086,19 @@ public class GoblinRedisUtils {
} }
} }
public int getNotPayNum(String skuId, String listId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_NOT_PAY_NUM.concat(skuId);
if (null != listId) {
redisKey = redisKey.concat(":").concat(listId);
}
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return 0;
} else {
return (int) obj;
}
}
/** /**
* private int skuType 商品类型[0-常规|1-数字藏品] * private int skuType 商品类型[0-常规|1-数字藏品]
* private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过]; * private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过];
......
package com.liquidnet.service.platform.controller.goblin.task;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.PlatformGoblinNftOrderNotPayDto;
import com.liquidnet.service.goblin.mapper.GoblinNftOrderMapper;
import com.liquidnet.service.platform.utils.GoblinRedisUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* NFT订单相关定时任务
*
* @author jiangxiulng
*/
@Api(tags = "NFT订单相关定时任务")
@Slf4j
@RestController
@RequestMapping("task/nft/order")
public class PlatformGoblinNftOrderController {
@Autowired
private GoblinNftOrderMapper goblinNftOrderMapper;
@Autowired
private GoblinRedisUtils goblinRedisUtils;
@ApiOperation(value = "查询待支付订单数量")
@GetMapping("notPayNum")
public ResponseDto<String> getNotPayNum() {
List<PlatformGoblinNftOrderNotPayDto> goblinNftOrderList = goblinNftOrderMapper.selectOrderList();
for (PlatformGoblinNftOrderNotPayDto notPayDto : goblinNftOrderList) {
goblinRedisUtils.setNotPayNum(notPayDto.getSkuId(), notPayDto.getListId(), notPayDto.getNotPayNum());
}
return ResponseDto.success("查询待支付订单完成");
}
}
...@@ -292,6 +292,15 @@ public class GoblinRedisUtils { ...@@ -292,6 +292,15 @@ public class GoblinRedisUtils {
// 获取sku配置库存 // 获取sku配置库存
// 设置skuId listId 代付款数量
public void setNotPayNum(String skuId, String listId, int notPayNum) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_NOT_PAY_NUM.concat(skuId);
if (!listId.isEmpty()) {
redisKey = redisKey.concat(":").concat(listId);
}
getRedis().set(redisKey, notPayNum);
}
......
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