| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | 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.core.exception.CoolException; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | |
| | | import com.zy.asrs.service.NodeService; |
| | | import com.zy.asrs.service.WaitPakinService; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.common.model.LocDto; |
| | | import com.zy.system.entity.User; |
| | | 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; |
| | | import java.util.*; |
| | | |
| | | @Service("manLocDetlService") |
| | | public class ManLocDetlServiceImpl extends ServiceImpl<ManLocDetlMapper, ManLocDetl> implements ManLocDetlService { |
| | |
| | | return baseMapper.increase(anfme,locNo,matnr,batch,weight); |
| | | } |
| | | |
| | | public double queryStockAndSetLocDto(String matnr, String batch, String orderNo, List<LocDto> locDtoList, double issued, String csocode, String isoseq) { |
| | | Wrapper<ManLocDetl> wrapper = new EntityWrapper<ManLocDetl>().eq("matnr", matnr).orderBy("modi_time"); |
| | | wrapper.eq("status",1); |
| | | wapperSetCondition(wrapper,"batch",batch); |
| | | wapperSetCondition(wrapper,"csocode",csocode); |
| | | wapperSetCondition(wrapper,"isoseq",isoseq); |
| | | |
| | | List<ManLocDetl> manLocDetls = this.selectList(wrapper); |
| | | for (ManLocDetl manLocDetl : manLocDetls){ |
| | | if(issued > 0) { |
| | | double anfme = manLocDetl.getAnfme(); |
| | | anfme = anfme > issued ? issued : anfme; |
| | | LocDto locDto = new LocDto(manLocDetl.getLocNo(), manLocDetl.getMatnr(), manLocDetl.getMaktx(), manLocDetl.getBatch(), orderNo, anfme); |
| | | locDto.setCsocode(csocode); |
| | | locDto.setIsoseq(isoseq); |
| | | locDto.setContainerCode(manLocDetl.getContainerCode()); |
| | | List<String> stationList = new ArrayList<>(); |
| | | stationList.add("无需站点"); |
| | | locDto.setAgvStaNos(stationList); |
| | | |
| | | locDtoList.add(locDto); |
| | | issued -= anfme; |
| | | } |
| | | } |
| | | |
| | | return issued; |
| | | } |
| | | |
| | | private void wapperSetCondition(Wrapper wrapper,String column, String condition){ |
| | | if(Cools.isEmpty(condition)){ |
| | | wrapper.andNew().eq(column,"").or().isNull(column); |
| | | }else { |
| | | wrapper.eq(column,condition); |
| | | } |
| | | } |
| | | |
| | | } |