wujian
2024-05-24 09ef66abe6ffc1325c5d23055ed6f3f4cb88b625
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java
@@ -1,21 +1,23 @@
package com.jcdm.main.da.passingStationCollection.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jcdm.common.utils.DateUtils;
//import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
//import com.jcdm.main.bs.orderScheduling.mapper.BsOrderSchedulingMapper;
//import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper;
import com.jcdm.main.da.passingStationCollection.query.ProductOrderQuery;
import com.jcdm.main.da.passingStationCollection.query.ProductOrderVO;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import com.jcdm.main.rm.repairRecord.domain.RmRepairRecord;
import com.jcdm.main.rm.repairRecord.mapper.RmRepairRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
@@ -36,6 +38,9 @@
    @Autowired
    private RmRepairRecordMapper rmRepairRecordMapper;
    @Value("${orderLineUrl}")
    private String orderLineUrl;
//    @Autowired
//    private BsOrderSchedulingMapper bsOrderSchedulingMapper;
//
@@ -157,4 +162,31 @@
        }
        return 1;
    }
    @Override
    public ProductOrderVO queryMessFromLine(ProductOrderQuery query){
        ProductOrderVO vo = new ProductOrderVO();
        String jsonStr = JSONUtil.toJsonStr(query);
        String url = orderLineUrl + "/productionWorkOrderRequest?siteCode="+query.getSiteCode()+"&stationCode="+query.getStationCode()+"&productNum="+query.getProductNum();
//        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/productionWorkOrderRequest?siteCode=3983&stationCode=OP230&productNum=0RSPB001139E3AE5B0000011";
        HttpResponse execute = HttpRequest.get(url).execute();
        String body = execute.body();
        if (StrUtil.isNotBlank(body)){
//            JSONObject jsonObject = new JSONObject(body);
            vo = JSON.parseObject(body, ProductOrderVO.class);
        }
        return vo;
    }
    @Override
    public void insertBatch(List<DaPassingStationCollection> confList){
        try{
            this.saveBatch(confList);
        }catch (Exception e){
            return;
        }
    }
}