| | |
| | | package com.aps.job.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.common.core.utils.uuid.IdUtils; |
| | |
| | | import com.aps.job.mapper.ApsStandardProcessRouteLineJobMapper; |
| | | import com.aps.job.mapper.ApsWorkOrderJobLogMapper; |
| | | import com.aps.job.service.IApsStandardProcessRouteHeaderJobService; |
| | | import com.aps.system.api.RemoteCoreService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | |
| | | * @author hjy |
| | | * @date 2025-05-09 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ApsStandardProcessRouteHeaderJobServiceImpl implements IApsStandardProcessRouteHeaderJobService |
| | | { |
| | |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private RemoteCoreService remoteCoreService; |
| | | |
| | | /** |
| | | * 查询标准工艺路线Header |
| | |
| | | jobLog.setResult("header:"+headerList.size() + " line:"+lineList.size()); |
| | | jobLog.setCreateBy(batchNum); |
| | | jobLogMapper.insertApsWorkOrderJobLog(jobLog); |
| | | log.info("标准工艺路线同步:"+ JSON.toJSONString(jobLog)); |
| | | pageIndex++; |
| | | }else{ |
| | | break; |
| | |
| | | jobLog.setBizType("processRoute"); |
| | | jobLog.setResult("error"); |
| | | jobLog.setCreateBy(batchNum); |
| | | log.info("标准工艺路线同步:"+ JSON.toJSONString(jobLog)); |
| | | jobLogMapper.insertApsWorkOrderJobLog(jobLog); |
| | | break; |
| | | } |
| | |
| | | jobLog.setBizType("processRoute"); |
| | | jobLog.setResult("error"); |
| | | jobLog.setCreateBy(batchNum); |
| | | log.info("标准工艺路线同步:"+ JSON.toJSONString(jobLog)); |
| | | jobLogMapper.insertApsWorkOrderJobLog(jobLog); |
| | | return false; |
| | | } |
| | |
| | | @Override |
| | | public boolean syncProcessRouteDataJob(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList) { |
| | | try { |
| | | |
| | | apsStandardProcessRouteHeaderJobMapper.deleteProcessRouteHeaderJob(); |
| | | apsStandardProcessRouteLineJobMapper.deleteProcessRouteLineJob(); |
| | | boolean res = syncProcessRouteData(pageIndex, pageSize, orgCode, itemCodeList); |
| | | if(!res){ |
| | | return false; |
| | | } |
| | | remoteCoreService.setProcessRouteDataToRedis(SecurityConstants.INNER); |
| | | apsStandardProcessRouteHeaderJobMapper.deleteProcessRouteHeader(); |
| | | apsStandardProcessRouteLineJobMapper.deleteProcessRouteLine(); |
| | | apsStandardProcessRouteHeaderJobMapper.insertIntoProcessRouteHeader(); |