耗材 检测开关 默认值问题

This commit is contained in:
2026-04-22 15:00:39 +08:00
parent 3558e99784
commit c3ae15c7cc

View File

@@ -87,7 +87,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,SystemConstants.OneZero.ONE); 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));
@@ -126,7 +126,9 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
entity.setStockNumber(BigDecimal.ZERO); entity.setStockNumber(BigDecimal.ZERO);
entity.setStatus(SystemConstants.OneZero.ONE); entity.setStatus(SystemConstants.OneZero.ONE);
//entity.setConWarning(BigDecimal.ZERO); //entity.setConWarning(BigDecimal.ZERO);
entity.setIsStock(SystemConstants.OneZero.ZERO); if (dto.getIsStock() == null) {
entity.setIsStock(SystemConstants.OneZero.ZERO);
}
entity.setShopId(shopId); entity.setShopId(shopId);
super.save(entity); super.save(entity);
dto.setId(entity.getId()); dto.setId(entity.getId());
@@ -168,7 +170,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,SystemConstants.OneZero.ONE) .set(ConsInfo::getStatus, SystemConstants.OneZero.ONE)
.eq(ConsInfo::getId, id) .eq(ConsInfo::getId, id)
.eq(ConsInfo::getShopId, shopId) .eq(ConsInfo::getShopId, shopId)
.update(); .update();