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

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

Merge branch 'master' into hjc_volunteers_fix_projectList

parents f331783e ac91e242
......@@ -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_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_NOT_PAY_NUM = PREFIX.concat("nft:notPay:");// nft藏品待支付订单数量 skuId:listId
/**
* {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
*/
......
......@@ -94,19 +94,23 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
@ApiModelProperty(position = 65, value = "是否开启兑换 1未开启 2已开启")
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;
@ApiModelProperty(position = 66, value = "单品AR文件URL-Android版")
@ApiModelProperty(position = 68, value = "单品AR文件URL-Android版")
private String arUrlAndroid;
@ApiModelProperty(position = 67, value = "标签[0-提前购买|1-分段购买]")
@ApiModelProperty(position = 69, value = "标签[0-提前购买|1-分段购买]")
private Integer tagType;
@ApiModelProperty(position = 68, value = "分批购活动id")
@ApiModelProperty(position = 70, value = "分批购活动id")
private String listId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 69, value = "sku正常开售时间")
@ApiModelProperty(position = 71, value = "sku正常开售时间")
private LocalDateTime baseSaleStartTime;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 70, value = "下个分段购开始时间,如果为null则没有")
@ApiModelProperty(position = 72, value = "下个分段购开始时间,如果为null则没有")
private LocalDateTime nextSaleStartTime;
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;
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.entity.GoblinNftOrder;
......@@ -19,4 +20,5 @@ public interface GoblinNftOrderMapper extends BaseMapper<GoblinNftOrder> {
List<GoblinNftOrderListDto> searchList(Map<String, Object> convertBeanToMap);
List<PlatformGoblinNftOrderNotPayDto> selectOrderList();
}
......@@ -55,4 +55,18 @@
-- order by a.created_at desc
order by a.mid desc
</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>
......@@ -4,6 +4,7 @@ import com.liquidnet.service.base.ResponseDto;
import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
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.PutMapping;
......@@ -30,4 +31,6 @@ public interface FeignPlatformGoblinTaskClient {
ResponseDto<String> codeCount();
@GetMapping("task/nft/order/notPayNum")
ResponseDto<String> getNotPayNum();
}
......@@ -584,6 +584,12 @@ public class AdamMemberOrderServiceImpl implements IAdamMemberOrderService {
.setSignName(SmsEnum.ADSignName.M01.getVal()).setTemplateCode(SmsEnum.ADTemplate.SMS_232908714.name()).toJson()
);
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
try {
HttpUtil.get(serviceKylinUrl + "/inner/cache/member/".concat(currentUid), CollectionUtil.linkedMultiValueMapStringString());
} catch (Exception e) {
log.error("兑换会员成功:同步Kylin会员缓存异常[UID={},URL={}]", currentUid, serviceKylinUrl, e);
}
} catch (Exception e) {
log.error("会员兑换发生异常[memberCodeVo={}]", JsonUtils.toJson(memberCodeVo), e);
......
......@@ -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();
}
}
}
......@@ -142,8 +142,12 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
@Override
public GoblinNftGoodsSkuInfoVo goodsDetail(String skuId) {
// 1
LocalDateTime now = LocalDateTime.now();
HashMap<String, Object> map = goblinRedisUtils.getGoodsSkuInfoVo(now, skuId);
if (null == map) {
return null;
}
GoblinGoodsSkuInfoVo skuInfoVo = (GoblinGoodsSkuInfoVo) map.get("vo");
Integer tagType = (Integer) map.get("tagType");
String listId = (String) map.get("listId");
......@@ -180,9 +184,10 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
nftGoodsSkuInfoVo.setListId(listId);
nftGoodsSkuInfoVo.setBaseSaleStartTime(baseSaleStartTime);
nftGoodsSkuInfoVo.setNextSaleStartTime(nextSaleStartTime);
// 是否开启兑换
nftGoodsSkuInfoVo.setIsExchange(goblinRedisUtils.getIsExchange(skuId));
// 待支付订单数量
nftGoodsSkuInfoVo.setNotPayNum(goblinRedisUtils.getNotPayNum(skuId, listId));
return nftGoodsSkuInfoVo;
} else {
return null;
......
......@@ -809,6 +809,9 @@ public class GoblinRedisUtils {
*/
public HashMap<String, Object> getGoodsSkuInfoVo(LocalDateTime now, String skuId) {
GoblinGoodsSkuInfoVo vo = getGoodsSkuInfoVo(skuId);
if (null == vo) {
return null;
}
HashMap<String, Object> map = CollectionUtil.mapStringObject();
LocalDateTime nextSaleStartTime = null;
if (null == vo.getSaleStartTime() || now.isAfter(vo.getSaleStartTime())) {//普通商品已开售
......@@ -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 1;
} else {
return (int) obj;
}
}
/**
* private int skuType 商品类型[0-常规|1-数字藏品]
* private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过];
......@@ -2111,11 +2127,11 @@ public class GoblinRedisUtils {
) {// 可以返回库存
// 外面只有盲盒才能请求进来 里面只有不是分批购才判断盲盒里藏品的开售时间
if (null == listId) {
if (LocalDateTime.now().isAfter(info.getSaleStartTime())) {
// if (LocalDateTime.now().isAfter(info.getSaleStartTime())) {
return getSkuStock(listId, info.getSkuId());
} else {
return 0;
}
// } else {
// return 0;
// }
} else {
return getSkuStock(listId, info.getSkuId());
}
......
......@@ -429,11 +429,11 @@ public class GoblinNftOrderUtils {
) {// 可以返回库存
// 外面只有盲盒才能请求进来 里面只有不是分批购才判断盲盒里藏品的开售时间
if (null == listId) {
if (LocalDateTime.now().isAfter(info.getSaleStartTime())) {
// if (LocalDateTime.now().isAfter(info.getSaleStartTime())) {
return goblinRedisUtils.getSkuStock(listId, info.getSkuId());
} else {
return 0;
}
// } else {
// return 0;
// }
} else {
return goblinRedisUtils.getSkuStock(listId, info.getSkuId());
}
......
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("查询待支付订单完成");
}
}
......@@ -119,14 +119,14 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
}
// 判断开售、停售时间
LocalDateTime saleStartTime = goblinGoodsSku.getSaleStartTime();
/* LocalDateTime saleStartTime = goblinGoodsSku.getSaleStartTime();
LocalDateTime saleStopTime = goblinGoodsSku.getSaleStopTime();
LocalDateTime nowTime = LocalDateTime.now();
if (nowTime.isBefore(saleStartTime)) {
continue;
} else if (null != saleStopTime && nowTime.isAfter(saleStopTime)) {
continue;
}
}*/
//是否购买
if (!goblinGoodsSku.getSkuCanbuy().equals("1")) {
......
......@@ -292,6 +292,15 @@ public class GoblinRedisUtils {
// 获取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