删除 status 枚举
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
package com.czg.enums;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 有效状态枚举
|
|
||||||
* @author tankaikai
|
|
||||||
* @since 2025-02-11 14:54
|
|
||||||
*/
|
|
||||||
public enum StatusEnum {
|
|
||||||
/**
|
|
||||||
* 禁用状态
|
|
||||||
*/
|
|
||||||
DISABLE(0),
|
|
||||||
/**
|
|
||||||
* 启用状态
|
|
||||||
*/
|
|
||||||
ENABLED(1);
|
|
||||||
|
|
||||||
private final int value;
|
|
||||||
|
|
||||||
StatusEnum(int value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int value() {
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,7 +13,6 @@ import com.czg.account.vo.LoginVO;
|
|||||||
import com.czg.config.RedisCst;
|
import com.czg.config.RedisCst;
|
||||||
import com.czg.constants.SystemConstants;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.enums.PlatformTypeEnum;
|
import com.czg.enums.PlatformTypeEnum;
|
||||||
import com.czg.enums.StatusEnum;
|
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.sa.MyStpLogic;
|
import com.czg.sa.MyStpLogic;
|
||||||
import com.czg.sa.StpKit;
|
import com.czg.sa.StpKit;
|
||||||
@@ -108,7 +107,7 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
|||||||
if (sysUser == null) {
|
if (sysUser == null) {
|
||||||
throw new CzgException("登录账号不存在");
|
throw new CzgException("登录账号不存在");
|
||||||
}
|
}
|
||||||
if ("WEB".equals(platType) && StatusEnum.DISABLE.value() == sysUser.getStatus()) {
|
if ("WEB".equals(platType) && SystemConstants.OneZero.ZERO == sysUser.getStatus()) {
|
||||||
throw new CzgException("账户未启用");
|
throw new CzgException("账户未启用");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import com.czg.config.RabbitPublisher;
|
|||||||
import com.czg.config.RedisCst;
|
import com.czg.config.RedisCst;
|
||||||
import com.czg.constants.SystemConstants;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.constants.ShopSwitchTypeEnum;
|
import com.czg.constants.ShopSwitchTypeEnum;
|
||||||
import com.czg.enums.StatusEnum;
|
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.resp.CzgResult;
|
import com.czg.resp.CzgResult;
|
||||||
import com.czg.sa.MyStpLogic;
|
import com.czg.sa.MyStpLogic;
|
||||||
@@ -110,7 +109,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
|||||||
if (shopInfo.getExpireTime() != null && (DateUtil.date().toLocalDateTime().isAfter(shopInfo.getExpireTime()))) {
|
if (shopInfo.getExpireTime() != null && (DateUtil.date().toLocalDateTime().isAfter(shopInfo.getExpireTime()))) {
|
||||||
throw new CzgException("店铺已过期,请联系商家");
|
throw new CzgException("店铺已过期,请联系商家");
|
||||||
}
|
}
|
||||||
if (StatusEnum.DISABLE.value() == shopInfo.getOnSale() || shopInfo.getStatus() != StatusEnum.ENABLED.value()) {
|
if (SystemConstants.OneZero.ZERO == shopInfo.getOnSale() || shopInfo.getStatus() !=SystemConstants.OneZero.ONE) {
|
||||||
throw new CzgException("店铺已停业,请联系商家");
|
throw new CzgException("店铺已停业,请联系商家");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,11 @@ import com.czg.account.dto.auth.WechatRawDataDTO;
|
|||||||
import com.czg.account.entity.UserInfo;
|
import com.czg.account.entity.UserInfo;
|
||||||
import com.czg.account.service.UserAuthorizationService;
|
import com.czg.account.service.UserAuthorizationService;
|
||||||
import com.czg.account.service.UserInfoService;
|
import com.czg.account.service.UserInfoService;
|
||||||
import com.czg.enums.StatusEnum;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.enums.UserAuthSourceEnum;
|
import com.czg.enums.UserAuthSourceEnum;
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.sa.MyStpLogic;
|
import com.czg.sa.MyStpLogic;
|
||||||
import com.czg.sa.StpKit;
|
import com.czg.sa.StpKit;
|
||||||
import com.czg.service.account.util.AcAccountUtil;
|
|
||||||
import com.czg.service.account.util.AlipayUtil;
|
import com.czg.service.account.util.AlipayUtil;
|
||||||
import com.czg.service.account.util.WechatAuthUtil;
|
import com.czg.service.account.util.WechatAuthUtil;
|
||||||
import com.czg.system.enums.SysParamCodeEnum;
|
import com.czg.system.enums.SysParamCodeEnum;
|
||||||
@@ -25,7 +24,6 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
@@ -113,7 +111,7 @@ public class UserAuthorizationServiceImpl implements UserAuthorizationService {
|
|||||||
userInfo.setAlipayOpenId(openId);
|
userInfo.setAlipayOpenId(openId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userInfo.getStatus() != null && StatusEnum.DISABLE.value() == userInfo.getStatus()) {
|
if (userInfo.getStatus() != null && SystemConstants.OneZero.ZERO == userInfo.getStatus()) {
|
||||||
throw new CzgException("账号已禁用");
|
throw new CzgException("账号已禁用");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.czg.service.product.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.czg.enums.StatusEnum;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.product.dto.ConsGroupDTO;
|
import com.czg.product.dto.ConsGroupDTO;
|
||||||
import com.czg.product.dto.ConsInfoDTO;
|
import com.czg.product.dto.ConsInfoDTO;
|
||||||
@@ -56,7 +56,7 @@ public class ConsGroupServiceImpl extends ServiceImpl<ConsGroupMapper, ConsGroup
|
|||||||
@Override
|
@Override
|
||||||
public List<ConsGroupDTO> getConsGroupList(ConsGroupDTO param) {
|
public List<ConsGroupDTO> getConsGroupList(ConsGroupDTO param) {
|
||||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||||
queryWrapper.eq(ConsGroup::getStatus, StatusEnum.ENABLED.value());
|
queryWrapper.eq(ConsGroup::getStatus, SystemConstants.OneZero.ONE);
|
||||||
return super.listAs(queryWrapper, ConsGroupDTO.class);
|
return super.listAs(queryWrapper, ConsGroupDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public class ConsGroupServiceImpl extends ServiceImpl<ConsGroupMapper, ConsGroup
|
|||||||
public void disableConsGroup(Long id) {
|
public void disableConsGroup(Long id) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ConsGroup.class)
|
UpdateChain.of(ConsGroup.class)
|
||||||
.set(ConsGroup::getStatus, StatusEnum.DISABLE.value())
|
.set(ConsGroup::getStatus, SystemConstants.OneZero.ZERO)
|
||||||
.eq(ConsGroup::getId, id)
|
.eq(ConsGroup::getId, id)
|
||||||
.eq(ConsGroup::getShopId, shopId)
|
.eq(ConsGroup::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
@@ -117,7 +117,7 @@ public class ConsGroupServiceImpl extends ServiceImpl<ConsGroupMapper, ConsGroup
|
|||||||
public void enableConsGroup(Long id) {
|
public void enableConsGroup(Long id) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ConsGroup.class)
|
UpdateChain.of(ConsGroup.class)
|
||||||
.set(ConsGroup::getStatus, StatusEnum.ENABLED.value())
|
.set(ConsGroup::getStatus,SystemConstants.OneZero.ONE)
|
||||||
.eq(ConsGroup::getId, id)
|
.eq(ConsGroup::getId, id)
|
||||||
.eq(ConsGroup::getShopId, shopId)
|
.eq(ConsGroup::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package com.czg.service.product.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.czg.account.service.SyncNoticeService;
|
|
||||||
import com.czg.constants.SystemConstants;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.enums.CrudEnum;
|
import com.czg.enums.CrudEnum;
|
||||||
import com.czg.enums.StatusEnum;
|
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.product.dto.ConsInfoDTO;
|
import com.czg.product.dto.ConsInfoDTO;
|
||||||
import com.czg.product.dto.ProductBriefDTO;
|
import com.czg.product.dto.ProductBriefDTO;
|
||||||
@@ -28,7 +26,6 @@ import com.mybatisflex.core.query.QueryWrapper;
|
|||||||
import com.mybatisflex.core.update.UpdateChain;
|
import com.mybatisflex.core.update.UpdateChain;
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -51,9 +48,6 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
|||||||
private final ConsGroupMapper consGroupMapper;
|
private final ConsGroupMapper consGroupMapper;
|
||||||
private final ConsStockFlowMapper consStockFlowMapper;
|
private final ConsStockFlowMapper consStockFlowMapper;
|
||||||
|
|
||||||
@DubboReference
|
|
||||||
private SyncNoticeService syncNoticeService;
|
|
||||||
|
|
||||||
private QueryWrapper buildQueryWrapper(ConsInfoDTO param) {
|
private QueryWrapper buildQueryWrapper(ConsInfoDTO param) {
|
||||||
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
|
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
|
||||||
if (ObjUtil.isNotNull(param.getConsGroupId())) {
|
if (ObjUtil.isNotNull(param.getConsGroupId())) {
|
||||||
@@ -92,7 +86,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
|||||||
@Override
|
@Override
|
||||||
public List<ConsInfoDTO> getConsInfoList(ConsInfoDTO param) {
|
public List<ConsInfoDTO> getConsInfoList(ConsInfoDTO param) {
|
||||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||||
queryWrapper.eq(ConsInfo::getStatus, StatusEnum.ENABLED.value());
|
queryWrapper.eq(ConsInfo::getStatus,SystemConstants.OneZero.ONE);
|
||||||
List<ConsInfoDTO> list = super.listAs(queryWrapper, ConsInfoDTO.class);
|
List<ConsInfoDTO> list = super.listAs(queryWrapper, ConsInfoDTO.class);
|
||||||
List<ConsGroup> consGroupList = consGroupMapper.selectListByQuery(QueryWrapper.create().eq(ConsGroup::getShopId, param.getShopId()));
|
List<ConsGroup> consGroupList = consGroupMapper.selectListByQuery(QueryWrapper.create().eq(ConsGroup::getShopId, param.getShopId()));
|
||||||
Map<Long, String> collect = consGroupList.stream().collect(Collectors.toMap(ConsGroup::getId, ConsGroup::getName));
|
Map<Long, String> collect = consGroupList.stream().collect(Collectors.toMap(ConsGroup::getId, ConsGroup::getName));
|
||||||
@@ -124,7 +118,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
|||||||
}
|
}
|
||||||
ConsInfo entity = BeanUtil.copyProperties(dto, ConsInfo.class);
|
ConsInfo entity = BeanUtil.copyProperties(dto, ConsInfo.class);
|
||||||
entity.setStockNumber(BigDecimal.ZERO);
|
entity.setStockNumber(BigDecimal.ZERO);
|
||||||
entity.setStatus(StatusEnum.ENABLED.value());
|
entity.setStatus(SystemConstants.OneZero.ONE);
|
||||||
//entity.setConWarning(BigDecimal.ZERO);
|
//entity.setConWarning(BigDecimal.ZERO);
|
||||||
entity.setIsStock(SystemConstants.OneZero.ZERO);
|
entity.setIsStock(SystemConstants.OneZero.ZERO);
|
||||||
entity.setShopId(shopId);
|
entity.setShopId(shopId);
|
||||||
@@ -158,7 +152,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
|||||||
public void disableConsInfo(Long id) {
|
public void disableConsInfo(Long id) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ConsInfo.class)
|
UpdateChain.of(ConsInfo.class)
|
||||||
.set(ConsInfo::getStatus, StatusEnum.DISABLE.value())
|
.set(ConsInfo::getStatus, SystemConstants.OneZero.ZERO)
|
||||||
.eq(ConsInfo::getId, id)
|
.eq(ConsInfo::getId, id)
|
||||||
.eq(ConsInfo::getShopId, shopId)
|
.eq(ConsInfo::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
@@ -168,7 +162,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
|||||||
public void enableConsInfo(Long id) {
|
public void enableConsInfo(Long id) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ConsInfo.class)
|
UpdateChain.of(ConsInfo.class)
|
||||||
.set(ConsInfo::getStatus, StatusEnum.ENABLED.value())
|
.set(ConsInfo::getStatus,SystemConstants.OneZero.ONE)
|
||||||
.eq(ConsInfo::getId, id)
|
.eq(ConsInfo::getId, id)
|
||||||
.eq(ConsInfo::getShopId, shopId)
|
.eq(ConsInfo::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.czg.constant.CacheConstant;
|
import com.czg.constant.CacheConstant;
|
||||||
import com.czg.enums.StatusEnum;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.product.dto.ProdGroupDTO;
|
import com.czg.product.dto.ProdGroupDTO;
|
||||||
import com.czg.product.dto.ProductBriefDTO;
|
import com.czg.product.dto.ProductBriefDTO;
|
||||||
@@ -67,7 +67,7 @@ public class ProdGroupServiceImpl extends ServiceImpl<ProdGroupMapper, ProdGroup
|
|||||||
@Override
|
@Override
|
||||||
public List<ProdGroupDTO> getProdGroupList(ProdGroupDTO param) {
|
public List<ProdGroupDTO> getProdGroupList(ProdGroupDTO param) {
|
||||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||||
queryWrapper.eq(ProdGroup::getStatus, StatusEnum.ENABLED.value());
|
queryWrapper.eq(ProdGroup::getStatus, SystemConstants.OneZero.ONE);
|
||||||
return super.listAs(queryWrapper, ProdGroupDTO.class);
|
return super.listAs(queryWrapper, ProdGroupDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ public class ProdGroupServiceImpl extends ServiceImpl<ProdGroupMapper, ProdGroup
|
|||||||
}
|
}
|
||||||
ProdGroup entity = getById(dto.getId());
|
ProdGroup entity = getById(dto.getId());
|
||||||
BeanUtil.copyProperties(dto, entity, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(dto, entity, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
if (entity.getUseTime() == StatusEnum.DISABLE.value()) {
|
if (entity.getUseTime() == SystemConstants.OneZero.ZERO) {
|
||||||
entity.setSaleStartTime(null);
|
entity.setSaleStartTime(null);
|
||||||
entity.setSaleEndTime(null);
|
entity.setSaleEndTime(null);
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ public class ProdGroupServiceImpl extends ServiceImpl<ProdGroupMapper, ProdGroup
|
|||||||
@CacheEvict(value = {CacheConstant.USER_CLIENT_HOTS_PRODUCT, CacheConstant.USER_CLIENT_GROUPS_PRODUCT}, key = "#shopId", allEntries = true)
|
@CacheEvict(value = {CacheConstant.USER_CLIENT_HOTS_PRODUCT, CacheConstant.USER_CLIENT_GROUPS_PRODUCT}, key = "#shopId", allEntries = true)
|
||||||
public void disableProdGroup(Long shopId, Long id) {
|
public void disableProdGroup(Long shopId, Long id) {
|
||||||
UpdateChain.of(ProdGroup.class)
|
UpdateChain.of(ProdGroup.class)
|
||||||
.set(ProdGroup::getStatus, StatusEnum.DISABLE.value())
|
.set(ProdGroup::getStatus, SystemConstants.OneZero.ZERO)
|
||||||
.eq(ProdGroup::getId, id)
|
.eq(ProdGroup::getId, id)
|
||||||
.eq(ProdGroup::getShopId, shopId)
|
.eq(ProdGroup::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
@@ -171,7 +171,7 @@ public class ProdGroupServiceImpl extends ServiceImpl<ProdGroupMapper, ProdGroup
|
|||||||
@CacheEvict(value = {CacheConstant.USER_CLIENT_HOTS_PRODUCT, CacheConstant.USER_CLIENT_GROUPS_PRODUCT}, key = "#shopId", allEntries = true)
|
@CacheEvict(value = {CacheConstant.USER_CLIENT_HOTS_PRODUCT, CacheConstant.USER_CLIENT_GROUPS_PRODUCT}, key = "#shopId", allEntries = true)
|
||||||
public void enableProdGroup(Long shopId, Long id) {
|
public void enableProdGroup(Long shopId, Long id) {
|
||||||
UpdateChain.of(ProdGroup.class)
|
UpdateChain.of(ProdGroup.class)
|
||||||
.set(ProdGroup::getStatus, StatusEnum.ENABLED.value())
|
.set(ProdGroup::getStatus,SystemConstants.OneZero.ONE)
|
||||||
.eq(ProdGroup::getId, id)
|
.eq(ProdGroup::getId, id)
|
||||||
.eq(ProdGroup::getShopId, shopId)
|
.eq(ProdGroup::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.czg.service.product.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.czg.enums.StatusEnum;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.product.dto.ShopProdCategoryDTO;
|
import com.czg.product.dto.ShopProdCategoryDTO;
|
||||||
import com.czg.product.entity.ShopProdCategory;
|
import com.czg.product.entity.ShopProdCategory;
|
||||||
@@ -58,7 +58,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
|||||||
@Override
|
@Override
|
||||||
public List<ShopProdCategoryDTO> getShopProdCategoryList(ShopProdCategoryDTO param) {
|
public List<ShopProdCategoryDTO> getShopProdCategoryList(ShopProdCategoryDTO param) {
|
||||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||||
queryWrapper.eq(ShopProdCategory::getStatus, StatusEnum.ENABLED.value());
|
queryWrapper.eq(ShopProdCategory::getStatus, SystemConstants.OneZero.ONE);
|
||||||
return super.listAs(queryWrapper, ShopProdCategoryDTO.class);
|
return super.listAs(queryWrapper, ShopProdCategoryDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
|||||||
// 简称
|
// 简称
|
||||||
entity.setShortName(dto.getName());
|
entity.setShortName(dto.getName());
|
||||||
if (entity.getStatus() == null) {
|
if (entity.getStatus() == null) {
|
||||||
entity.setStatus(StatusEnum.ENABLED.value());
|
entity.setStatus(SystemConstants.OneZero.ONE);
|
||||||
}
|
}
|
||||||
entity.setPid(0L);
|
entity.setPid(0L);
|
||||||
entity.setShopId(shopId);
|
entity.setShopId(shopId);
|
||||||
@@ -111,7 +111,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
|||||||
public void disableShopProdCategory(Long id) {
|
public void disableShopProdCategory(Long id) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ShopProdCategory.class)
|
UpdateChain.of(ShopProdCategory.class)
|
||||||
.set(ShopProdCategory::getStatus, StatusEnum.DISABLE.value())
|
.set(ShopProdCategory::getStatus, SystemConstants.OneZero.ZERO)
|
||||||
.eq(ShopProdCategory::getId, id)
|
.eq(ShopProdCategory::getId, id)
|
||||||
.eq(ShopProdCategory::getShopId, shopId)
|
.eq(ShopProdCategory::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
@@ -122,7 +122,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
|||||||
public void enableShopProdCategory(Long id) {
|
public void enableShopProdCategory(Long id) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ShopProdCategory.class)
|
UpdateChain.of(ShopProdCategory.class)
|
||||||
.set(ShopProdCategory::getStatus, StatusEnum.ENABLED.value())
|
.set(ShopProdCategory::getStatus,SystemConstants.OneZero.ONE)
|
||||||
.eq(ShopProdCategory::getId, id)
|
.eq(ShopProdCategory::getId, id)
|
||||||
.eq(ShopProdCategory::getShopId, shopId)
|
.eq(ShopProdCategory::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.czg.service.product.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.czg.constants.SystemConstants;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.enums.StatusEnum;
|
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.product.dto.ShopProdUnitDTO;
|
import com.czg.product.dto.ShopProdUnitDTO;
|
||||||
import com.czg.product.entity.ShopProdUnit;
|
import com.czg.product.entity.ShopProdUnit;
|
||||||
@@ -56,7 +55,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
|||||||
@Override
|
@Override
|
||||||
public List<ShopProdUnitDTO> getShopProdUnitList(ShopProdUnitDTO param) {
|
public List<ShopProdUnitDTO> getShopProdUnitList(ShopProdUnitDTO param) {
|
||||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||||
queryWrapper.eq(ShopProdUnit::getStatus, StatusEnum.ENABLED.value());
|
queryWrapper.eq(ShopProdUnit::getStatus,SystemConstants.OneZero.ONE);
|
||||||
return super.listAs(queryWrapper, ShopProdUnitDTO.class);
|
return super.listAs(queryWrapper, ShopProdUnitDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +84,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
|||||||
entity.setUnitType(UnitTypeEnum.NUMBER.value());
|
entity.setUnitType(UnitTypeEnum.NUMBER.value());
|
||||||
// 单位来源 1-系统预设 0-商家创建
|
// 单位来源 1-系统预设 0-商家创建
|
||||||
entity.setIsSystem(SystemConstants.OneZero.ZERO);
|
entity.setIsSystem(SystemConstants.OneZero.ZERO);
|
||||||
entity.setStatus(StatusEnum.ENABLED.value());
|
entity.setStatus(SystemConstants.OneZero.ONE);
|
||||||
entity.setShopId(shopId);
|
entity.setShopId(shopId);
|
||||||
super.save(entity);
|
super.save(entity);
|
||||||
return entity.getId();
|
return entity.getId();
|
||||||
@@ -125,7 +124,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
|||||||
checkShopProdUnit(id);
|
checkShopProdUnit(id);
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ShopProdUnit.class)
|
UpdateChain.of(ShopProdUnit.class)
|
||||||
.set(ShopProdUnit::getStatus, StatusEnum.DISABLE.value())
|
.set(ShopProdUnit::getStatus, SystemConstants.OneZero.ZERO)
|
||||||
.eq(ShopProdUnit::getId, id)
|
.eq(ShopProdUnit::getId, id)
|
||||||
.eq(ShopProdUnit::getShopId, shopId)
|
.eq(ShopProdUnit::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
@@ -136,7 +135,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
|||||||
checkShopProdUnit(id);
|
checkShopProdUnit(id);
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ShopProdUnit.class)
|
UpdateChain.of(ShopProdUnit.class)
|
||||||
.set(ShopProdUnit::getStatus, StatusEnum.ENABLED.value())
|
.set(ShopProdUnit::getStatus,SystemConstants.OneZero.ONE)
|
||||||
.eq(ShopProdUnit::getId, id)
|
.eq(ShopProdUnit::getId, id)
|
||||||
.eq(ShopProdUnit::getShopId, shopId)
|
.eq(ShopProdUnit::getShopId, shopId)
|
||||||
.update();
|
.update();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.czg.constant.GlobalConstant;
|
import com.czg.constant.GlobalConstant;
|
||||||
import com.czg.enums.StatusEnum;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.product.dto.ShopProdSpecDTO;
|
import com.czg.product.dto.ShopProdSpecDTO;
|
||||||
import com.czg.product.entity.ShopProdSpec;
|
import com.czg.product.entity.ShopProdSpec;
|
||||||
@@ -70,7 +70,7 @@ public class ShopProductSpecServiceImpl extends ServiceImpl<ShopProdSpecMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<ShopProdSpecDTO> getShopProdSpecList(ShopProdSpecDTO param) {
|
public List<ShopProdSpecDTO> getShopProdSpecList(ShopProdSpecDTO param) {
|
||||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||||
queryWrapper.eq(ShopProdSpec::getStatus, StatusEnum.ENABLED.value());
|
queryWrapper.eq(ShopProdSpec::getStatus, SystemConstants.OneZero.ONE);
|
||||||
List<ShopProdSpecDTO> list = super.listAs(queryWrapper, ShopProdSpecDTO.class);
|
List<ShopProdSpecDTO> list = super.listAs(queryWrapper, ShopProdSpecDTO.class);
|
||||||
return TreeUtils.build(list, CollUtil.isEmpty(list) ? GlobalConstant.TREE_ROOT : list.getFirst().getPid());
|
return TreeUtils.build(list, CollUtil.isEmpty(list) ? GlobalConstant.TREE_ROOT : list.getFirst().getPid());
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ public class ShopProductSpecServiceImpl extends ServiceImpl<ShopProdSpecMapper,
|
|||||||
String pids = parent.getPids();
|
String pids = parent.getPids();
|
||||||
entity.setPids(pids + entity.getPid() + ",");
|
entity.setPids(pids + entity.getPid() + ",");
|
||||||
}
|
}
|
||||||
entity.setStatus(StatusEnum.ENABLED.value());
|
entity.setStatus(SystemConstants.OneZero.ONE);
|
||||||
entity.setShopId(shopId);
|
entity.setShopId(shopId);
|
||||||
super.save(entity);
|
super.save(entity);
|
||||||
dto.setId(entity.getId());
|
dto.setId(entity.getId());
|
||||||
@@ -163,7 +163,7 @@ public class ShopProductSpecServiceImpl extends ServiceImpl<ShopProdSpecMapper,
|
|||||||
public void disableShopProdSpec(Long id) {
|
public void disableShopProdSpec(Long id) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ShopProdSpec.class)
|
UpdateChain.of(ShopProdSpec.class)
|
||||||
.set(SHOP_PROD_SPEC.STATUS, StatusEnum.DISABLE.value())
|
.set(SHOP_PROD_SPEC.STATUS, SystemConstants.OneZero.ZERO)
|
||||||
.where(SHOP_PROD_SPEC.SHOP_ID.eq(shopId)
|
.where(SHOP_PROD_SPEC.SHOP_ID.eq(shopId)
|
||||||
.and(SHOP_PROD_SPEC.ID.eq(id).or(SHOP_PROD_SPEC.PIDS.like("," + id + ",")))).update();
|
.and(SHOP_PROD_SPEC.ID.eq(id).or(SHOP_PROD_SPEC.PIDS.like("," + id + ",")))).update();
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ public class ShopProductSpecServiceImpl extends ServiceImpl<ShopProdSpecMapper,
|
|||||||
public void enableShopProdSpec(Long id) {
|
public void enableShopProdSpec(Long id) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
UpdateChain.of(ShopProdSpec.class)
|
UpdateChain.of(ShopProdSpec.class)
|
||||||
.set(SHOP_PROD_SPEC.STATUS, StatusEnum.ENABLED.value())
|
.set(SHOP_PROD_SPEC.STATUS,SystemConstants.OneZero.ONE)
|
||||||
.where(SHOP_PROD_SPEC.SHOP_ID.eq(shopId)
|
.where(SHOP_PROD_SPEC.SHOP_ID.eq(shopId)
|
||||||
.and(SHOP_PROD_SPEC.ID.eq(id).or(SHOP_PROD_SPEC.PIDS.like("," + id + ",")))).update();
|
.and(SHOP_PROD_SPEC.ID.eq(id).or(SHOP_PROD_SPEC.PIDS.like("," + id + ",")))).update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import cn.hutool.core.util.ObjUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.czg.constant.CacheConstant;
|
import com.czg.constant.CacheConstant;
|
||||||
import com.czg.constants.SystemConstants;
|
import com.czg.constants.SystemConstants;
|
||||||
import com.czg.enums.StatusEnum;
|
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.product.dto.ProdGroupRelationDTO;
|
import com.czg.product.dto.ProdGroupRelationDTO;
|
||||||
import com.czg.product.dto.ProdSkuDTO;
|
import com.czg.product.dto.ProdSkuDTO;
|
||||||
@@ -77,7 +76,7 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
|||||||
public List<ShopGroupProductVo> queryGroupProductList(Long shopId) {
|
public List<ShopGroupProductVo> queryGroupProductList(Long shopId) {
|
||||||
List<ShopGroupProductVo> groupList = prodGroupMapper.selectListByQueryAs(
|
List<ShopGroupProductVo> groupList = prodGroupMapper.selectListByQueryAs(
|
||||||
query().select(ProdGroup::getId, ProdGroup::getName, ProdGroup::getSortMode, ProdGroup::getUseTime, ProdGroup::getSaleStartTime, ProdGroup::getSaleEndTime)
|
query().select(ProdGroup::getId, ProdGroup::getName, ProdGroup::getSortMode, ProdGroup::getUseTime, ProdGroup::getSaleStartTime, ProdGroup::getSaleEndTime)
|
||||||
.eq(ProdGroup::getShopId, shopId).eq(ProdGroup::getStatus, StatusEnum.ENABLED.value())
|
.eq(ProdGroup::getShopId, shopId).eq(ProdGroup::getStatus,SystemConstants.OneZero.ONE)
|
||||||
.orderBy(ProdGroup::getSort, true), ShopGroupProductVo.class);
|
.orderBy(ProdGroup::getSort, true), ShopGroupProductVo.class);
|
||||||
List<ShopProductVo> productAllList = productMapper.selectGroupProductList(shopId);
|
List<ShopProductVo> productAllList = productMapper.selectGroupProductList(shopId);
|
||||||
productAllList.forEach(item -> {
|
productAllList.forEach(item -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user