| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.result.InOutCountDto; |
| | | import com.zy.asrs.entity.result.OpenOrderCompeteResult; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.asrs.mapper.TagMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import com.zy.common.utils.Synchro; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private ManPakOutService manPakOutService; |
| | | @Autowired |
| | | private LocOwnerService locOwnerService; |
| | | @Autowired |
| | | private ReportQueryMapper reportQueryMapper; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | if (Cools.isEmpty(locOwner)){ |
| | | LocOwner locOwner1 = new LocOwner(); |
| | | locOwner1.setOwner(detlDto.getOwnerName()); |
| | | locOwnerService.insert(locOwner1); |
| | | } |
| | | } |
| | | } |
| | |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getOrderDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme()); |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(),detail.getOwnerName(),detail.getPayment()); |
| | | dto.setBeBatch(detail.getBeBatch()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | |
| | | orderDetl.setPayment(detlDto.getPayment()); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setBeBatch(detlDto.getBeBatch()); |
| | | orderDetl.setWeight(detlDto.getWeight()); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | |
| | | List<DetlDto> orderDetails = param.getOrderDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme()); |
| | | dto.setBeBatch(detail.getBeBatch()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setBeBatch(detlDto.getBeBatch()); |
| | | orderDetl.setWeight(detlDto.getWeight()); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | |
| | | Long tagId; |
| | | // 一级分类 |
| | | if (!Cools.isEmpty(matParam.getGroupCode()) && !Cools.isEmpty(matParam.getGroupName())) { |
| | | Tag priTag = tagService.selectByName(matParam.getGroupCode(), 2); |
| | | Tag priTag = tagService.selectByName(matParam.getGroupCode(), 1); |
| | | if (priTag == null) { |
| | | Tag top = tagService.getTop(); |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | |
| | | } |
| | | } |
| | | // 二级分类 |
| | | Tag secTag = tagService.selectByName(matParam.getGroupName(), 3); |
| | | Tag secTag = tagService.selectByName(matParam.getGroupName(), 2); |
| | | if (secTag == null) { |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(priTag.getId()); |
| | |
| | | return R.ok().add(top100); |
| | | } |
| | | |
| | | /* |
| | | * 速腾数字孪生调用接口 |
| | | * */ |
| | | @Override |
| | | public DigitalTwin inventoryQuantity() { |
| | | DigitalTwin digitalTwin = new DigitalTwin(); |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRate(); |
| | | LocChartPie locUseRateL = reportQueryMapper.getLocUseRateL(); |
| | | LocChartPie locUseRateP = reportQueryMapper.getLocUseRateP(); |
| | | if(locUseRate!=null) { |
| | | digitalTwin.setCount(locUseRate.getOqty()+locUseRate.getFqty()+locUseRate.getUqty()+locUseRate.getXqty()); |
| | | digitalTwin.setOqty(locUseRate.getOqty()); |
| | | digitalTwin.setFqty(locUseRate.getFqty()); |
| | | digitalTwin.setUqty(locUseRate.getUqty()); |
| | | digitalTwin.setXqty(locUseRate.getXqty()); |
| | | } |
| | | if(locUseRateL!=null) { |
| | | digitalTwin.setCountL(locUseRateL.getOqty()+locUseRateL.getFqty()+locUseRateL.getUqty()+locUseRateL.getXqty()); |
| | | digitalTwin.setOqtyL(locUseRateL.getOqty()); |
| | | digitalTwin.setFqtyL(locUseRateL.getFqty()); |
| | | digitalTwin.setUqtyL(locUseRateL.getUqty()); |
| | | digitalTwin.setXqtyL(locUseRateL.getXqty()); |
| | | } |
| | | if (locUseRateP!=null){ |
| | | digitalTwin.setCountP(locUseRateP.getOqty()+locUseRateP.getFqty()+locUseRateP.getUqty()+locUseRateP.getXqty()); |
| | | digitalTwin.setOqtyP(locUseRateP.getOqty()); |
| | | digitalTwin.setFqtyP(locUseRateP.getFqty()); |
| | | digitalTwin.setUqtyP(locUseRateP.getUqty()); |
| | | digitalTwin.setXqtyP(locUseRateP.getXqty()); |
| | | } |
| | | return digitalTwin; |
| | | } |
| | | |
| | | /* |
| | | * 速腾数字孪生调用接口 |
| | | * */ |
| | | @Override |
| | | public synchronized R ownerAllNumber() { |
| | | List<LocDetlAll> locDetlAlls = locDetlService.selectOwnerAllAnfme(); |
| | | return R.ok(locDetlAlls); |
| | | } |
| | | |
| | | } |