| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.param.BatchMatsUpdateParam; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.mapper.MatMapper; |
| | | import com.zy.asrs.service.MatService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | return this.baseMapper.selectNewUpdateTime(); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/26 |
| | | * @description: 批量修改物料信息 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R batchInfo(BatchMatsUpdateParam params) { |
| | | List<Long> ids = params.getIds(); |
| | | List<Mat> mats = this.baseMapper.selectList(new EntityWrapper<Mat>().in("id", ids)); |
| | | mats.forEach(mat -> { |
| | | mat.setLocType(params.getType()); |
| | | mat.setUpQty(params.getUpQty()); |
| | | if (this.updateById(mat)) { |
| | | throw new CoolException("物料信息修改失败!!"); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public Page<Mat> getMatTurnPage(Page<Mat> page){ |
| | | page.setRecords(baseMapper.getMatTurnPage(page.getCondition())); |