| | |
| | | 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.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Node; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | @Service("locDetlService") |
| | | public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService { |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Override |
| | | public Page<LocDetl> getPage(Page<LocDetl> page) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void adjustLocDetl2(LocDetlAdjustParam param, String barcode, Long userId) { |
| | | Date now = new Date(); |
| | | this.baseMapper.delete(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", param.getLocNo())); |
| | | for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("matnr", locDetlAdjust.getMatnr())); |
| | | if (mat == null) { |
| | | throw new CoolException("无法找到需要调整的物料,请联系管理员"); |
| | | } |
| | | |
| | | LocDetl manLocDetl = new LocDetl(); |
| | | manLocDetl.sync(mat); |
| | | manLocDetl.setLocNo(param.getLocNo()); |
| | | manLocDetl.setZpallet(barcode); |
| | | manLocDetl.setAnfme(locDetlAdjust.getCount()); |
| | | manLocDetl.setBatch(locDetlAdjust.getBatch()); |
| | | manLocDetl.setBarcode(barcode); |
| | | manLocDetl.setDanger(locDetlAdjust.getDanger()); |
| | | SaasUtils.insertLog(3, manLocDetl.getLocNo(), manLocDetl.getMatnr(), manLocDetl.getAnfme()); |
| | | this.baseMapper.insert(manLocDetl); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean updateLocNo(String newLocNo, String oldLocNo) { |