Fixiaobai
2023-11-17 6ee9d58d62dbbccf95ce809f358ec9f8d088b705
mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/MasterProductionScheduleServiceImpl.java
@@ -20,10 +20,7 @@
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.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.entity.*;
import com.chinaztt.mes.plan.mapper.*;
import com.chinaztt.mes.plan.service.CustomerOrderService;
import com.chinaztt.mes.plan.service.MasterProductionScheduleService;
@@ -90,7 +87,7 @@
   private StructureMapper structureMapper;
   private StateMachineFactory<MasterProductionScheduleStates, MasterProductionScheduleEvents> masterproductionscheduleStateMachineFactory;
   private StateMachinePersister<MasterProductionScheduleStates, MasterProductionScheduleEvents, MasterProductionSchedule> persister;
   private MoStructureComponentMapper moStructureComponentMapper;
   @Override
   public IPage<List<MasterProductionScheduleDTO>> getMasterProductionSchedulePage(Page page, QueryWrapper<MasterProductionScheduleDTO> masterProductionScheduleDTO) {
@@ -474,10 +471,14 @@
         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);
         List<MoStructureComponent> moStructureComponents = moStructureComponentMapper.selectList(new QueryWrapper<MoStructureComponent>().lambda().eq(MoStructureComponent::getPlanManufacturingOrderId, p.getId()));
         moStructureComponents.forEach(m->{
            Part part = partMapper.selectById(m.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\":"+part.getPartNo()+"}";
            String body = HttpRequest.get(url).execute().body();
            JSONObject partInfo = JSONObject.parseObject(body);
            log.info("库存零件==================================>"+partInfo);
         });
      });
      return false;
   }