| | |
| | | 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; |
| | | |
| | | @Service("matService") |
| | | public class MatServiceImpl extends ServiceImpl<MatMapper, Mat> implements MatService { |
| | |
| | | public Page<Mat> getPage(Page page, String tagId, Object matnr, Object maktx) { |
| | | return page.setRecords(baseMapper.listByPage(page, tagId, matnr, maktx)); |
| | | } |
| | | @Override |
| | | public Page<Mat> getPage2(Page page, String tagId, Object matnr, Object maktx, Object specs) { |
| | | return page.setRecords(baseMapper.listByPage2(page, tagId, matnr, maktx, specs)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | return this.baseMapper.selectByMatnr(matnr); |
| | | } |
| | | |
| | | @Override |
| | | public List<Mat> selectByMatnrLink(String matnr) { |
| | | return this.baseMapper.selectByMatnrLink(matnr); |
| | | } |
| | | |
| | | @Override |
| | | public Mat selectNewUpdateTime() { |
| | | 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())); |
| | | // page.setTotal(baseMapper.getStockOutPageCount(page.getCondition())); |
| | | page.setTotal(16); |
| | | return page; |
| | | }; |
| | | |
| | | |
| | | |
| | | } |