| | |
| | | package com.chinaztt.mes.plan.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.chinaztt.mes.common.oa.OAResult; |
| | | import com.chinaztt.mes.common.util.StateResult; |
| | | import com.chinaztt.mes.plan.dto.*; |
| | | import com.chinaztt.mes.plan.entity.*; |
| | | import com.chinaztt.mes.plan.entity.MasterProductionSchedule; |
| | | import com.chinaztt.mes.plan.entity.MasterProductionScheduleTheoryQuantity; |
| | | import com.chinaztt.mes.plan.entity.MpsStructureComponent; |
| | | import com.chinaztt.mes.plan.entity.OperationTaskProduce; |
| | | import com.chinaztt.mes.plan.mapper.*; |
| | | import com.chinaztt.mes.plan.service.CustomerOrderService; |
| | | import com.chinaztt.mes.plan.service.MasterProductionScheduleService; |
| | |
| | | import com.chinaztt.mes.plan.state.masterproductionschedule.constant.MasterProductionScheduleEvents; |
| | | import com.chinaztt.mes.plan.state.masterproductionschedule.constant.MasterProductionScheduleStates; |
| | | import com.chinaztt.mes.technology.entity.Document; |
| | | import com.chinaztt.mes.technology.entity.Operation; |
| | | import com.chinaztt.mes.technology.entity.Routing; |
| | | import com.chinaztt.mes.technology.entity.Structure; |
| | | import com.chinaztt.mes.technology.mapper.DocumentMapper; |
| | |
| | | import com.chinaztt.ztt.common.core.util.R; |
| | | import com.chinaztt.ztt.common.security.util.SecurityUtils; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.messaging.Message; |
| | | import org.springframework.messaging.support.MessageBuilder; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Comparator; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | * @author cxf |
| | | * @date 2020-09-21 14:42:39 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | private StructureMapper structureMapper; |
| | | private StateMachineFactory<MasterProductionScheduleStates, MasterProductionScheduleEvents> masterproductionscheduleStateMachineFactory; |
| | | private StateMachinePersister<MasterProductionScheduleStates, MasterProductionScheduleEvents, MasterProductionSchedule> persister; |
| | | |
| | | |
| | | @Override |
| | | public IPage<List<MasterProductionScheduleDTO>> getMasterProductionSchedulePage(Page page, QueryWrapper<MasterProductionScheduleDTO> masterProductionScheduleDTO) { |
| | |
| | | masterProductionScheduleDTO.setOutPutBatchList(operationTaskProduceList); |
| | | return masterProductionScheduleDTO; |
| | | } |
| | | |
| | | /** |
| | | * 添加采购计划 |
| | | * @param masterProductionSchedules |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addPlanPurchasing(List<MasterProductionSchedule>masterProductionSchedules) { |
| | | masterProductionSchedules.forEach(p->{ |
| | | Long technologyDocumentId = p.getTechnologyDocumentId(); |
| | | Document document = documentMapper.selectById(technologyDocumentId); |
| | | Long firstPart = document.getPartId(); |
| | | String url="http://192.168.20.47:8008/PurchService.ashx?contract=ZTKJ&contractKey=4ttDeLKNsZuhstjtROMcRE1USNFXKdFYE7lQ2p1m5Bo=&procedureName=QUERY_INVENTORY_INFO_STD&userId=7632&inAttr={\"LOCATION_NO\": \"1019\",\"PART_NO\":"+p+"}"; |
| | | String body = HttpRequest.get(url).execute().body(); |
| | | JSONObject partInfo = JSONObject.parseObject(body); |
| | | log.info("库存零件======>"+partInfo); |
| | | }); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |