| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service("orderDetlService") |
| | | public class OrderDetlServiceImpl extends ServiceImpl<OrderDetlMapper, OrderDetl> implements OrderDetlService { |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectItem(Long orderId, String matnr, String batch) { |
| | | return this.baseMapper.selectItem(orderId, matnr, batch); |
| | | public Page<OrderDetl> getPakoutPage(Page<OrderDetl> page) { |
| | | page.setRecords(baseMapper.getPakoutPage(page.getCondition())); |
| | | page.setTotal(baseMapper.getPakoutPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectItem(String orderNo, String matnr, String batch) { |
| | | return this.baseMapper.selectItemByOrderNo(orderNo, matnr, batch); |
| | | public OrderDetl selectItem(Long orderId, String matnr, String batch, String csocode, String isoCode) { |
| | | return this.baseMapper.selectItem(orderId,matnr,batch,csocode,isoCode); |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectItem(String orderNo, String matnr, String batch, String csocode, String isoCode) { |
| | | return this.baseMapper.selectItemByOrderNo(orderNo, matnr, batch,csocode,isoCode); |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectItemNoneOfBatch(String orderNo, String matnr) { |
| | | return this.baseMapper.selectItemNoneOfBatch(orderNo, matnr); |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectItemOfBatch(String matnr, String batch) { |
| | | return this.baseMapper.selectItemOfBatch(matnr, batch); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean increase(Long orderId, String matnr, String batch, Double qty) { |
| | | return this.baseMapper.increase(orderId, matnr, batch, qty) > 0; |
| | | public boolean increaseAnfme(Long orderId, String matnr, String batch, Double qty, String csocode, String isoCode) { |
| | | return this.baseMapper.increaseAnfme(orderId, matnr, batch, qty, csocode, isoCode) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public boolean decrease(String orderNo, String matnr, String batch, Double qty) { |
| | | return this.baseMapper.decrease(orderNo, matnr, batch, qty) > 0; |
| | | public boolean increase(Long orderId, String matnr, String batch, Double qty, String csocode, String isoCode) { |
| | | return this.baseMapper.increase(orderId, matnr, batch, qty, csocode, isoCode) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public boolean decrease(String orderNo, String matnr, String batch, Double qty, String csocode, String isoCode) { |
| | | int decrease = this.baseMapper.decrease(orderNo, matnr, batch, qty, csocode, isoCode); |
| | | if (decrease == 0) { |
| | | return this.baseMapper.decrease(orderNo, matnr, null, qty, csocode, isoCode) > 0; |
| | | } else { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | return this.baseMapper.modifyStatus(orderId, status) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderDetl> selectRemainder(Long orderId) { |
| | | return this.baseMapper.selectRemainder(orderId); |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectContainBatch(String batch) { |
| | | OrderDetl orderDetl = this.selectOne(new EntityWrapper<OrderDetl>().like("batch", batch)); |
| | | return orderDetl; |
| | | // if (!Cools.isEmpty(orderDetls)) { |
| | | // if (orderDetls.size() > 1) { |
| | | // log.error("{}条码同时存在多笔订单,请注意查看!", matnr); |
| | | // } else { |
| | | // return orderDetls.get(0); |
| | | // } |
| | | // } |
| | | // return null; |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectByOrderNoAndMatnr(String orderNo, String matnr, String csocode, String isoseq) { |
| | | Wrapper<OrderDetl> wrapper = new EntityWrapper<OrderDetl>().eq("order_no", orderNo).eq("matnr", matnr); |
| | | Utils.wapperSetCondition(wrapper,"three_code",csocode); |
| | | Utils.wapperSetCondition(wrapper,"dead_time",isoseq); |
| | | |
| | | return this.selectOne(wrapper); |
| | | } |
| | | |
| | | |
| | | } |