Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -7,7 +7,7 @@ import com.czg.account.service.HandoverRecordService;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.account.vo.HandoverTotalVo;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
@@ -103,7 +103,7 @@ public class HandoverRecordController {
|
||||
@OperationLog("收银机-交班/关班-网络打印机打印交班小票")
|
||||
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:networkPrint", name = "收银机-交班/关班-网络打印机打印交班小票")
|
||||
public CzgResult<Void> handover(@PathVariable Long id) {
|
||||
handoverRecordService.printHandoverReceipt(id, YesNoEnum.YES.value());
|
||||
handoverRecordService.printHandoverReceipt(id, SystemConstants.OneZero.ONE);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.czg.controller.admin;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.czg.BaseQueryParam;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.market.dto.MkPointsGoodsDTO;
|
||||
import com.czg.market.entity.MkPointsGoods;
|
||||
@@ -62,7 +62,7 @@ public class PointsGoodsController {
|
||||
dto.setShopId(StpKit.USER.getShopId());
|
||||
if (dto.getCouponId() != null) {
|
||||
ShopCoupon coupon = shopCouponService.getById(dto.getCouponId());
|
||||
if (coupon == null || coupon.getIsDel() == DeleteEnum.DELETED.value() || coupon.getStatus() != 1) {
|
||||
if (coupon == null || coupon.getIsDel() == SystemConstants.OneZero.ONE || coupon.getStatus() != 1) {
|
||||
throw new CzgException("操作失败,优惠券已删除或未启用");
|
||||
}
|
||||
if ("custom".equals(coupon.getValidType())) {
|
||||
@@ -88,7 +88,7 @@ public class PointsGoodsController {
|
||||
@SaAdminCheckPermission(parentName = "积分相关", value = "points:goods:delete", name = "积分-商品-删除")
|
||||
public CzgResult<Void> deletePointsGoodsSetting(@PathVariable("id") Long id) {
|
||||
MkPointsGoods entity = pointsGoodsSettingService.getById(id);
|
||||
entity.setDelFlag(DeleteEnum.DELETED.value());
|
||||
entity.setDelFlag(SystemConstants.OneZero.ONE);
|
||||
pointsGoodsSettingService.updateById(entity);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.czg.service.order.service.PayService;
|
||||
import com.czg.utils.ServletUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -31,6 +32,7 @@ import java.util.Map;
|
||||
* @author yjjie
|
||||
* @date 2025/12/18 18:54
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/user/ppOrder")
|
||||
public class UPpOrderController {
|
||||
@@ -71,6 +73,8 @@ public class UPpOrderController {
|
||||
}
|
||||
param.setPrice(price);
|
||||
|
||||
log.info("用户【{}】进行套餐推广支付, 分享人数【{}】,订单金额【{}】", detail.getShareNum(), param.getPayType(), price);
|
||||
|
||||
CzgResult<Map<String, Object>> result = CzgResult.success();
|
||||
CzgResult<Map<String, Object>> mapCzgResult = payService.ltPayOther(param, PayTypeConstants.SourceType.PP, "套餐推广购买");
|
||||
if (200 != mapCzgResult.getCode()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.product.param.ShopProductSkuParam;
|
||||
import com.czg.product.service.UProductService;
|
||||
import com.czg.product.vo.ShopGroupProductVo;
|
||||
@@ -63,7 +63,7 @@ public class UProductController {
|
||||
item.getProductList().forEach(prod -> {
|
||||
prod.setIsSaleTime(uProductService.calcIsSaleTime(prod.getDays(), prod.getStartTime(), prod.getEndTime()));
|
||||
prod.setIsSaleTime(uProductService.calcIsSaleTime(prod.getIsSaleTime(), item.getUseTime(), item.getSaleStartTime(), item.getSaleEndTime()));
|
||||
if (item.getUseTime() == YesNoEnum.YES.value()) {
|
||||
if (item.getUseTime() == SystemConstants.OneZero.ONE) {
|
||||
prod.setStartTime(item.getSaleStartTime());
|
||||
prod.setEndTime(item.getSaleEndTime());
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ public interface SystemConstants {
|
||||
* 是否:是
|
||||
* 状态:允许,开启
|
||||
*/
|
||||
public static final Integer ONE = 1;
|
||||
public static final int ONE = 1;
|
||||
/**
|
||||
* 是否:否
|
||||
* 状态:进制,关闭
|
||||
*/
|
||||
public static final Integer ZERO = 0;
|
||||
public static final int ZERO = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.czg.enums;
|
||||
|
||||
/**
|
||||
* 逻辑删除枚举
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-11 14:55
|
||||
*/
|
||||
public enum DeleteEnum {
|
||||
/**
|
||||
* 是(删除)
|
||||
*/
|
||||
DELETED(1),
|
||||
/**
|
||||
* 否(未删除)
|
||||
*/
|
||||
NORMAL(0);
|
||||
|
||||
private int value;
|
||||
|
||||
DeleteEnum(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.czg.enums;
|
||||
|
||||
/**
|
||||
* 是否枚举
|
||||
* @author tankaikai
|
||||
* @since 2025-02-11 14:56
|
||||
*/
|
||||
public enum YesNoEnum {
|
||||
/**
|
||||
* 是(删除)
|
||||
*/
|
||||
YES(1),
|
||||
/**
|
||||
* 否(未删除)
|
||||
*/
|
||||
NO(0);
|
||||
|
||||
private int value;
|
||||
|
||||
YesNoEnum(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,8 @@ import com.czg.account.enums.HandoverAccountTypeEnum;
|
||||
import com.czg.account.service.*;
|
||||
import com.czg.account.vo.LoginVO;
|
||||
import com.czg.config.RedisCst;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.enums.PlatformTypeEnum;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.sa.MyStpLogic;
|
||||
import com.czg.sa.StpKit;
|
||||
@@ -108,7 +107,7 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||
if (sysUser == null) {
|
||||
throw new CzgException("登录账号不存在");
|
||||
}
|
||||
if ("WEB".equals(platType) && StatusEnum.DISABLE.value() == sysUser.getStatus()) {
|
||||
if ("WEB".equals(platType) && SystemConstants.OneZero.ZERO == sysUser.getStatus()) {
|
||||
throw new CzgException("账户未启用");
|
||||
}
|
||||
|
||||
@@ -204,8 +203,8 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||
Long headId = StpKit.USER.getHeadId();
|
||||
long shopId = StpKit.USER.getLoginIdAsLong();
|
||||
ShopInfo currentInfo = shopInfoService.getById(shopId);
|
||||
// if (headId != null && currentInfo.getIsHeadShop() != YesNoEnum.YES.value()) {
|
||||
if (currentInfo.getIsHeadShop() != YesNoEnum.YES.value()) {
|
||||
// if (headId != null && currentInfo.getIsHeadShop() != SystemConstants.OneZero.ONE) {
|
||||
if (currentInfo.getIsHeadShop() != SystemConstants.OneZero.ONE) {
|
||||
throw new CzgException("登录账号无权限切换");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.czg.account.service.HandoverRecordService;
|
||||
import com.czg.account.vo.HandoverCategoryListVo;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.account.vo.HandoverTotalVo;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.order.service.OrderInfoRpcService;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.mapper.HandoverRecordMapper;
|
||||
@@ -142,7 +142,7 @@ public class HandoverRecordServiceImpl extends ServiceImpl<HandoverRecordMapper,
|
||||
|
||||
@Override
|
||||
public void printHandoverReceipt(Long handoverRecordId, Integer isPrint) {
|
||||
if (isPrint == YesNoEnum.YES.value()) {
|
||||
if (isPrint == SystemConstants.OneZero.ONE) {
|
||||
orderInfoRpcService.sendHandoverReceiptPrintMsgToMq(handoverRecordId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.czg.account.entity.PadProductCategory;
|
||||
import com.czg.account.entity.PadProductCategoryDetail;
|
||||
import com.czg.account.entity.ShopProdCategory;
|
||||
import com.czg.account.service.*;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.entity.ProdSku;
|
||||
import com.czg.product.entity.Product;
|
||||
@@ -73,15 +73,15 @@ public class PadProdServiceImpl implements PadProdService {
|
||||
*/
|
||||
public Integer calcIsSaleTime(String days, LocalTime startTime, LocalTime endTime) {
|
||||
if (StrUtil.isBlank(days) || ObjUtil.isNull(startTime) || ObjUtil.isNull(endTime)) {
|
||||
return YesNoEnum.NO.value();
|
||||
return SystemConstants.OneZero.ZERO;
|
||||
}
|
||||
String today = getWeekDayEnName();
|
||||
List<String> dayList = StrUtil.split(days, ",");
|
||||
LocalTime now = LocalTime.now().withNano(0);
|
||||
if (CollUtil.contains(dayList, today) && now.isAfter(startTime) && now.isBefore(endTime)) {
|
||||
return YesNoEnum.YES.value();
|
||||
return SystemConstants.OneZero.ONE;
|
||||
}
|
||||
return YesNoEnum.NO.value();
|
||||
return SystemConstants.OneZero.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.account.dto.PictureClassifyDTO;
|
||||
import com.czg.account.entity.PictureClassify;
|
||||
import com.czg.account.service.PictureClassifyService;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.mapper.PictureClassifyMapper;
|
||||
@@ -37,10 +36,10 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
q.eq(PictureClassify::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(PictureClassify::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
q2.eq(PictureClassify::getIsSystem, SystemConstants.OneZero.ONE);
|
||||
});
|
||||
});
|
||||
queryWrapper.eq(PictureClassify::getIsDel, DeleteEnum.NORMAL.value());
|
||||
queryWrapper.eq(PictureClassify::getIsDel, SystemConstants.OneZero.ZERO);
|
||||
queryWrapper.orderBy(PictureClassify::getSort, true);
|
||||
queryWrapper.orderBy(PictureClassify::getId, false);
|
||||
return queryWrapper;
|
||||
@@ -60,7 +59,7 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
q.eq(PictureClassify::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(PictureClassify::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
q2.eq(PictureClassify::getIsSystem, SystemConstants.OneZero.ONE);
|
||||
});
|
||||
})
|
||||
);
|
||||
@@ -68,7 +67,7 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
throw new CzgException("图片分类已存在");
|
||||
}
|
||||
PictureClassify entity = BeanUtil.copyProperties(dto, PictureClassify.class);
|
||||
entity.setIsSystem(YesNoEnum.NO.value());
|
||||
entity.setIsSystem(SystemConstants.OneZero.ZERO);
|
||||
entity.setShopId(shopId);
|
||||
super.save(entity);
|
||||
}
|
||||
@@ -84,7 +83,7 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
q.eq(PictureClassify::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(PictureClassify::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
q2.eq(PictureClassify::getIsSystem, SystemConstants.OneZero.ONE);
|
||||
});
|
||||
})
|
||||
);
|
||||
@@ -92,7 +91,7 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
throw new CzgException("图片分类已存在");
|
||||
}
|
||||
PictureClassify entity = BeanUtil.copyProperties(dto, PictureClassify.class);
|
||||
entity.setIsSystem(YesNoEnum.NO.value());
|
||||
entity.setIsSystem(SystemConstants.OneZero.ZERO);
|
||||
super.updateById(entity);
|
||||
}
|
||||
|
||||
@@ -101,7 +100,7 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
checkPictureClassify(id);
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(PictureClassify.class)
|
||||
.set(PictureClassify::getIsDel, DeleteEnum.DELETED.value())
|
||||
.set(PictureClassify::getIsDel, SystemConstants.OneZero.ONE)
|
||||
.eq(PictureClassify::getShopId, shopId)
|
||||
.eq(PictureClassify::getId, id)
|
||||
.update();
|
||||
@@ -113,7 +112,7 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
if (entity == null) {
|
||||
throw new CzgException("图片分类不存在");
|
||||
}
|
||||
if (entity.getIsSystem() == YesNoEnum.YES.value()) {
|
||||
if (entity.getIsSystem() == SystemConstants.OneZero.ONE) {
|
||||
throw new CzgException("系统预设分类不可操作");
|
||||
}
|
||||
if (!shopId.equals(entity.getShopId())) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.czg.account.dto.PictureGalleryDTO;
|
||||
import com.czg.account.entity.PictureGallery;
|
||||
import com.czg.account.param.PictureGalleryParam;
|
||||
import com.czg.account.service.PictureGalleryService;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.mapper.PictureGalleryMapper;
|
||||
@@ -41,7 +41,7 @@ public class PictureGalleryServiceImpl extends ServiceImpl<PictureGalleryMapper,
|
||||
q1.eq(PictureGallery::getShopId, 1L);
|
||||
});
|
||||
});
|
||||
queryWrapper.eq(PictureGallery::getIsDel, DeleteEnum.NORMAL.value());
|
||||
queryWrapper.eq(PictureGallery::getIsDel, SystemConstants.OneZero.ZERO);
|
||||
queryWrapper.orderBy(PictureGallery::getId, false);
|
||||
return queryWrapper;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class PictureGalleryServiceImpl extends ServiceImpl<PictureGalleryMapper,
|
||||
throw new CzgException("公共图片不可操作");
|
||||
}
|
||||
UpdateChain.of(PictureGallery.class)
|
||||
.set(PictureGallery::getIsDel, DeleteEnum.DELETED.value())
|
||||
.set(PictureGallery::getIsDel, SystemConstants.OneZero.ONE)
|
||||
.eq(PictureGallery::getShopId, shopId)
|
||||
.eq(PictureGallery::getId, id)
|
||||
.update();
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.czg.account.enums.BranchDataSyncMethodEnum;
|
||||
import com.czg.account.enums.ShopTypeEnum;
|
||||
import com.czg.account.param.ShopBranchParam;
|
||||
import com.czg.account.service.ShopBranchService;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.service.ShopSyncService;
|
||||
import com.czg.sa.StpKit;
|
||||
@@ -65,7 +65,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
||||
if (ShopTypeEnum.ONLY.getValue().equals(shopInfo.getShopType())) {
|
||||
throw new CzgException("单店不支持设置数据同步方式");
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == YesNoEnum.NO.value()) {
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), SystemConstants.OneZero.ZERO) == SystemConstants.OneZero.ZERO) {
|
||||
throw new CzgException("非主店不能设置数据同步方式");
|
||||
}
|
||||
boolean contains = BranchDataSyncMethodEnum.checkValue(dataSyncMethod);
|
||||
@@ -90,7 +90,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
||||
if (ShopTypeEnum.ONLY.getValue().equals(shopInfo.getShopType())) {
|
||||
throw new CzgException("数据错误:主店铺类型为单店");
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == YesNoEnum.NO.value()) {
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == SystemConstants.OneZero.ZERO) {
|
||||
throw new CzgException("数据错误:当前店铺不是主店");
|
||||
}
|
||||
ShopInfo branchShop = shopInfoMapper.selectOneByQuery(QueryWrapper.create().eq(ShopInfo::getMainId, shopInfo.getId()).eq(ShopInfo::getId, branchShopId));
|
||||
@@ -101,9 +101,9 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
||||
throw new CzgException("数据错误:分店店铺类型错误");
|
||||
}
|
||||
ShopConfig branchConfig = shopConfigMapper.selectOneById(branchShop.getId());
|
||||
branchConfig.setIsEnableProdSync(YesNoEnum.YES.value());
|
||||
branchConfig.setIsEnableConsSync(YesNoEnum.YES.value());
|
||||
branchConfig.setIsEnableVipSync(YesNoEnum.YES.value());
|
||||
branchConfig.setIsEnableProdSync(SystemConstants.OneZero.ONE);
|
||||
branchConfig.setIsEnableConsSync(SystemConstants.OneZero.ONE);
|
||||
branchConfig.setIsEnableVipSync(SystemConstants.OneZero.ONE);
|
||||
shopConfigMapper.update(branchConfig);
|
||||
long sysUserId = StpKit.USER.getLoginIdAsLong();
|
||||
ThreadUtil.execAsync(() -> {
|
||||
@@ -129,7 +129,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
||||
if (ShopTypeEnum.ONLY.getValue().equals(shopInfo.getShopType())) {
|
||||
throw new CzgException("数据错误:主店铺类型为单店");
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == YesNoEnum.NO.value()) {
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == SystemConstants.OneZero.ZERO) {
|
||||
throw new CzgException("数据错误:当前店铺不是主店");
|
||||
}
|
||||
ShopInfo branchShop = shopInfoMapper.selectOneByQuery(QueryWrapper.create().eq(ShopInfo::getMainId, shopInfo.getId()).eq(ShopInfo::getId, branchShopId));
|
||||
@@ -140,7 +140,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
||||
throw new CzgException("数据错误:分店店铺类型错误");
|
||||
}
|
||||
ShopConfig branchConfig = shopConfigMapper.selectOneById(branchShop.getId());
|
||||
branchConfig.setIsAllowAccountLogin(YesNoEnum.YES.value());
|
||||
branchConfig.setIsAllowAccountLogin(SystemConstants.OneZero.ONE);
|
||||
shopConfigMapper.update(branchConfig);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
||||
if (ShopTypeEnum.ONLY.getValue().equals(shopInfo.getShopType())) {
|
||||
throw new CzgException("数据错误:主店铺类型为单店");
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == YesNoEnum.NO.value()) {
|
||||
if (ObjUtil.defaultIfNull(shopInfo.getIsHeadShop(), 0) == SystemConstants.OneZero.ZERO) {
|
||||
throw new CzgException("数据错误:当前店铺不是主店");
|
||||
}
|
||||
ShopInfo branchShop = shopInfoMapper.selectOneByQuery(QueryWrapper.create().eq(ShopInfo::getMainId, shopInfo.getId()).eq(ShopInfo::getId, branchShopId));
|
||||
@@ -169,7 +169,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
||||
throw new CzgException("数据错误:分店店铺类型错误");
|
||||
}
|
||||
ShopConfig branchConfig = shopConfigMapper.selectOneById(branchShop.getId());
|
||||
branchConfig.setIsAllowAccountLogin(YesNoEnum.NO.value());
|
||||
branchConfig.setIsAllowAccountLogin(SystemConstants.OneZero.ZERO);
|
||||
shopConfigMapper.update(branchConfig);
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public class ShopBranchServiceImpl implements ShopBranchService {
|
||||
if (shopConfig.getMainId() == null) {
|
||||
return true;
|
||||
}
|
||||
if (shopConfig.getIsAllowAccountLogin() == YesNoEnum.YES.value()) {
|
||||
if (shopConfig.getIsAllowAccountLogin() == SystemConstants.OneZero.ONE) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -13,9 +13,8 @@ import com.czg.account.enums.ShopTypeEnum;
|
||||
import com.czg.account.service.*;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.config.RedisCst;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.constants.ShopSwitchTypeEnum;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.MyStpLogic;
|
||||
@@ -103,7 +102,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
if (shopInfo.getExpireTime() != null && (DateUtil.date().toLocalDateTime().isAfter(shopInfo.getExpireTime()))) {
|
||||
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("店铺已停业,请联系商家");
|
||||
}
|
||||
|
||||
@@ -161,7 +160,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
public Boolean add(ShopInfoAddDTO shopInfoAddDTO) {
|
||||
// 如果店铺类型是单店,是否主店要设为否
|
||||
if (ShopTypeEnum.ONLY.getValue().equals(shopInfoAddDTO.getShopType())) {
|
||||
shopInfoAddDTO.setIsHeadShop(YesNoEnum.YES.value());
|
||||
shopInfoAddDTO.setIsHeadShop(SystemConstants.OneZero.ONE);
|
||||
if (shopInfoAddDTO.getMainId() != null) {
|
||||
throw new CzgException("单店不允许设置主店ID");
|
||||
}
|
||||
@@ -169,10 +168,10 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
if (shopInfoAddDTO.getIsHeadShop() == null) {
|
||||
throw new CzgException("加盟店/连锁店请选择是否主店");
|
||||
}
|
||||
if (shopInfoAddDTO.getIsHeadShop() == YesNoEnum.NO.value() && shopInfoAddDTO.getMainId() == null) {
|
||||
if (shopInfoAddDTO.getIsHeadShop() == SystemConstants.OneZero.ZERO && shopInfoAddDTO.getMainId() == null) {
|
||||
throw new CzgException("请选择一个店铺做为主店");
|
||||
}
|
||||
if (shopInfoAddDTO.getIsHeadShop() == YesNoEnum.YES.value()) {
|
||||
if (shopInfoAddDTO.getIsHeadShop() == SystemConstants.OneZero.ONE) {
|
||||
shopInfoAddDTO.setMainId(null);
|
||||
}
|
||||
}
|
||||
@@ -233,7 +232,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
shopConfig.setIsMemberPrice(0);
|
||||
shopConfig.setIsAccountPay(0);
|
||||
shopConfig.setBranchDataSyncMethod(null);
|
||||
if (dto.getIsHeadShop() == YesNoEnum.YES.value()) {
|
||||
if (dto.getIsHeadShop() == SystemConstants.OneZero.ONE) {
|
||||
shopConfig.setBranchDataSyncMethod(BranchDataSyncMethodEnum.AUTO.getValue());
|
||||
}
|
||||
shopConfigService.save(shopConfig);
|
||||
@@ -272,15 +271,15 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
if (shopInfoEditDTO.getIsHeadShop() == null) {
|
||||
throw new CzgException("加盟店/连锁店请选择是否主店");
|
||||
}
|
||||
if (shopInfoEditDTO.getIsHeadShop() == YesNoEnum.NO.value() && shopInfoEditDTO.getMainId() == null) {
|
||||
if (shopInfoEditDTO.getIsHeadShop() == SystemConstants.OneZero.ZERO && shopInfoEditDTO.getMainId() == null) {
|
||||
throw new CzgException("请选择一个店铺做为主店");
|
||||
}
|
||||
if (shopInfoEditDTO.getIsHeadShop() == YesNoEnum.YES.value()) {
|
||||
if (shopInfoEditDTO.getIsHeadShop() == SystemConstants.OneZero.ONE) {
|
||||
if (mainId != null) {
|
||||
throw new CzgException("数据错误:当前店铺是非主店,不允许随意切换为主店");
|
||||
}
|
||||
}
|
||||
if (isHeadShop == YesNoEnum.YES.value() && shopInfoEditDTO.getIsHeadShop() == YesNoEnum.NO.value()) {
|
||||
if (isHeadShop == SystemConstants.OneZero.ONE && shopInfoEditDTO.getIsHeadShop() == SystemConstants.OneZero.ZERO) {
|
||||
throw new CzgException("数据错误:当前店铺是主店,不允许随意切换为非主店");
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -10,12 +10,11 @@ import com.czg.account.dto.auth.WechatRawDataDTO;
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.account.service.UserAuthorizationService;
|
||||
import com.czg.account.service.UserInfoService;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.enums.UserAuthSourceEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.sa.MyStpLogic;
|
||||
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.WechatAuthUtil;
|
||||
import com.czg.system.enums.SysParamCodeEnum;
|
||||
@@ -25,7 +24,6 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
@@ -113,7 +111,7 @@ public class UserAuthorizationServiceImpl implements UserAuthorizationService {
|
||||
userInfo.setAlipayOpenId(openId);
|
||||
}
|
||||
|
||||
if (userInfo.getStatus() != null && StatusEnum.DISABLE.value() == userInfo.getStatus()) {
|
||||
if (userInfo.getStatus() != null && SystemConstants.OneZero.ZERO == userInfo.getStatus()) {
|
||||
throw new CzgException("账号已禁用");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.TimeQueryParam;
|
||||
import com.czg.account.entity.PictureClassify;
|
||||
import com.czg.account.entity.ShopInfo;
|
||||
import com.czg.account.service.ShopInfoService;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.market.dto.MkLimitTimeDiscountDTO;
|
||||
import com.czg.market.entity.MkLimitTimeDiscount;
|
||||
@@ -29,7 +26,6 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 限时折扣 服务层实现。
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.update.UpdateChain;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -35,6 +36,7 @@ import java.util.List;
|
||||
* @author gyj
|
||||
* @since 2025-12-18
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PpPackageServiceImpl extends ServiceImpl<PpPackageMapper, PpPackage> implements PpPackageService {
|
||||
|
||||
@@ -127,7 +129,7 @@ public class PpPackageServiceImpl extends ServiceImpl<PpPackageMapper, PpPackage
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean updateOnlineStatus(Long id, Integer onlineStatus) {
|
||||
if (!SystemConstants.OneZero.ZERO.equals(onlineStatus) && !SystemConstants.OneZero.ONE.equals(onlineStatus)) {
|
||||
if (SystemConstants.OneZero.ZERO != onlineStatus && SystemConstants.OneZero.ONE != onlineStatus) {
|
||||
throw new CzgException("参数错误");
|
||||
}
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
@@ -138,7 +140,7 @@ public class PpPackageServiceImpl extends ServiceImpl<PpPackageMapper, PpPackage
|
||||
throw new RuntimeException("无权限");
|
||||
}
|
||||
|
||||
if (SystemConstants.OneZero.ZERO.equals(onlineStatus)) {
|
||||
if (SystemConstants.OneZero.ZERO == onlineStatus) {
|
||||
cancelProgressingPackageOrder(StpKit.USER.getShopId(), id);
|
||||
}
|
||||
|
||||
@@ -152,7 +154,8 @@ public class PpPackageServiceImpl extends ServiceImpl<PpPackageMapper, PpPackage
|
||||
|
||||
// 如果没有开启操作,直接返回空数据
|
||||
ShopConfig shopConfig = shopConfigService.getById(shopId);
|
||||
if (SystemConstants.OneZero.ZERO.equals(shopConfig.getIsPackagePromotion())) {
|
||||
if (SystemConstants.OneZero.ZERO == shopConfig.getIsPackagePromotion()) {
|
||||
log.info("没有开启套餐推广");
|
||||
return new Page<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.order.dto.CreditBuyerDTO;
|
||||
import com.czg.order.dto.CreditBuyerOrderDTO;
|
||||
@@ -149,11 +149,11 @@ public class CreditBuyerOrderServiceImpl extends ServiceImpl<CreditBuyerOrderMap
|
||||
throw new CzgException("挂账人不存在");
|
||||
}
|
||||
Integer delFlag = creditBuyer.getIsDel();
|
||||
if (delFlag != null && delFlag == DeleteEnum.DELETED.value()) {
|
||||
if (delFlag != null && delFlag == SystemConstants.OneZero.ONE) {
|
||||
throw new CzgException("挂账人已删除");
|
||||
}
|
||||
Integer status = creditBuyer.getStatus();
|
||||
if (status != null && status == DeleteEnum.NORMAL.value()) {
|
||||
if (status != null && status == SystemConstants.OneZero.ZERO) {
|
||||
throw new CzgException("挂账人已被停用");
|
||||
}
|
||||
OrderInfo orderInfo = orderInfoMapper.selectOneById(orderId);
|
||||
|
||||
@@ -8,7 +8,7 @@ import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.order.dto.CreditBuyerDTO;
|
||||
import com.czg.order.dto.CreditBuyerOrderDTO;
|
||||
@@ -142,7 +142,7 @@ public class CreditBuyerServiceImpl extends ServiceImpl<CreditBuyerMapper, Credi
|
||||
public void deleteCreditBuyer(String id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(CreditBuyer.class)
|
||||
.set(CreditBuyer::getIsDel, DeleteEnum.DELETED.value())
|
||||
.set(CreditBuyer::getIsDel, SystemConstants.OneZero.ONE)
|
||||
.eq(CreditBuyer::getId, id)
|
||||
.eq(CreditBuyer::getShopId, shopId)
|
||||
.update();
|
||||
@@ -165,7 +165,7 @@ public class CreditBuyerServiceImpl extends ServiceImpl<CreditBuyerMapper, Credi
|
||||
throw new CzgException("挂账人不存在");
|
||||
}
|
||||
Integer isDel = dto.getIsDel();
|
||||
if (isDel == DeleteEnum.DELETED.value()) {
|
||||
if (isDel == SystemConstants.OneZero.ONE) {
|
||||
throw new CzgException("挂账人已删除");
|
||||
}
|
||||
if (!"total".equals(dto.getRepaymentMethod())) {
|
||||
|
||||
@@ -10,8 +10,8 @@ import com.czg.account.service.ShopInfoService;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.constant.MarketConstants;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.enums.OrderNoPrefixEnum;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.market.entity.GbWare;
|
||||
import com.czg.market.service.GbWareService;
|
||||
@@ -205,7 +205,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
||||
record.setPayAmount(param.getPrice());
|
||||
record.setStatus("待支付");
|
||||
record.setOrderNo(CzgRandomUtils.randomNumber(OrderNoPrefixEnum.GBO, 12, false));
|
||||
record.setIsDel(YesNoEnum.YES.value());
|
||||
record.setIsDel(SystemConstants.OneZero.ONE);
|
||||
detailService.save(record);
|
||||
param.setRecordId(record.getId());
|
||||
CzgResult<Map<String, Object>> result = CzgResult.success();
|
||||
@@ -223,7 +223,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
||||
@Override
|
||||
public boolean checkout(String verifyCode, Long shopId) {
|
||||
GbOrderDetail record = detailService.getOne(query()
|
||||
.eq(GbOrderDetail::getIsDel, YesNoEnum.NO.value())
|
||||
.eq(GbOrderDetail::getIsDel, SystemConstants.OneZero.ZERO)
|
||||
.eq(GbOrderDetail::getVerifyCode, verifyCode)
|
||||
.eq(GbOrderDetail::getShopId, shopId));
|
||||
if (record == null) {
|
||||
@@ -252,7 +252,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
||||
log.error("积分兑换商品发放失败,记录不存在");
|
||||
return;
|
||||
}
|
||||
record.setIsDel(YesNoEnum.NO.value());
|
||||
record.setIsDel(SystemConstants.OneZero.ZERO);
|
||||
record.setStatus("待成团");
|
||||
record.setPayOrderId(payOrderId);
|
||||
record.setPayTime(LocalDateTime.now());
|
||||
@@ -311,7 +311,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
||||
detailService.update(upRecord, query()
|
||||
.eq(GbOrderDetail::getGroupOrderNo, order.getGroupOrderNo())
|
||||
.eq(GbOrderDetail::getShopId, order.getShopId())
|
||||
.eq(GbOrderDetail::getIsDel, YesNoEnum.NO.value())
|
||||
.eq(GbOrderDetail::getIsDel, SystemConstants.OneZero.ZERO)
|
||||
.eq(GbOrderDetail::getStatus, "待成团")
|
||||
);
|
||||
//推送 拼团成功
|
||||
@@ -325,7 +325,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
||||
@Override
|
||||
public boolean applyRefund(CommonRefundDTO param, Long userId) {
|
||||
GbOrderDetail record = detailService.getOne(query()
|
||||
.eq(GbOrderDetail::getIsDel, YesNoEnum.NO.value())
|
||||
.eq(GbOrderDetail::getIsDel, SystemConstants.OneZero.ZERO)
|
||||
.eq(GbOrderDetail::getId, param.getRecordId())
|
||||
.eq(GbOrderDetail::getUserId, userId));
|
||||
AssertUtil.isNull(record, "记录不存在");
|
||||
@@ -352,7 +352,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
||||
public boolean cancelRefund(CommonRefundDTO param, Long userId, Long shopId) {
|
||||
GbOrderDetail record = detailService.getOne(query()
|
||||
.eq(GbOrderDetail::getId, param.getRecordId())
|
||||
.eq(GbOrderDetail::getIsDel, YesNoEnum.NO.value())
|
||||
.eq(GbOrderDetail::getIsDel, SystemConstants.OneZero.ZERO)
|
||||
.eq(GbOrderDetail::getUserId, userId));
|
||||
AssertUtil.isNull(record, "取消失败,订单不存在");
|
||||
if (!"退款中".equals(record.getStatus())) {
|
||||
@@ -387,7 +387,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
||||
@Override
|
||||
public boolean agreeRefund(CommonRefundDTO param, Long shopId) {
|
||||
GbOrderDetail record = detailService.getOne(QueryWrapper.create()
|
||||
.eq(GbOrderDetail::getIsDel, YesNoEnum.NO.value())
|
||||
.eq(GbOrderDetail::getIsDel, SystemConstants.OneZero.ZERO)
|
||||
.eq(GbOrderDetail::getId, param.getRecordId())
|
||||
.eq(GbOrderDetail::getShopId, shopId));
|
||||
AssertUtil.isNull(record, "退款失败,订单不存在");
|
||||
@@ -450,7 +450,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
||||
.eq(GbOrderDetail::getShopId, gbOrder.getShopId())
|
||||
.eq(GbOrderDetail::getGroupOrderNo, gbOrder.getGroupOrderNo())
|
||||
.ne(GbOrderDetail::getStatus, "已退款")
|
||||
.eq(GbOrderDetail::getIsDel, YesNoEnum.NO.value()));
|
||||
.eq(GbOrderDetail::getIsDel, SystemConstants.OneZero.ZERO));
|
||||
details.forEach(item -> FunUtils.safeRunVoid(() -> refundAmount(item, reason), "订单详情{}退款失败", item.getId()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.czg.service.product.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ConsGroupDTO;
|
||||
import com.czg.product.dto.ConsInfoDTO;
|
||||
@@ -56,7 +56,7 @@ public class ConsGroupServiceImpl extends ServiceImpl<ConsGroupMapper, ConsGroup
|
||||
@Override
|
||||
public List<ConsGroupDTO> getConsGroupList(ConsGroupDTO 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);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class ConsGroupServiceImpl extends ServiceImpl<ConsGroupMapper, ConsGroup
|
||||
public void disableConsGroup(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ConsGroup.class)
|
||||
.set(ConsGroup::getStatus, StatusEnum.DISABLE.value())
|
||||
.set(ConsGroup::getStatus, SystemConstants.OneZero.ZERO)
|
||||
.eq(ConsGroup::getId, id)
|
||||
.eq(ConsGroup::getShopId, shopId)
|
||||
.update();
|
||||
@@ -117,7 +117,7 @@ public class ConsGroupServiceImpl extends ServiceImpl<ConsGroupMapper, ConsGroup
|
||||
public void enableConsGroup(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ConsGroup.class)
|
||||
.set(ConsGroup::getStatus, StatusEnum.ENABLED.value())
|
||||
.set(ConsGroup::getStatus,SystemConstants.OneZero.ONE)
|
||||
.eq(ConsGroup::getId, id)
|
||||
.eq(ConsGroup::getShopId, shopId)
|
||||
.update();
|
||||
|
||||
@@ -3,10 +3,8 @@ package com.czg.service.product.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.account.service.SyncNoticeService;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.enums.CrudEnum;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ConsInfoDTO;
|
||||
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.spring.service.impl.ServiceImpl;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -51,9 +48,6 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
||||
private final ConsGroupMapper consGroupMapper;
|
||||
private final ConsStockFlowMapper consStockFlowMapper;
|
||||
|
||||
@DubboReference
|
||||
private SyncNoticeService syncNoticeService;
|
||||
|
||||
private QueryWrapper buildQueryWrapper(ConsInfoDTO param) {
|
||||
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
|
||||
if (ObjUtil.isNotNull(param.getConsGroupId())) {
|
||||
@@ -92,7 +86,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
||||
@Override
|
||||
public List<ConsInfoDTO> getConsInfoList(ConsInfoDTO 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<ConsGroup> consGroupList = consGroupMapper.selectListByQuery(QueryWrapper.create().eq(ConsGroup::getShopId, param.getShopId()));
|
||||
Map<Long, String> collect = consGroupList.stream().collect(Collectors.toMap(ConsGroup::getId, ConsGroup::getName));
|
||||
@@ -124,9 +118,9 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
||||
}
|
||||
ConsInfo entity = BeanUtil.copyProperties(dto, ConsInfo.class);
|
||||
entity.setStockNumber(BigDecimal.ZERO);
|
||||
entity.setStatus(StatusEnum.ENABLED.value());
|
||||
entity.setStatus(SystemConstants.OneZero.ONE);
|
||||
//entity.setConWarning(BigDecimal.ZERO);
|
||||
entity.setIsStock(YesNoEnum.NO.value());
|
||||
entity.setIsStock(SystemConstants.OneZero.ZERO);
|
||||
entity.setShopId(shopId);
|
||||
super.save(entity);
|
||||
dto.setId(entity.getId());
|
||||
@@ -158,7 +152,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
||||
public void disableConsInfo(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ConsInfo.class)
|
||||
.set(ConsInfo::getStatus, StatusEnum.DISABLE.value())
|
||||
.set(ConsInfo::getStatus, SystemConstants.OneZero.ZERO)
|
||||
.eq(ConsInfo::getId, id)
|
||||
.eq(ConsInfo::getShopId, shopId)
|
||||
.update();
|
||||
@@ -168,7 +162,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
||||
public void enableConsInfo(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ConsInfo.class)
|
||||
.set(ConsInfo::getStatus, StatusEnum.ENABLED.value())
|
||||
.set(ConsInfo::getStatus,SystemConstants.OneZero.ONE)
|
||||
.eq(ConsInfo::getId, id)
|
||||
.eq(ConsInfo::getShopId, shopId)
|
||||
.update();
|
||||
|
||||
@@ -6,7 +6,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.constant.CacheConstant;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ProdGroupDTO;
|
||||
import com.czg.product.dto.ProductBriefDTO;
|
||||
@@ -67,7 +67,7 @@ public class ProdGroupServiceImpl extends ServiceImpl<ProdGroupMapper, ProdGroup
|
||||
@Override
|
||||
public List<ProdGroupDTO> getProdGroupList(ProdGroupDTO 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);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class ProdGroupServiceImpl extends ServiceImpl<ProdGroupMapper, ProdGroup
|
||||
}
|
||||
ProdGroup entity = getById(dto.getId());
|
||||
BeanUtil.copyProperties(dto, entity, CopyOptions.create().setIgnoreNullValue(true));
|
||||
if (entity.getUseTime() == StatusEnum.DISABLE.value()) {
|
||||
if (entity.getUseTime() == SystemConstants.OneZero.ZERO) {
|
||||
entity.setSaleStartTime(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)
|
||||
public void disableProdGroup(Long shopId, Long id) {
|
||||
UpdateChain.of(ProdGroup.class)
|
||||
.set(ProdGroup::getStatus, StatusEnum.DISABLE.value())
|
||||
.set(ProdGroup::getStatus, SystemConstants.OneZero.ZERO)
|
||||
.eq(ProdGroup::getId, id)
|
||||
.eq(ProdGroup::getShopId, shopId)
|
||||
.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)
|
||||
public void enableProdGroup(Long shopId, Long id) {
|
||||
UpdateChain.of(ProdGroup.class)
|
||||
.set(ProdGroup::getStatus, StatusEnum.ENABLED.value())
|
||||
.set(ProdGroup::getStatus,SystemConstants.OneZero.ONE)
|
||||
.eq(ProdGroup::getId, id)
|
||||
.eq(ProdGroup::getShopId, shopId)
|
||||
.update();
|
||||
|
||||
@@ -8,7 +8,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.product.dto.ProductStockSubtractDTO;
|
||||
import com.czg.product.entity.*;
|
||||
import com.czg.product.enums.InOutItemEnum;
|
||||
@@ -78,7 +78,7 @@ public class ProductRpcServiceImpl implements ProductRpcService {
|
||||
continue;
|
||||
}
|
||||
// 商品未开启库存
|
||||
if (product.getIsStock() == YesNoEnum.NO.value()) {
|
||||
if (product.getIsStock() == SystemConstants.OneZero.ZERO) {
|
||||
continue;
|
||||
}
|
||||
productMapper.updateProductStockNum(dto.getProductId(), dto.getShopId(), "sub", dto.getNum());
|
||||
@@ -245,11 +245,11 @@ public class ProductRpcServiceImpl implements ProductRpcService {
|
||||
Product product = productMapper.selectOneById(dto.getProductId());
|
||||
log.info(">>>>>>>>>>>>>>>>>:入参2:{}", product.getName());
|
||||
// 商品是否允许退款退货时归还库存
|
||||
if (product.getIsRefundStock() == YesNoEnum.NO.value()) {
|
||||
if (SystemConstants.OneZero.ZERO == product.getIsRefundStock()) {
|
||||
continue;
|
||||
}
|
||||
// 商品未开启库存
|
||||
if (product.getIsStock() == YesNoEnum.NO.value()) {
|
||||
if (SystemConstants.OneZero.ZERO == product.getIsStock()) {
|
||||
continue;
|
||||
}
|
||||
log.info(">>>>>>>>>>>>>>>>>:入参3:{}", product.getName());
|
||||
|
||||
@@ -8,8 +8,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONWriter;
|
||||
import com.czg.constant.CacheConstant;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ProdConsRelationDTO;
|
||||
import com.czg.product.dto.ProdSkuDTO;
|
||||
@@ -104,12 +103,12 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
}
|
||||
if (StrUtil.isNotEmpty(param.getStatus())) {
|
||||
if (ProductSaleStatusEnum.SOLD_OUT.getValue().equals(param.getStatus())) {
|
||||
queryWrapper.eq(Product::getIsSoldStock, YesNoEnum.YES.value());
|
||||
queryWrapper.eq(Product::getIsSoldStock, SystemConstants.OneZero.ONE);
|
||||
} else if (ProductSaleStatusEnum.ON_SALE.getValue().equals(param.getStatus())) {
|
||||
queryWrapper.eq(Product::getIsSoldStock, YesNoEnum.NO.value());
|
||||
queryWrapper.eq(Product::getIsSale, YesNoEnum.YES.value());
|
||||
queryWrapper.eq(Product::getIsSoldStock, SystemConstants.OneZero.ZERO);
|
||||
queryWrapper.eq(Product::getIsSale, SystemConstants.OneZero.ONE);
|
||||
} else if (ProductSaleStatusEnum.OFF_SALE.getValue().equals(param.getStatus())) {
|
||||
queryWrapper.eq(Product::getIsSale, YesNoEnum.NO.value());
|
||||
queryWrapper.eq(Product::getIsSale, SystemConstants.OneZero.ZERO);
|
||||
}
|
||||
}
|
||||
if (param.getShopId() == null) {
|
||||
@@ -117,7 +116,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
param.setShopId(shopId);
|
||||
}
|
||||
queryWrapper.eq(Product::getShopId, param.getShopId());
|
||||
queryWrapper.eq(Product::getIsDel, DeleteEnum.NORMAL.value());
|
||||
queryWrapper.eq(Product::getIsDel, SystemConstants.OneZero.ZERO);
|
||||
queryWrapper.orderBy(Product::getIsSoldStock, true);
|
||||
queryWrapper.orderBy(Product::getIsSale, false);
|
||||
queryWrapper.orderBy(Product::getSort, false);
|
||||
@@ -141,7 +140,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
private void buildProductExtInfo(List<ProductDTO> records) {
|
||||
records.forEach(record -> {
|
||||
record.setIsSaleTime(calcIsSaleTime(record.getDays(), record.getStartTime(), record.getEndTime()));
|
||||
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query().eq(ProdSku::getProductId, record.getId()).eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value()), ProdSkuDTO.class);
|
||||
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query().eq(ProdSku::getProductId, record.getId()).eq(ProdSku::getIsDel, SystemConstants.OneZero.ZERO), ProdSkuDTO.class);
|
||||
if (CollUtil.isNotEmpty(skuList)) {
|
||||
Optional<BigDecimal> lowPriceIsPresent = skuList.stream().map(obj -> NumberUtil.nullToZero(obj.getSalePrice())).min(BigDecimal::compareTo);
|
||||
lowPriceIsPresent.ifPresent(record::setLowPrice);
|
||||
@@ -172,7 +171,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
@Override
|
||||
public List<ProductDTO> getProductList(ProductDTO param) {
|
||||
QueryWrapper queryWrapper = buildFullQueryWrapper(param);
|
||||
//queryWrapper.eq(Product::getIsSale, YesNoEnum.YES.value());
|
||||
//queryWrapper.eq(Product::getIsSale, SystemConstants.OneZero.ONE);
|
||||
List<ProductDTO> records = super.listAs(queryWrapper, ProductDTO.class);
|
||||
buildProductExtInfo(records);
|
||||
return records;
|
||||
@@ -274,15 +273,15 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
*/
|
||||
private Integer calcIsSaleTime(String days, LocalTime startTime, LocalTime endTime) {
|
||||
if (StrUtil.isBlank(days) || ObjUtil.isNull(startTime) || ObjUtil.isNull(endTime)) {
|
||||
return YesNoEnum.NO.value();
|
||||
return SystemConstants.OneZero.ZERO;
|
||||
}
|
||||
String today = getWeekDayEnName();
|
||||
List<String> dayList = StrUtil.split(days, ",");
|
||||
LocalTime now = LocalTime.now().withNano(0);
|
||||
if (CollUtil.contains(dayList, today) && now.isAfter(startTime) && now.isBefore(endTime)) {
|
||||
return YesNoEnum.YES.value();
|
||||
return SystemConstants.OneZero.ONE;
|
||||
}
|
||||
return YesNoEnum.NO.value();
|
||||
return SystemConstants.OneZero.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -307,7 +306,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query().eq(ProdSku::getProductId, id).eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value()), ProdSkuDTO.class);
|
||||
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query().eq(ProdSku::getProductId, id).eq(ProdSku::getIsDel, SystemConstants.OneZero.ZERO), ProdSkuDTO.class);
|
||||
dto.setSkuList(skuList);
|
||||
List<ProdConsRelationDTO> consList = prodConsRelationMapper.selectListByProdId(dto.getId());
|
||||
dto.setConsList(consList);
|
||||
@@ -319,7 +318,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
@CacheEvict(value = {CacheConstant.USER_CLIENT_HOTS_PRODUCT, CacheConstant.USER_CLIENT_GROUPS_PRODUCT}, key = "#dto.shopId", allEntries = true)
|
||||
public void addProduct(ProductDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
boolean exists = super.exists(query().eq(Product::getName, dto.getName()).eq(Product::getShopId, shopId).eq(Product::getIsDel, DeleteEnum.NORMAL.value()));
|
||||
boolean exists = super.exists(query().eq(Product::getName, dto.getName()).eq(Product::getShopId, shopId).eq(Product::getIsDel, SystemConstants.OneZero.ZERO));
|
||||
if (exists) {
|
||||
throw new CzgException("名称已存在");
|
||||
}
|
||||
@@ -335,7 +334,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
entity.setGroupSnap(groupSnap);
|
||||
}
|
||||
}
|
||||
entity.setIsDel(DeleteEnum.NORMAL.value());
|
||||
entity.setIsDel(SystemConstants.OneZero.ZERO);
|
||||
entity.setShopId(shopId);
|
||||
super.save(entity);
|
||||
dto.setId(entity.getId());
|
||||
@@ -349,14 +348,14 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
prodSku.setShopId(entity.getShopId());
|
||||
prodSku.setProductId(entity.getId());
|
||||
prodSku.setRealSalesNumber(BigDecimal.ZERO);
|
||||
prodSku.setIsPauseSale(YesNoEnum.NO.value());
|
||||
prodSku.setIsGrounding(YesNoEnum.YES.value());
|
||||
prodSku.setIsDel(DeleteEnum.NORMAL.value());
|
||||
prodSku.setIsPauseSale(SystemConstants.OneZero.ZERO);
|
||||
prodSku.setIsGrounding(SystemConstants.OneZero.ONE);
|
||||
prodSku.setIsDel(SystemConstants.OneZero.ZERO);
|
||||
prodSkuList.add(prodSku);
|
||||
}
|
||||
prodSkuMapper.insertBatch(prodSkuList);
|
||||
}
|
||||
if (entity.getIsStock() == YesNoEnum.NO.value()) {
|
||||
if (entity.getIsStock() == SystemConstants.OneZero.ZERO) {
|
||||
return;
|
||||
}
|
||||
// 记录商品库存流水
|
||||
@@ -382,7 +381,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
public void updateProduct(ProductDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
dto.setShopId(shopId);
|
||||
boolean exists = super.exists(query().eq(Product::getName, dto.getName()).eq(Product::getShopId, shopId).eq(Product::getIsDel, DeleteEnum.NORMAL.value()).ne(Product::getId, dto.getId()));
|
||||
boolean exists = super.exists(query().eq(Product::getName, dto.getName()).eq(Product::getShopId, shopId).eq(Product::getIsDel, SystemConstants.OneZero.ZERO).ne(Product::getId, dto.getId()));
|
||||
if (exists) {
|
||||
throw new CzgException("名称已存在");
|
||||
}
|
||||
@@ -400,7 +399,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
entity.setGroupSnap(JSON.toJSONString(dto.getProGroupVo(), JSONWriter.Feature.WriteMapNullValue));
|
||||
}
|
||||
}
|
||||
entity.setIsDel(DeleteEnum.NORMAL.value());
|
||||
entity.setIsDel(SystemConstants.OneZero.ZERO);
|
||||
entity.setShopId(shopId);
|
||||
if (!ProductTypeEnum.SKU.value().equals(entity.getType())) {
|
||||
UpdateChain.of(Product.class).set(Product::getSpecId, null).eq(Product::getId, dto.getId()).update();
|
||||
@@ -411,7 +410,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
if (!old.getCategoryId().equals(dto.getCategoryId())) {
|
||||
clearProductCache(entity.getCategoryId());
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(dto.getIsStock(), old.getIsStock()) == YesNoEnum.NO.value()) {
|
||||
if (ObjUtil.defaultIfNull(dto.getIsStock(), old.getIsStock()) == SystemConstants.OneZero.ZERO) {
|
||||
redisService.del(StrUtil.format(CacheConstant.SHOP_PRODUCT_STOCK, shopId, dto.getId()));
|
||||
Boolean b = redisService.hasKey(StrUtil.format(CacheConstant.SHOP_PRODUCT_STOCK, shopId, dto.getId()));
|
||||
log.info("删除商品库存缓存:{}-{}", dto.getId(), b);
|
||||
@@ -430,9 +429,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
prodSku.setShopId(entity.getShopId());
|
||||
prodSku.setProductId(entity.getId());
|
||||
prodSku.setRealSalesNumber(BigDecimal.ZERO);
|
||||
prodSku.setIsPauseSale(YesNoEnum.NO.value());
|
||||
prodSku.setIsGrounding(YesNoEnum.YES.value());
|
||||
prodSku.setIsDel(DeleteEnum.NORMAL.value());
|
||||
prodSku.setIsPauseSale(SystemConstants.OneZero.ZERO);
|
||||
prodSku.setIsGrounding(SystemConstants.OneZero.ONE);
|
||||
prodSku.setIsDel(SystemConstants.OneZero.ZERO);
|
||||
prodSkuMapper.insert(prodSku);
|
||||
} else {
|
||||
prodSkuMapper.update(prodSku);
|
||||
@@ -445,12 +444,12 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
if (CollUtil.isNotEmpty(skuIdList)) {
|
||||
// 逻辑删除无用的SKU数据
|
||||
UpdateChain.of(ProdSku.class)
|
||||
.set(ProdSku::getIsDel, DeleteEnum.DELETED.value())
|
||||
.set(ProdSku::getIsDel, SystemConstants.OneZero.ONE)
|
||||
.in(ProdSku::getId, skuIdList)
|
||||
.eq(ProdSku::getShopId, shopId)
|
||||
.update();
|
||||
}
|
||||
if (entity.getIsStock() == YesNoEnum.NO.value()) {
|
||||
if (entity.getIsStock() == SystemConstants.OneZero.ZERO) {
|
||||
return;
|
||||
}
|
||||
// 记录商品库存流水
|
||||
@@ -488,7 +487,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateProductStock(ProductModifyStockParam param) {
|
||||
Product entity = super.getById(param.getId());
|
||||
if (entity.getIsStock() == YesNoEnum.NO.value()) {
|
||||
if (entity.getIsStock() == SystemConstants.OneZero.ZERO) {
|
||||
throw new CzgException("该商品未开启库存管理,暂不支持修改库存");
|
||||
}
|
||||
if (!entity.getShopId().equals(param.getShopId())) {
|
||||
@@ -537,7 +536,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
Product old = getById(id);
|
||||
Long categoryId = old.getCategoryId();
|
||||
UpdateChain.of(Product.class)
|
||||
.set(Product::getIsDel, DeleteEnum.DELETED.value())
|
||||
.set(Product::getIsDel, SystemConstants.OneZero.ONE)
|
||||
.eq(Product::getId, id)
|
||||
.eq(Product::getShopId, shopId)
|
||||
.update();
|
||||
@@ -571,8 +570,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
prodSkuMapper.update(prodSku);
|
||||
long normalCount = prodSkuMapper.selectCountByQuery(QueryWrapper.create()
|
||||
.eq(ProdSku::getProductId, prodSku.getProductId())
|
||||
.eq(ProdSku::getIsGrounding, YesNoEnum.NO.value())
|
||||
.eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value())
|
||||
.eq(ProdSku::getIsGrounding, SystemConstants.OneZero.ZERO)
|
||||
.eq(ProdSku::getIsDel, SystemConstants.OneZero.ZERO)
|
||||
);
|
||||
if (normalCount == 0) {
|
||||
UpdateChain.of(Product.class)
|
||||
@@ -625,8 +624,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
prodSkuMapper.update(prodSku);
|
||||
long normalCount = prodSkuMapper.selectCountByQuery(QueryWrapper.create()
|
||||
.eq(ProdSku::getProductId, prodSku.getProductId())
|
||||
.eq(ProdSku::getIsPauseSale, YesNoEnum.NO.value())
|
||||
.eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value())
|
||||
.eq(ProdSku::getIsPauseSale, SystemConstants.OneZero.ZERO)
|
||||
.eq(ProdSku::getIsDel, SystemConstants.OneZero.ZERO)
|
||||
);
|
||||
if (normalCount == 0) {
|
||||
UpdateChain.of(Product.class)
|
||||
@@ -685,7 +684,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
if (product == null) {
|
||||
throw new CzgException("商品不存在");
|
||||
}
|
||||
if (product.getIsStock() == YesNoEnum.NO.value()) {
|
||||
if (product.getIsStock() == SystemConstants.OneZero.ZERO) {
|
||||
throw new CzgException("商品未开启库存不支持报损操作");
|
||||
}
|
||||
// 商品现有库存数量
|
||||
@@ -761,7 +760,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
if (InOutItemEnum.ORDER_IN.value().equals(param.getInOutItem())) {
|
||||
param.setInOutType(InOutTypeEnum.OUT.value());
|
||||
param.setInOutItem(InOutItemEnum.ORDER_OUT.value());
|
||||
param.setIsGreaterZero(YesNoEnum.YES.value());
|
||||
param.setIsGreaterZero(SystemConstants.OneZero.ONE);
|
||||
}
|
||||
return PageUtil.convert(new PageInfo<>(productStockFlowMapper.getProductStockFlowList(param)));
|
||||
}
|
||||
@@ -777,7 +776,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
Map<Long, Integer> stock = list.stream().collect(Collectors.toMap(Product::getId, Product::getStockNumber));
|
||||
records.parallelStream().forEach(record -> {
|
||||
record.setStockNumber(stock.getOrDefault(record.getId(), 0));
|
||||
if (record.getIsStock() == YesNoEnum.YES.value()) {
|
||||
if (record.getIsStock() == SystemConstants.OneZero.ONE) {
|
||||
refreshRedisStock(record.getShopId(), record.getId(), record.getStockNumber());
|
||||
} else {
|
||||
redisService.del(StrUtil.format(CacheConstant.SHOP_PRODUCT_STOCK, record.getShopId(), record.getId()));
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.czg.service.product.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ShopProdCategoryDTO;
|
||||
import com.czg.product.entity.ShopProdCategory;
|
||||
@@ -58,7 +58,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
||||
@Override
|
||||
public List<ShopProdCategoryDTO> getShopProdCategoryList(ShopProdCategoryDTO 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);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
||||
// 简称
|
||||
entity.setShortName(dto.getName());
|
||||
if (entity.getStatus() == null) {
|
||||
entity.setStatus(StatusEnum.ENABLED.value());
|
||||
entity.setStatus(SystemConstants.OneZero.ONE);
|
||||
}
|
||||
entity.setPid(0L);
|
||||
entity.setShopId(shopId);
|
||||
@@ -111,7 +111,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
||||
public void disableShopProdCategory(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ShopProdCategory.class)
|
||||
.set(ShopProdCategory::getStatus, StatusEnum.DISABLE.value())
|
||||
.set(ShopProdCategory::getStatus, SystemConstants.OneZero.ZERO)
|
||||
.eq(ShopProdCategory::getId, id)
|
||||
.eq(ShopProdCategory::getShopId, shopId)
|
||||
.update();
|
||||
@@ -122,7 +122,7 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
||||
public void enableShopProdCategory(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ShopProdCategory.class)
|
||||
.set(ShopProdCategory::getStatus, StatusEnum.ENABLED.value())
|
||||
.set(ShopProdCategory::getStatus,SystemConstants.OneZero.ONE)
|
||||
.eq(ShopProdCategory::getId, id)
|
||||
.eq(ShopProdCategory::getShopId, shopId)
|
||||
.update();
|
||||
|
||||
@@ -2,8 +2,7 @@ package com.czg.service.product.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ShopProdUnitDTO;
|
||||
import com.czg.product.entity.ShopProdUnit;
|
||||
@@ -40,7 +39,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
q.eq(ShopProdUnit::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(ShopProdUnit::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
q2.eq(ShopProdUnit::getIsSystem, SystemConstants.OneZero.ONE);
|
||||
});
|
||||
});
|
||||
queryWrapper.orderBy(ShopProdUnit::getId, false);
|
||||
@@ -56,7 +55,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
@Override
|
||||
public List<ShopProdUnitDTO> getShopProdUnitList(ShopProdUnitDTO 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);
|
||||
}
|
||||
|
||||
@@ -74,7 +73,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
q.eq(ShopProdUnit::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(ShopProdUnit::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
q2.eq(ShopProdUnit::getIsSystem, SystemConstants.OneZero.ONE);
|
||||
});
|
||||
}));
|
||||
if (exists) {
|
||||
@@ -84,8 +83,8 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
// 单位类型 number-计数 weight-记重
|
||||
entity.setUnitType(UnitTypeEnum.NUMBER.value());
|
||||
// 单位来源 1-系统预设 0-商家创建
|
||||
entity.setIsSystem(YesNoEnum.NO.value());
|
||||
entity.setStatus(StatusEnum.ENABLED.value());
|
||||
entity.setIsSystem(SystemConstants.OneZero.ZERO);
|
||||
entity.setStatus(SystemConstants.OneZero.ONE);
|
||||
entity.setShopId(shopId);
|
||||
super.save(entity);
|
||||
return entity.getId();
|
||||
@@ -102,7 +101,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
q.eq(ShopProdUnit::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(ShopProdUnit::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
q2.eq(ShopProdUnit::getIsSystem, SystemConstants.OneZero.ONE);
|
||||
});
|
||||
})
|
||||
);
|
||||
@@ -125,7 +124,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
checkShopProdUnit(id);
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ShopProdUnit.class)
|
||||
.set(ShopProdUnit::getStatus, StatusEnum.DISABLE.value())
|
||||
.set(ShopProdUnit::getStatus, SystemConstants.OneZero.ZERO)
|
||||
.eq(ShopProdUnit::getId, id)
|
||||
.eq(ShopProdUnit::getShopId, shopId)
|
||||
.update();
|
||||
@@ -136,7 +135,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
checkShopProdUnit(id);
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ShopProdUnit.class)
|
||||
.set(ShopProdUnit::getStatus, StatusEnum.ENABLED.value())
|
||||
.set(ShopProdUnit::getStatus,SystemConstants.OneZero.ONE)
|
||||
.eq(ShopProdUnit::getId, id)
|
||||
.eq(ShopProdUnit::getShopId, shopId)
|
||||
.update();
|
||||
@@ -148,7 +147,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
if (entity == null) {
|
||||
throw new CzgException("单位信息不存在");
|
||||
}
|
||||
if (entity.getIsSystem() == YesNoEnum.YES.value()) {
|
||||
if (SystemConstants.OneZero.ONE == entity.getIsSystem()) {
|
||||
throw new CzgException("系统预设单位不可操作");
|
||||
}
|
||||
if (!shopId.equals(entity.getShopId())) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.constant.GlobalConstant;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ShopProdSpecDTO;
|
||||
import com.czg.product.entity.ShopProdSpec;
|
||||
@@ -70,7 +70,7 @@ public class ShopProductSpecServiceImpl extends ServiceImpl<ShopProdSpecMapper,
|
||||
@Override
|
||||
public List<ShopProdSpecDTO> getShopProdSpecList(ShopProdSpecDTO 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);
|
||||
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();
|
||||
entity.setPids(pids + entity.getPid() + ",");
|
||||
}
|
||||
entity.setStatus(StatusEnum.ENABLED.value());
|
||||
entity.setStatus(SystemConstants.OneZero.ONE);
|
||||
entity.setShopId(shopId);
|
||||
super.save(entity);
|
||||
dto.setId(entity.getId());
|
||||
@@ -163,7 +163,7 @@ public class ShopProductSpecServiceImpl extends ServiceImpl<ShopProdSpecMapper,
|
||||
public void disableShopProdSpec(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
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)
|
||||
.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) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
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)
|
||||
.and(SHOP_PROD_SPEC.ID.eq(id).or(SHOP_PROD_SPEC.PIDS.like("," + id + ",")))).update();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.czg.service.product.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ShopVendorBillPayDTO;
|
||||
import com.czg.product.dto.ShopVendorDTO;
|
||||
@@ -56,7 +56,7 @@ public class ShopVendorServiceImpl extends ServiceImpl<ShopVendorMapper, ShopVen
|
||||
}
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
queryWrapper.eq(ShopVendor::getShopId, shopId);
|
||||
queryWrapper.eq(ShopVendor::getIsDel, DeleteEnum.NORMAL.value());
|
||||
queryWrapper.eq(ShopVendor::getIsDel, SystemConstants.OneZero.ZERO);
|
||||
queryWrapper.orderBy(ShopVendor::getSort, true);
|
||||
queryWrapper.orderBy(ShopVendor::getId, false);
|
||||
return queryWrapper;
|
||||
@@ -88,7 +88,7 @@ public class ShopVendorServiceImpl extends ServiceImpl<ShopVendorMapper, ShopVen
|
||||
throw new CzgException("供应商已存在");
|
||||
}
|
||||
ShopVendor entity = BeanUtil.copyProperties(dto, ShopVendor.class);
|
||||
entity.setIsDel(DeleteEnum.NORMAL.value());
|
||||
entity.setIsDel(SystemConstants.OneZero.ZERO);
|
||||
entity.setShopId(shopId);
|
||||
super.save(entity);
|
||||
dto.setId(entity.getId());
|
||||
@@ -110,7 +110,7 @@ public class ShopVendorServiceImpl extends ServiceImpl<ShopVendorMapper, ShopVen
|
||||
public void deleteShopVendor(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
UpdateChain.of(ShopVendor.class)
|
||||
.set(ShopVendor::getIsDel, DeleteEnum.DELETED.value())
|
||||
.set(ShopVendor::getIsDel, SystemConstants.OneZero.ONE)
|
||||
.eq(ShopVendor::getId, id)
|
||||
.eq(ShopVendor::getShopId, shopId)
|
||||
.update();
|
||||
|
||||
@@ -7,9 +7,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.constant.CacheConstant;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.enums.StatusEnum;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.product.dto.ProdGroupRelationDTO;
|
||||
import com.czg.product.dto.ProdSkuDTO;
|
||||
@@ -66,8 +64,8 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
||||
list.forEach(item -> {
|
||||
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query()
|
||||
.eq(ProdSku::getProductId, item.getId())
|
||||
.eq(ProdSku::getIsGrounding, YesNoEnum.YES.value())
|
||||
.eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value()), ProdSkuDTO.class);
|
||||
.eq(ProdSku::getIsGrounding, SystemConstants.OneZero.ONE)
|
||||
.eq(ProdSku::getIsDel, SystemConstants.OneZero.ZERO), ProdSkuDTO.class);
|
||||
item.setSkuList(skuList);
|
||||
});
|
||||
return list;
|
||||
@@ -78,14 +76,14 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
||||
public List<ShopGroupProductVo> queryGroupProductList(Long shopId) {
|
||||
List<ShopGroupProductVo> groupList = prodGroupMapper.selectListByQueryAs(
|
||||
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);
|
||||
List<ShopProductVo> productAllList = productMapper.selectGroupProductList(shopId);
|
||||
productAllList.forEach(item -> {
|
||||
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query()
|
||||
.eq(ProdSku::getProductId, item.getId())
|
||||
.eq(ProdSku::getIsGrounding, YesNoEnum.YES.value())
|
||||
.eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value()), ProdSkuDTO.class);
|
||||
.eq(ProdSku::getIsGrounding, SystemConstants.OneZero.ONE)
|
||||
.eq(ProdSku::getIsDel, SystemConstants.OneZero.ZERO), ProdSkuDTO.class);
|
||||
item.setSkuList(skuList);
|
||||
});
|
||||
Map<Long, ShopProductVo> productKv = productAllList.stream().collect(Collectors.toMap(ShopProductVo::getId, shopProductVo -> shopProductVo));
|
||||
@@ -146,8 +144,8 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
||||
ShopProductSkuInfoVo data = prodSkuMapper.selectOneByQueryAs(
|
||||
query().eq(ProdSku::getProductId, param.getId())
|
||||
.eq(ProdSku::getShopId, shopId)
|
||||
.eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value())
|
||||
.eq(ProdSku::getIsGrounding, YesNoEnum.YES.value())
|
||||
.eq(ProdSku::getIsDel, SystemConstants.OneZero.ZERO)
|
||||
.eq(ProdSku::getIsGrounding, SystemConstants.OneZero.ONE)
|
||||
.eq(ProdSku::getSpecInfo, specInfo)
|
||||
, ShopProductSkuInfoVo.class);
|
||||
// throw new CzgException("商品SKU不可售或不存在");
|
||||
@@ -189,7 +187,7 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
||||
}
|
||||
productList.parallelStream().forEach(record -> {
|
||||
record.setStockNumber(productStock.getOrDefault(record.getId(), 0));
|
||||
if (record.getIsStock() == YesNoEnum.YES.value()) {
|
||||
if (record.getIsStock() == SystemConstants.OneZero.ONE) {
|
||||
refreshRedisStock(record.getShopId(), record.getId(), record.getStockNumber());
|
||||
} else {
|
||||
redisService.del(StrUtil.format(CacheConstant.SHOP_PRODUCT_STOCK, record.getShopId(), record.getId()));
|
||||
@@ -213,7 +211,7 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
||||
@Override
|
||||
public Integer calcIsSaleTime(String days, LocalTime startTime, LocalTime endTime) {
|
||||
if (StrUtil.isBlank(days) || ObjUtil.isNull(startTime) || ObjUtil.isNull(endTime)) {
|
||||
return YesNoEnum.NO.value();
|
||||
return SystemConstants.OneZero.ZERO;
|
||||
}
|
||||
String today = getWeekDayEnName();
|
||||
List<String> dayList = StrUtil.split(days, ",");
|
||||
@@ -230,9 +228,9 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
||||
}
|
||||
}
|
||||
if(isSaleTime && inDays){
|
||||
return YesNoEnum.YES.value();
|
||||
return SystemConstants.OneZero.ONE;
|
||||
}
|
||||
return YesNoEnum.NO.value();
|
||||
return SystemConstants.OneZero.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,19 +247,19 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
||||
return prodIsSaleTime;
|
||||
}
|
||||
if (ObjUtil.isNull(startTime) || ObjUtil.isNull(endTime)) {
|
||||
return YesNoEnum.NO.value();
|
||||
return SystemConstants.OneZero.ZERO;
|
||||
}
|
||||
LocalTime now = LocalTime.now().withNano(0);
|
||||
if (startTime.isBefore(endTime)) {
|
||||
if (now.isAfter(startTime) && now.isBefore(endTime)) {
|
||||
return YesNoEnum.YES.value();
|
||||
return SystemConstants.OneZero.ONE;
|
||||
}
|
||||
} else {
|
||||
if (now.isAfter(startTime) || now.isBefore(endTime)) {
|
||||
return YesNoEnum.YES.value();
|
||||
return SystemConstants.OneZero.ONE;
|
||||
}
|
||||
}
|
||||
return YesNoEnum.NO.value();
|
||||
return SystemConstants.OneZero.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user