| | |
| | | package com.aps.job.task; |
| | | |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.job.param.ApsWorkOrderJobParam; |
| | | import com.aps.job.service.IApsBomHeaderJobService; |
| | | import com.aps.job.service.IApsMaterialStorageManagementJobService; |
| | | import com.aps.job.service.IApsWorkOrderJobService; |
| | | import com.aps.job.service.IApsWorkOrderProcessService; |
| | | import com.aps.system.api.RemoteCoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IApsWorkOrderJobService iApsWorkOrderJobService; |
| | | |
| | | @Autowired |
| | | private IApsBomHeaderJobService iApsBomHeaderJobService; |
| | | |
| | | @Autowired |
| | | private RemoteCoreService remoteCoreService; |
| | | |
| | | @Autowired |
| | | private IApsMaterialStorageManagementJobService apsMaterialStorageManagementJobService; |
| | | |
| | | public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) |
| | | { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 每日同步钣金工单数据 |
| | | * */ |
| | | public void syncPlateOrderData () |
| | | { |
| | | |
| | | iApsWorkOrderJobService.syncPlateOrderData(); |
| | | } |
| | | /** |
| | | * 每日同步气柜管路数据 |
| | | * */ |
| | | public void syncGasPipingData () |
| | | { |
| | | iApsWorkOrderJobService.syncGasPipingData(); |
| | | } |
| | | /** |
| | | * 每日同步所有工单数据 |
| | | * */ |
| | | public void syncWorkOrderData() |
| | |
| | | param.setDocState(Arrays.asList(0,1,2,4)); |
| | | param.setBeginDate(yesterdayMidnight.format(formatter)); |
| | | param.setEndDate(today.format(formatter)); |
| | | param.setPageSize(1000); |
| | | param.setPageSize(500); |
| | | while (continueFlag){ |
| | | param.setPageIndex(currentPage); |
| | | continueFlag= iApsWorkOrderJobService.batchSaveByPager(param); |
| | | currentPage++; |
| | | } |
| | | } |
| | | /** |
| | | * 每日同步所有工单数据 |
| | | * */ |
| | | public void syncAllWorkOrder() |
| | | { |
| | | |
| | | 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= iApsWorkOrderJobService.batchSaveByPager(param); |
| | | currentPage++; |
| | | } |
| | | } |
| | | /** |
| | | * 将工单工序数据同步到业务表中 |
| | | */ |
| | | public void insertIntoApsProcessRoute() |
| | | { |
| | | iApsWorkOrderProcessService.deleteApsProcessRoute(); |
| | | iApsWorkOrderProcessService.insertIntoApsProcessRoute(); |
| | | iApsWorkOrderProcessService.syncProcessRouteData(); |
| | | } |
| | | |
| | | /** |
| | | * 同步零件、钣金、气柜管路的工单数据到业务表中、同步工序数据到工艺路线表中 |
| | | */ |
| | | public void syncAllTypeOrder() |
| | | { |
| | | iApsWorkOrderJobService.syncPartOrderData(); |
| | | iApsWorkOrderJobService.syncPlateOrderData(); |
| | | iApsWorkOrderJobService.syncGasPipingData(); |
| | | iApsWorkOrderProcessService.syncProcessRouteData(); |
| | | } |
| | | |
| | | /** |
| | | * 同步全量BOM数据定时任务 |
| | | */ |
| | | public void syncBomDataJob(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList) |
| | | { |
| | | boolean res = iApsBomHeaderJobService.syncBomDataJob(pageIndex, pageSize, orgCode, itemCodeList); |
| | | if(res){ |
| | | remoteCoreService.setBomDataToRedis(SecurityConstants.INNER); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 同步全量库存数据定时任务 |
| | | */ |
| | | public void syncApsMaterialStorageDataJob(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList) |
| | | { |
| | | apsMaterialStorageManagementJobService.syncApsMaterialStorageDataJob(pageIndex, pageSize, orgCode, itemCodeList); |
| | | } |
| | | } |