-
admin
2024-06-18 bdb4046a1ed5358a94cc9ce846f2a1ec88e5d5ec
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -36,9 +36,12 @@
import com.jcdm.main.restful.qingYan.doman.ParentVO;
import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
@@ -55,9 +58,12 @@
 * @author yyt
 * @date 2023-12-13
 */
@Slf4j
@Service
public class DaParamCollectionServiceImpl extends ServiceImpl<DaParamCollectionMapper,DaParamCollection> implements IDaParamCollectionService
{
    private static final Logger logger = LoggerFactory.getLogger("sys-user");
    @Autowired
    private DaParamCollectionMapper daParamCollectionMapper;
@@ -119,6 +125,7 @@
        // ExecutorType.SIMPLE: 这个执行器类型不做特殊的事情。它为每个语句的执行创建一个新的预处理语句。
        // ExecutorType.REUSE: 这个执行器类型会复用预处理语句。
        // ExecutorType.BATCH: 这个执行器会批量执行所有更新语句,如果 SELECT 在它们中间执行还会标定它们是 必须的,来保证一个简单并易于理解的行为。
        logger.info("进入乐工批量方法saveBeachDaParamCollection");
        // 关闭session的自动提交
        SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
@@ -128,6 +135,8 @@
            // 提交数据
            sqlSession.commit();
            sqlSession.rollback();
            logger.info("结束乐工批量方法saveBeachDaParamCollection");
        } catch (Exception e) {
            sqlSession.rollback();
        } finally {
@@ -519,11 +528,13 @@
    @Override
    public void automaticWorkstationPushGeelycvMesFeedback(String packID, String stationCode,List<DaParamCollection> paramList) {
        logger.info("进入工位{}-工厂MES推送数据方法automaticWorkstationPushGeelycvMesFeedback",stationCode);
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
        String totalResult = "0";
        if(paramList.size() > 0){
            logger.info("进入工位{}-拼数据",stationCode);
            ParentVO parentVO = new ParentVO();
            parentVO.setSiteCode("3983");
            parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli()));
@@ -571,10 +582,14 @@
                listChildVo.add(childVO);
            }
            parentVO.setCheckList(listChildVo);
            logger.info("结束工位{}-拼数据",stationCode);
            logger.info("进入工位{}-工厂MES推送数据方法HttpResponseSend",stationCode);
            HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
            logger.info("结束工位{}-工厂MES推送数据方法HttpResponseSend",stationCode);
            System.out.println(execute.body());
            System.out.println("-----------------------"+totalResult);
        }
        logger.info("结束工位{}-工厂MES推送数据方法automaticWorkstationPushGeelycvMesFeedback",stationCode);
    }
    @Override