1.数据报表销量导出修改

2.开启关闭库存分组微信提醒
3.盘点出入库展示规格名称
This commit is contained in:
2024-08-02 16:11:23 +08:00
parent 6cc0da2ed0
commit 49ec7ab65d
16 changed files with 429 additions and 24 deletions

View File

@@ -467,7 +467,7 @@ public class SummaryServiceImpl implements SummaryService {
});
}
FileUtil.downloadExcelAndMerge(list, 12, response, mergeRowIndex);
FileUtil.downloadExcelAndMerge(list, 10, response, mergeRowIndex);
}
@Override

View File

@@ -17,10 +17,7 @@ import cn.ysk.cashier.repository.shop.TbShopUnitRepository;
import cn.ysk.cashier.service.TbProductStockOperateService;
import cn.ysk.cashier.service.product.StockService;
import cn.ysk.cashier.service.product.TbProductService;
import cn.ysk.cashier.utils.CacheKey;
import cn.ysk.cashier.utils.FileUtil;
import cn.ysk.cashier.utils.RedisUtils;
import cn.ysk.cashier.utils.StringUtils;
import cn.ysk.cashier.utils.*;
import cn.ysk.cashier.vo.StockUpdateValueVO;
import cn.ysk.cashier.vo.StockUpdateWarnLineVO;
import cn.ysk.cashier.vo.StockV2Vo;
@@ -62,6 +59,7 @@ public class StockServiceImpl implements StockService {
private final TbShopUnitRepository shopUnitRepository;
private final TbProductStockDetailRepository tbProductStockDetailRepository;
private final TbProductRepository tbProductRepository;
private final WxMsgUtils wxMsgUtils;
@PersistenceContext
private EntityManager em;
@@ -349,6 +347,15 @@ public class StockServiceImpl implements StockService {
Query nativeQuery = em.createNativeQuery(String.valueOf(sqlQuery));
nativeQuery.executeUpdate();
TbProduct product = tbProductRepository.selectBySkuId(Integer.valueOf(updateValueVO.getTargetId()));
TbProductSku tbProductSku = tbProductSkuRepository.findById(Integer.valueOf(updateValueVO.getTargetId())).orElse(null);
// 推送微信操作消息
if (product != null && tbProductSku != null) {
wxMsgUtils.aboardOperationMsg(("0".equals(updateValueVO.getUpdateValue()) ? "关闭sku售罄: " : "开启sku售罄: ") + product.getName() + "/"+ tbProductSku.getSpecSnap());
}else {
log.warn("推送微信操作消息失败未查询到商品信息skuId: {}", updateValueVO.getTargetId());
}
return;
case "stock":
sqlQuery.append(" set is_stock = ").append(updateValueVO.getUpdateValue());
@@ -358,6 +365,13 @@ public class StockServiceImpl implements StockService {
break;
case "pauseSale":
sqlQuery.append(" set is_pause_sale = ").append(updateValueVO.getUpdateValue());
TbProduct product1 = tbProductRepository.selectBySkuId(Integer.valueOf(updateValueVO.getTargetId()));
// 推送微信操作消息
if (product1 != null) {
wxMsgUtils.aboardOperationMsg(("0".equals(updateValueVO.getUpdateValue()) ? "关闭售罄: " : "开启售罄: ") + product1.getName());
}else {
log.warn("推送微信操作消息失败未查询到商品信息skuId: {}", updateValueVO.getTargetId());
}
break;
default:
throw new BadRequestException("无效更新类型");
@@ -393,7 +407,10 @@ public class StockServiceImpl implements StockService {
if (tbProductSku == null) {
throw new BadRequestException("商品不存在skuId: " + skuId);
}
TbProduct product = tbProductRepository.selectByShopIdAndId(Integer.parseInt(tbProductSku.getProductId()), String.valueOf(shopId));
// 推送微信操作消息
wxMsgUtils.aboardOperationMsg((isGrounding ? "上架商品: " : "下架商品: ") + product.getName());
// 共享库存下架所有sku
if (product.getIsDistribute().equals(1)) {
tbProductSkuRepository.updateGroundingByProId(product.getId().toString(), isGrounding ? 1 : 0);

View File

@@ -46,6 +46,7 @@ public class TbProductGroupServiceImpl implements TbProductGroupService {
private final TbProductGroupRepository tbProductGroupRepository;
private final TbProductGroupMapper tbProductGroupMapper;
private final TbProductRepository tbProductRepository;
private final WxMsgUtils wxMsgUtils;
@Resource
private OnlineUserService onlineUserService;
@@ -104,6 +105,9 @@ public class TbProductGroupServiceImpl implements TbProductGroupService {
ValidationUtil.isNull( tbProductGroup.getId(),"TbProductGroup","id",resources.getId());
tbProductGroup.copy(resources);
tbProductGroupRepository.save(tbProductGroup);
// 推送微信操作消息
wxMsgUtils.aboardOperationMsg((resources.getIsShow() == 0 ? "关闭分组: " : "开启分组: ") + tbProductGroup.getName());
}
@Transactional(rollbackFor = Exception.class)
@@ -224,4 +228,4 @@ public class TbProductGroupServiceImpl implements TbProductGroupService {
}
}

View File

@@ -160,6 +160,7 @@ public class TbProductStocktakinServiceImpl implements TbProductStocktakinServic
round = (int) Math.floor( productSku.getStockNumber());
productStockDetail.setSpecSnap(productSku.getSpecSnap());
productStockDetail.setSubType(productStocktakinDTO.getStocktakinNum() > productSku.getStockNumber() ? 1 : -1);
stockOperate.setType(productStocktakinDTO.getStocktakinNum() > productSku.getStockNumber() ? "盘点入库" : "盘点出库");