| | |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | @Autowired |
| | | private ApsBomLineJobMapper apsBomLineJobMapper; |
| | | |
| | | /** |
| | | * 获取订单接口 |
| | | * */ |
| | | @Value("${u9.bomJobUrl}") |
| | | private String getBomUrl; |
| | | |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 全量同步BOM数据定时任务 |
| | | * @param pageIndex |
| | | * @param pageSize |
| | | * @param orgCode |
| | | * @param itemCodeList |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public boolean syncBomDataJob(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList){ |
| | | try { |
| | | apsBomHeaderJobMapper.deleteApsBomHeaderJob(); |
| | | apsBomLineJobMapper.deleteApsBomLineJob(); |
| | | boolean res = syncBomData(pageIndex, pageSize, orgCode, itemCodeList); |
| | | if(!res){ |
| | | return false; |
| | | } |
| | | apsBomHeaderJobMapper.deleteApsBomHeader(); |
| | | apsBomLineJobMapper.deleteApsBomLine(); |
| | | apsBomHeaderJobMapper.insertIntoApsBomHeader(); |
| | | apsBomLineJobMapper.insertIntoApsBomLine(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e); |
| | | } |
| | | return true; |
| | | } |
| | | } |