From d8d129a2e41f7099968cb4f4dc1b028ab985135f Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期四, 16 十一月 2023 20:20:47 +0800
Subject: [PATCH] Changes14

---
 mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/MasterProductionScheduleServiceImpl.java |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/MasterProductionScheduleServiceImpl.java b/mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/MasterProductionScheduleServiceImpl.java
index 8f1353b..426e82c 100644
--- a/mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/MasterProductionScheduleServiceImpl.java
+++ b/mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/MasterProductionScheduleServiceImpl.java
@@ -1,6 +1,7 @@
 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;
@@ -19,7 +20,10 @@
 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;
@@ -28,7 +32,6 @@
 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;
@@ -40,6 +43,7 @@
 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;
@@ -50,7 +54,6 @@
 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;
@@ -63,6 +66,7 @@
  * @author cxf
  * @date 2020-09-21 14:42:39
  */
+@Slf4j
 @Service
 @AllArgsConstructor
 @Transactional(rollbackFor = Exception.class)
@@ -86,6 +90,7 @@
 	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) {
@@ -457,4 +462,28 @@
 		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;
+	}
+
+
+
+
+
 }

--
Gitblit v1.9.3