库存警戒值
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.Role;
|
||||
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.service.ParamsService;
|
||||
import cn.ysk.cashier.system.service.ParamsService;
|
||||
import cn.ysk.cashier.system.service.UserService;
|
||||
import cn.ysk.cashier.utils.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -62,7 +62,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
||||
|
||||
private final UserCacheManager userCacheManager;
|
||||
private final TokenProvider tokenProvider;
|
||||
// private final ParamsService paramsService;
|
||||
private final ParamsService paramsService;
|
||||
|
||||
private final TbMerchantRegisterRepository merchantRegisterRepository;
|
||||
|
||||
@@ -97,8 +97,8 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
||||
tbShopInfo.setSmallQrcode(smallQrcode);
|
||||
tbShopInfoRepository.save(tbShopInfo);
|
||||
}
|
||||
// String baseUrl = paramsService.getValue(ParamsEnum.SHOP_ORDER_PAY_BASE_URL.name());
|
||||
// tbShopInfo.setPaymentQrcode(baseUrl+"?shopId="+id);
|
||||
String baseUrl = paramsService.getValue(ParamsEnum.SHOP_ORDER_PAY_BASE_URL.name());
|
||||
tbShopInfo.setPaymentQrcode(baseUrl+"?shopId="+id);
|
||||
ValidationUtil.isNull(tbShopInfo.getId(),"TbShopInfo","id",id);
|
||||
return tbShopInfoMapper.toDto(tbShopInfo);
|
||||
}
|
||||
|
||||
@@ -922,7 +922,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
*/
|
||||
private void checkWarnLineAndSendMsg(TbProductSku productSku, TbProduct product, Integer shopId, Integer num) {
|
||||
TbShopInfo shopInfo = shopInfoRepository.getById(shopId);
|
||||
if (productSku.getWarnLine() == null) {
|
||||
if (product.getWarnLine() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -930,20 +930,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
return;
|
||||
}
|
||||
|
||||
if (productSku.getStockNumber() == null) {
|
||||
productSku.setStockNumber((double) 0);
|
||||
}
|
||||
|
||||
if (product.getStockNumber() == null) {
|
||||
product.setStockNumber(0);
|
||||
}
|
||||
if (
|
||||
(product.getIsDistribute() == 1 && product.getStockNumber() - num <= productSku.getWarnLine())
|
||||
|| (product.getIsDistribute() != 1) && productSku.getStockNumber() - num <= productSku.getWarnLine()
|
||||
) {
|
||||
|
||||
if (product.getStockNumber() - num <= product.getWarnLine()) {
|
||||
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