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

Commit 26f74bfa authored by 张国柄's avatar 张国柄

~API:商品管理:SKU删除同步活动商品;

~API:优惠券列表筛选时间格式问题更正;
parent 6ee55dd6
......@@ -57,7 +57,7 @@ public class GoblinCouponController {
}
@PostMapping("receive")
@ApiOperation("订单状态")
@ApiOperation("领取券")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeCouponId", value = "平台券id"),
......
......@@ -138,6 +138,9 @@ public class GoblinStoreMgtCouponController {
if (null == storeCouponVo) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "参数有误:优惠券不存在");
}
if (storeCouponVo.getState().equals("1")) {// 该优惠券活动中
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "该优惠券活动中不可停用");
}
if (storeCouponVo.getState().equals("3")) {// 该优惠券已停用
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "该优惠券已停用");
}
......
......@@ -699,8 +699,17 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
goodsSkuInfoVo.setUpdatedAt(now);
goodsSkuInfoVo.setDeletedBy(uid);
goodsSkuInfoVo.setDeletedAt(now);
if (goblinMongoUtils.delGoodsSkuInfoVo(goodsSkuInfoVo)) {
goblinRedisUtils.delGoodsSkuInfoVo(delSkuId);
List<String> skuReList = goblinRedisUtils.getSkuRe(delSkuId);
skuReList = null == skuReList ? CollectionUtil.arrayListString() : skuReList;
skuReList.add(delSkuId);
if (goblinMongoUtils.delGoodsSkuInfoVo(goodsSkuInfoVo, skuReList)) {
// goblinRedisUtils.delGoodsSkuInfoVo(delSkuId);
// goblinRedisUtils.delGoodsSkuInfoVoByUnShelves(delSkuId);
skuReList.forEach(skuRe -> {
goblinRedisUtils.delGoodsSkuInfoVo(skuRe);
goblinRedisUtils.delGoodsSkuInfoVoByUnShelves(skuRe);
});
BigDecimal priceGe = BigDecimal.ZERO, priceLe = BigDecimal.ZERO;
for (String skuId : mgtGoodsInfoVo.getSkuIdList()) {
......
......@@ -498,9 +498,9 @@ public class GoblinMongoUtils {
return (List<GoblinGoodsSkuInfoVo>) mongoTemplate.insert(vos, GoblinGoodsSkuInfoVo.class.getSimpleName());
}
public boolean delGoodsSkuInfoVo(GoblinGoodsSkuInfoVo vo) {
public boolean delGoodsSkuInfoVo(GoblinGoodsSkuInfoVo vo, List<String> skuIdList) {
return mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("skuId").is(vo.getSkuId()).and("delFlg").is("0")).getQueryObject(),
Query.query(Criteria.where("skuId").is(skuIdList).and("delFlg").is("0")).getQueryObject(),
Update.update("updatedBy", vo.getUpdatedBy()).set("updatedAt", vo.getUpdatedAt())
.set("deletedBy", vo.getDeletedBy()).set("deletedAt", vo.getDeletedAt()).getUpdateObject()
).getModifiedCount() > 0;
......@@ -1075,21 +1075,20 @@ public class GoblinMongoUtils {
criteria.and("state").is(filterParam.getState());
}
if (StringUtils.isNotBlank(filterParam.getStartTime())) {
LocalDateTime startTime = DateUtil.Formatter.yyyy_MM_dd.parse(filterParam.getStartTime());
LocalDateTime startTime = DateUtil.Formatter.yyyyMMddHHmmss.parse(filterParam.getStartTime());
LocalDateTime startTimeBegin = startTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
criteria.and("startTime").gte(startTimeBegin);
}
if (StringUtils.isNotBlank(filterParam.getEndTime())) {
LocalDateTime endTime = DateUtil.Formatter.yyyy_MM_dd.parse(filterParam.getEndTime());
LocalDateTime endTime = DateUtil.Formatter.yyyyMMddHHmmss.parse(filterParam.getEndTime());
LocalDateTime endTimeEnd = endTime.withHour(23).withMinute(59).withSecond(59).withNano(999);
criteria.and("endTime").gte(endTimeEnd);
}
if (StringUtils.isNotBlank(filterParam.getCreatedDt())) {
LocalDateTime createDt = DateUtil.Formatter.yyyy_MM_dd.parse(filterParam.getCreatedDt());
LocalDateTime createdAtBegin = createDt.withHour(0).withMinute(0).withSecond(0).withNano(0);
LocalDateTime createdAtEnd = createDt.withHour(23).withMinute(59).withSecond(59).withNano(999);
LocalDateTime createdAtBegin = DateUtil.Formatter.yyyyMMddHHmmss.parse(filterParam.getCreatedDt() + " 00:00:00");
LocalDateTime createdAtEnd = createdAtBegin.withHour(23).withMinute(59).withSecond(59).withNano(999);
criteria.and("createdAt").gte(createdAtBegin).lte(createdAtEnd);
}
......
......@@ -97,7 +97,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.SKU_RELATION.concat(skuId);
Object obj = redisUtil.get(rk);
if (obj == null) {
return new ArrayList();
return CollectionUtil.arrayListString();
} else {
return (List<String>) obj;
}
......
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