库存警戒值
This commit is contained in:
@@ -19,9 +19,9 @@ import cn.ysk.cashier.system.domain.Dept;
|
|||||||
import cn.ysk.cashier.system.domain.Job;
|
import cn.ysk.cashier.system.domain.Job;
|
||||||
import cn.ysk.cashier.system.domain.Role;
|
import cn.ysk.cashier.system.domain.Role;
|
||||||
import cn.ysk.cashier.system.domain.User;
|
import cn.ysk.cashier.system.domain.User;
|
||||||
//import cn.ysk.cashier.system.enums.ParamsEnum;
|
import cn.ysk.cashier.system.enums.ParamsEnum;
|
||||||
import cn.ysk.cashier.system.repository.UserRepository;
|
import cn.ysk.cashier.system.repository.UserRepository;
|
||||||
//import cn.ysk.cashier.system.service.ParamsService;
|
import cn.ysk.cashier.system.service.ParamsService;
|
||||||
import cn.ysk.cashier.system.service.UserService;
|
import cn.ysk.cashier.system.service.UserService;
|
||||||
import cn.ysk.cashier.utils.*;
|
import cn.ysk.cashier.utils.*;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -62,7 +62,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
|||||||
|
|
||||||
private final UserCacheManager userCacheManager;
|
private final UserCacheManager userCacheManager;
|
||||||
private final TokenProvider tokenProvider;
|
private final TokenProvider tokenProvider;
|
||||||
// private final ParamsService paramsService;
|
private final ParamsService paramsService;
|
||||||
|
|
||||||
private final TbMerchantRegisterRepository merchantRegisterRepository;
|
private final TbMerchantRegisterRepository merchantRegisterRepository;
|
||||||
|
|
||||||
@@ -97,8 +97,8 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
|||||||
tbShopInfo.setSmallQrcode(smallQrcode);
|
tbShopInfo.setSmallQrcode(smallQrcode);
|
||||||
tbShopInfoRepository.save(tbShopInfo);
|
tbShopInfoRepository.save(tbShopInfo);
|
||||||
}
|
}
|
||||||
// String baseUrl = paramsService.getValue(ParamsEnum.SHOP_ORDER_PAY_BASE_URL.name());
|
String baseUrl = paramsService.getValue(ParamsEnum.SHOP_ORDER_PAY_BASE_URL.name());
|
||||||
// tbShopInfo.setPaymentQrcode(baseUrl+"?shopId="+id);
|
tbShopInfo.setPaymentQrcode(baseUrl+"?shopId="+id);
|
||||||
ValidationUtil.isNull(tbShopInfo.getId(),"TbShopInfo","id",id);
|
ValidationUtil.isNull(tbShopInfo.getId(),"TbShopInfo","id",id);
|
||||||
return tbShopInfoMapper.toDto(tbShopInfo);
|
return tbShopInfoMapper.toDto(tbShopInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -922,7 +922,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
*/
|
*/
|
||||||
private void checkWarnLineAndSendMsg(TbProductSku productSku, TbProduct product, Integer shopId, Integer num) {
|
private void checkWarnLineAndSendMsg(TbProductSku productSku, TbProduct product, Integer shopId, Integer num) {
|
||||||
TbShopInfo shopInfo = shopInfoRepository.getById(shopId);
|
TbShopInfo shopInfo = shopInfoRepository.getById(shopId);
|
||||||
if (productSku.getWarnLine() == null) {
|
if (product.getWarnLine() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -930,20 +930,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (productSku.getStockNumber() == null) {
|
|
||||||
productSku.setStockNumber((double) 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (product.getStockNumber() == null) {
|
if (product.getStockNumber() == null) {
|
||||||
product.setStockNumber(0);
|
product.setStockNumber(0);
|
||||||
}
|
}
|
||||||
if (
|
if (product.getStockNumber() - num <= product.getWarnLine()) {
|
||||||
(product.getIsDistribute() == 1 && product.getStockNumber() - num <= productSku.getWarnLine())
|
|
||||||
|| (product.getIsDistribute() != 1) && productSku.getStockNumber() - num <= productSku.getWarnLine()
|
|
||||||
) {
|
|
||||||
|
|
||||||
wxMsgUtils.aboardStockMsg(shopInfo.getShopName(), shopId, product.getName(),
|
wxMsgUtils.aboardStockMsg(shopInfo.getShopName(), shopId, product.getName(),
|
||||||
product.getIsDistribute() == 1 ? product.getStockNumber() - num : (int) (productSku.getStockNumber() - num));
|
product.getStockNumber() - num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user