| | |
| | | package org.jeecg.modules.cms.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.modules.cms.entity.CuttingInventory; |
| | | import org.jeecg.modules.cms.mapper.CuttingInventoryMapper; |
| | | import org.jeecg.modules.cms.service.ICuttingInventoryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 刀具库存 |
| | |
| | | */ |
| | | @Service |
| | | public class CuttingInventoryServiceImpl extends ServiceImpl<CuttingInventoryMapper, CuttingInventory> implements ICuttingInventoryService { |
| | | @Override |
| | | public IPage<Map<String, Object>> statisticsByCuttingIdAndStatus(Page<Map<String, Object>> page) { // 执行分页统计查询 |
| | | IPage<Map<String, Object>> result = baseMapper.statisticsByCuttingIdAndStatus(page); |
| | | return result; |
| | | } |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateStatus(List<String> ids, String status) { |
| | | if (ids != null && !ids.isEmpty() && StringUtils.isNotBlank(status)) { |
| | | UpdateWrapper<CuttingInventory> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.in("id", ids); |
| | | updateWrapper.set("inventory_status", status); // 根据实际数据库字段名调整 |
| | | this.update(updateWrapper); |
| | | } |
| | | } |
| | | |
| | | } |