commit
79e1f34890
@ -171,11 +171,11 @@ public class GoodsSku extends BaseEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date getUpdateTime() {
|
public Date getCreateTime() {
|
||||||
if (super.getUpdateTime() == null) {
|
if (super.getCreateTime() == null) {
|
||||||
return new Date(1593571928);
|
return new Date(1593571928);
|
||||||
} else {
|
} else {
|
||||||
return super.getUpdateTime();
|
return super.getCreateTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
|||||||
StoreGoodsLabelVO storeGoodsLabelVO = new StoreGoodsLabelVO(storeGoodsLabel.getId(), storeGoodsLabel.getLabelName(), storeGoodsLabel.getLevel(), storeGoodsLabel.getSortOrder());
|
StoreGoodsLabelVO storeGoodsLabelVO = new StoreGoodsLabelVO(storeGoodsLabel.getId(), storeGoodsLabel.getLabelName(), storeGoodsLabel.getLevel(), storeGoodsLabel.getSortOrder());
|
||||||
List<StoreGoodsLabelVO> storeGoodsLabelVOChildList = new ArrayList<>();
|
List<StoreGoodsLabelVO> storeGoodsLabelVOChildList = new ArrayList<>();
|
||||||
list.stream()
|
list.stream()
|
||||||
.filter(label -> label.getParentId().equals(storeGoodsLabel.getId()))
|
.filter(label -> label.getParentId() != null && label.getParentId().equals(storeGoodsLabel.getId()))
|
||||||
.forEach(storeGoodsLabelChild -> storeGoodsLabelVOChildList.add(new StoreGoodsLabelVO(storeGoodsLabelChild.getId(), storeGoodsLabelChild.getLabelName(), storeGoodsLabelChild.getLevel(), storeGoodsLabelChild.getSortOrder())));
|
.forEach(storeGoodsLabelChild -> storeGoodsLabelVOChildList.add(new StoreGoodsLabelVO(storeGoodsLabelChild.getId(), storeGoodsLabelChild.getLabelName(), storeGoodsLabelChild.getLevel(), storeGoodsLabelChild.getSortOrder())));
|
||||||
storeGoodsLabelVO.setChildren(storeGoodsLabelVOChildList);
|
storeGoodsLabelVO.setChildren(storeGoodsLabelVOChildList);
|
||||||
storeGoodsLabelVOList.add(storeGoodsLabelVO);
|
storeGoodsLabelVOList.add(storeGoodsLabelVO);
|
||||||
|
@ -681,7 +681,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
|||||||
*/
|
*/
|
||||||
private void checkMember(String userName, String mobilePhone) {
|
private void checkMember(String userName, String mobilePhone) {
|
||||||
//判断手机号是否存在
|
//判断手机号是否存在
|
||||||
if (findMember(userName, mobilePhone) > 0) {
|
if (findMember(mobilePhone, userName) > 0) {
|
||||||
throw new ServiceException(ResultCode.USER_EXIST);
|
throw new ServiceException(ResultCode.USER_EXIST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class CheckDataRender implements CartRenderStep {
|
|||||||
//缓存中的商品信息
|
//缓存中的商品信息
|
||||||
GoodsSku dataSku = goodsSkuService.getGoodsSkuByIdFromCache(cartSkuVO.getGoodsSku().getId());
|
GoodsSku dataSku = goodsSkuService.getGoodsSkuByIdFromCache(cartSkuVO.getGoodsSku().getId());
|
||||||
//商品有效性判定
|
//商品有效性判定
|
||||||
if (dataSku == null || dataSku.getUpdateTime().before(cartSkuVO.getGoodsSku().getUpdateTime())) {
|
if (dataSku == null || dataSku.getCreateTime().after(cartSkuVO.getGoodsSku().getCreateTime())) {
|
||||||
//设置购物车未选中
|
//设置购物车未选中
|
||||||
cartSkuVO.setChecked(false);
|
cartSkuVO.setChecked(false);
|
||||||
//设置购物车此sku商品已失效
|
//设置购物车此sku商品已失效
|
||||||
|
@ -11,7 +11,6 @@ import cn.lili.modules.store.entity.dto.FreightTemplateChildDTO;
|
|||||||
import cn.lili.modules.store.entity.enums.FreightTemplateEnum;
|
import cn.lili.modules.store.entity.enums.FreightTemplateEnum;
|
||||||
import cn.lili.modules.store.entity.vos.FreightTemplateVO;
|
import cn.lili.modules.store.entity.vos.FreightTemplateVO;
|
||||||
import cn.lili.modules.store.service.FreightTemplateService;
|
import cn.lili.modules.store.service.FreightTemplateService;
|
||||||
import org.apache.xmlbeans.impl.store.Cur;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -51,16 +50,16 @@ public class SkuFreightRender implements CartRenderStep {
|
|||||||
Map<String, List<String>> freightGroups = freightTemplateGrouping(cartSkuVOS);
|
Map<String, List<String>> freightGroups = freightTemplateGrouping(cartSkuVOS);
|
||||||
|
|
||||||
//循环运费模版
|
//循环运费模版
|
||||||
for (String freightTemplateId : freightGroups.keySet()) {
|
for (Map.Entry<String, List<String>> freightTemplateGroup : freightGroups.entrySet()) {
|
||||||
|
|
||||||
//商品id列表
|
//商品id列表
|
||||||
List<String> skuIds = freightGroups.get(freightTemplateId);
|
List<String> skuIds = freightTemplateGroup.getValue();
|
||||||
|
|
||||||
//当前购物车商品列表
|
//当前购物车商品列表
|
||||||
List<CartSkuVO> currentCartSkus = cartSkuVOS.stream().filter(item -> skuIds.contains(item.getGoodsSku().getId())).collect(Collectors.toList());
|
List<CartSkuVO> currentCartSkus = cartSkuVOS.stream().filter(item -> skuIds.contains(item.getGoodsSku().getId())).collect(Collectors.toList());
|
||||||
|
|
||||||
//寻找对应对商品运费计算模版
|
//寻找对应对商品运费计算模版
|
||||||
FreightTemplateVO freightTemplate = freightTemplateService.getFreightTemplate(freightTemplateId);
|
FreightTemplateVO freightTemplate = freightTemplateService.getFreightTemplate(freightTemplateGroup.getKey());
|
||||||
if (freightTemplate != null
|
if (freightTemplate != null
|
||||||
&& freightTemplate.getFreightTemplateChildList() != null
|
&& freightTemplate.getFreightTemplateChildList() != null
|
||||||
&& !freightTemplate.getFreightTemplateChildList().isEmpty()) {
|
&& !freightTemplate.getFreightTemplateChildList().isEmpty()) {
|
||||||
@ -99,7 +98,7 @@ public class SkuFreightRender implements CartRenderStep {
|
|||||||
Double count = currentCartSkus.stream().mapToDouble(item ->
|
Double count = currentCartSkus.stream().mapToDouble(item ->
|
||||||
// 根据计费规则 累加计费基数
|
// 根据计费规则 累加计费基数
|
||||||
freightTemplateChildDTO.getPricingMethod().equals(FreightTemplateEnum.NUM.name()) ?
|
freightTemplateChildDTO.getPricingMethod().equals(FreightTemplateEnum.NUM.name()) ?
|
||||||
item.getNum() :
|
item.getNum().doubleValue() :
|
||||||
CurrencyUtil.mul(item.getNum(), item.getGoodsSku().getWeight())
|
CurrencyUtil.mul(item.getNum(), item.getGoodsSku().getWeight())
|
||||||
).sum();
|
).sum();
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ public class CartServiceImpl implements CartService {
|
|||||||
|
|
||||||
|
|
||||||
//购物车中已经存在,更新数量
|
//购物车中已经存在,更新数量
|
||||||
if (cartSkuVO != null && dataSku.getUpdateTime().equals(cartSkuVO.getGoodsSku().getUpdateTime())) {
|
if (cartSkuVO != null && dataSku.getCreateTime().equals(cartSkuVO.getGoodsSku().getCreateTime())) {
|
||||||
|
|
||||||
//如果覆盖购物车中商品数量
|
//如果覆盖购物车中商品数量
|
||||||
if (Boolean.TRUE.equals(cover)) {
|
if (Boolean.TRUE.equals(cover)) {
|
||||||
|
@ -64,7 +64,7 @@ public abstract class BaseEntity implements Serializable {
|
|||||||
@LastModifiedDate
|
@LastModifiedDate
|
||||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@TableField(fill = FieldFill.UPDATE)
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
@ApiModelProperty(value = "更新时间", hidden = true)
|
@ApiModelProperty(value = "更新时间", hidden = true)
|
||||||
@Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd || yyyy/MM/dd HH:mm:ss|| yyyy/MM/dd ||epoch_millis")
|
@Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd || yyyy/MM/dd HH:mm:ss|| yyyy/MM/dd ||epoch_millis")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user