| | |
| | | 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; |
| | |
| | | * @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; |
| | | |
| | |
| | | // ExecutorType.SIMPLE: 这个执行器类型不做特殊的事情。它为每个语句的执行创建一个新的预处理语句。 |
| | | // ExecutorType.REUSE: 这个执行器类型会复用预处理语句。 |
| | | // ExecutorType.BATCH: 这个执行器会批量执行所有更新语句,如果 SELECT 在它们中间执行还会标定它们是 必须的,来保证一个简单并易于理解的行为。 |
| | | logger.info("进入乐工批量方法saveBeachDaParamCollection"); |
| | | |
| | | // 关闭session的自动提交 |
| | | SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); |
| | |
| | | // 提交数据 |
| | | sqlSession.commit(); |
| | | sqlSession.rollback(); |
| | | logger.info("结束乐工批量方法saveBeachDaParamCollection"); |
| | | |
| | | } catch (Exception e) { |
| | | sqlSession.rollback(); |
| | | } finally { |
| | |
| | | |
| | | @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())); |
| | |
| | | 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 |