| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import jakarta.annotation.Resource; |
| | | import com.aps.job.mapper.ApsWorkOrderJobLogMapper; |
| | | import com.aps.job.param.ApsWorkOrderJobParam; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private ApsWorkOrderJobLogMapper jobLogMapper; |
| | | |
| | | /** |
| | | * 查询工单同步 |
| | |
| | | |
| | | |
| | | @Override |
| | | public void batchInsertApsWorkOrderJob() { |
| | | public void batchInsertApsWorkOrderJob(ApsWorkOrderJobParam param) { |
| | | |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | |
| | | Integer PageSize=500; |
| | | Boolean continueFlag=true; |
| | | /* while (continueFlag){*/ |
| | | JSONObject requestBody = new JSONObject(); |
| | | requestBody.put("PageIndex", PageIndex); |
| | | requestBody.put("PageSize", PageSize); |
| | | HttpEntity<String> request = new HttpEntity<>(requestBody.toJSONString(), headers); |
| | | String requestString = JSONObject.toJSONString(param); |
| | | HttpEntity<String> request = new HttpEntity<>(requestString, headers); |
| | | ResponseEntity<String> response = restTemplate.postForEntity(getWorkOrderUrl, request, String.class); |
| | | if (response.getStatusCode().is2xxSuccessful()) { |
| | | JSONObject responseBodyJson = JSONObject.parseObject(response.getBody()); |
| | |
| | | order.setPageIndex(i); |
| | | order.setPageNum(PageIndex); |
| | | order.setDelFlag("0"); |
| | | order.setProcessStatus("0"); |
| | | jobs.add(order); |
| | | } |
| | | apsWorkOrderJobMapper.batchInsertApsWorkOrderJob(jobs); |
| | |
| | | } |
| | | |
| | | } |
| | | /* }*/ |
| | | |
| | | } |
| | | } |