|  |  |  | 
|---|
|  |  |  | import com.aps.common.log.enums.BusinessType; | 
|---|
|  |  |  | import com.aps.common.security.utils.SecurityUtils; | 
|---|
|  |  |  | import com.aps.job.domain.SysJob; | 
|---|
|  |  |  | import com.aps.job.param.ApsWorkOrderJobParam; | 
|---|
|  |  |  | import com.aps.job.service.*; | 
|---|
|  |  |  | import com.aps.job.util.CronUtils; | 
|---|
|  |  |  | import com.aps.job.util.ScheduleUtils; | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.time.ZoneId; | 
|---|
|  |  |  | import java.time.ZoneOffset; | 
|---|
|  |  |  | import java.time.format.DateTimeFormatter; | 
|---|
|  |  |  | import java.util.Arrays; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/refreshBomData") | 
|---|
|  |  |  | public Boolean refreshBomData() throws SchedulerException, TaskException | 
|---|
|  |  |  | public AjaxResult refreshBomData() throws SchedulerException, TaskException | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return apsBomHeaderJobService.syncBomDataJob(1, 1000, "", ""); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | boolean res = apsBomHeaderJobService.syncBomDataJob(1, 1000, "", ""); | 
|---|
|  |  |  | if(res){ | 
|---|
|  |  |  | return success(); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | return error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/refreshProcessRouteData") | 
|---|
|  |  |  | public Boolean refreshProcessRouteData() throws SchedulerException, TaskException | 
|---|
|  |  |  | public AjaxResult refreshProcessRouteData() throws SchedulerException, TaskException | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return apsStandardProcessRouteHeaderJobService.syncProcessRouteDataJob(1, 1000, "", ""); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | boolean res = apsStandardProcessRouteHeaderJobService.syncProcessRouteDataJob(1, 1000, "", ""); | 
|---|
|  |  |  | if(res){ | 
|---|
|  |  |  | return success(); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | return error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PutMapping("/test") | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | System.out.println("start"); | 
|---|
|  |  |  | //同步工单数据 | 
|---|
|  |  |  | boolean continueFlag = true; | 
|---|
|  |  |  | Integer currentPage = 1; | 
|---|
|  |  |  | ApsWorkOrderJobParam param=new ApsWorkOrderJobParam(); | 
|---|
|  |  |  | param.setPageIndex(currentPage); | 
|---|
|  |  |  | param.setDocState(Arrays.asList(0,1,2,4)); | 
|---|
|  |  |  | param.setPageSize(500); | 
|---|
|  |  |  | while (continueFlag){ | 
|---|
|  |  |  | param.setPageIndex(currentPage); | 
|---|
|  |  |  | continueFlag= apsWorkOrderJobService.batchSaveByPager(param); | 
|---|
|  |  |  | currentPage++; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        boolean continueFlag = true; | 
|---|
|  |  |  | //        Integer currentPage = 1; | 
|---|
|  |  |  | //        ApsWorkOrderJobParam param=new ApsWorkOrderJobParam(); | 
|---|
|  |  |  | //        param.setPageIndex(currentPage); | 
|---|
|  |  |  | //        param.setDocState(Arrays.asList(0,1,2,4)); | 
|---|
|  |  |  | //        param.setPageSize(500); | 
|---|
|  |  |  | //        while (continueFlag){ | 
|---|
|  |  |  | //            param.setPageIndex(currentPage); | 
|---|
|  |  |  | //            continueFlag= apsWorkOrderJobService.batchSaveByPager(param); | 
|---|
|  |  |  | //            currentPage++; | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | //同步物料数据 | 
|---|
|  |  |  | //        apsMaterialManagementJobService.syncApsMaterialData(1, 1000, "FORTUNA", ""); | 
|---|
|  |  |  | //        apsMaterialManagementJobService.syncApsMaterialData(1, 1000, "", ""); | 
|---|
|  |  |  | //同步工艺路线数据 | 
|---|
|  |  |  | //        apsStandardProcessRouteHeaderJobService.syncProcessRouteData(1, 1000, "", ""); | 
|---|
|  |  |  | //获取Redis缓存中的BOM数据 | 
|---|
|  |  |  | 
|---|
|  |  |  | //将BOM数据存进Redis中 | 
|---|
|  |  |  | //        remoteCoreService.setBomDataToRedis(SecurityConstants.INNER); | 
|---|
|  |  |  | //同步物料库存数据 | 
|---|
|  |  |  | //        apsMaterialStorageManagementJobService.syncApsMaterialStorageData(1, 1000, "", ""); | 
|---|
|  |  |  | apsMaterialStorageManagementJobService.syncApsMaterialStorageData(1, 1000, "", ""); | 
|---|
|  |  |  | //同步BOM数据 | 
|---|
|  |  |  | //        apsBomHeaderJobService.syncBomData(1, 1000,  "FORTUNA", ""); | 
|---|
|  |  |  | //        apsBomHeaderJobService.syncBomData(1, 1000,  "", ""); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //        System.out.println(sequence.nextId()); | 
|---|
|  |  |  | //        List<String> docNos = new ArrayList<>(); | 
|---|