| | |
| | | * 批量插入钣金计划工单 |
| | | * */ |
| | | int batchInsertPlatePlan(); |
| | | |
| | | |
| | | int deleteAllGasPiping(); |
| | | int batchInsertGasPiping(); |
| | | } |
| | |
| | | |
| | | @Transactional |
| | | void syncPlateOrderData(); |
| | | |
| | | @Transactional |
| | | void syncGasPipingData(); |
| | | } |
| | |
| | | apsWorkOrderJobMapper.batchInsertPlatePlan(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 同步钣金工单信息 |
| | | * */ |
| | | @Transactional |
| | | @Override |
| | | public void syncGasPipingData() { |
| | | apsWorkOrderJobMapper.deleteAllGasPiping(); |
| | | apsWorkOrderJobMapper.batchInsertGasPiping(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | iApsWorkOrderJobService.syncPlateOrderData(); |
| | | } |
| | | |
| | | /** |
| | | * 每日同步气柜管路数据 |
| | | * */ |
| | | public void syncGasPipingData () |
| | | { |
| | | iApsWorkOrderJobService.syncGasPipingData(); |
| | | } |
| | | /** |
| | | * 每日同步所有工单数据 |
| | | * */ |
| | |
| | | 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(1000); |
| | | while (continueFlag){ |
| | | param.setPageIndex(currentPage); |
| | | continueFlag= iApsWorkOrderJobService.batchSaveByPager(param); |
| | | currentPage++; |
| | | } |
| | | } |
| | | /** |
| | | * 将工单工序数据同步到业务表中 |
| | | */ |
| | |
| | | update_time, |
| | | org_code, |
| | | process_status, |
| | | std_op, |
| | | std_op |
| | | </trim> |
| | | values |
| | | <foreach collection="list" item="job" separator=","> |
| | |
| | | #{job.updateTime}, |
| | | #{job.orgCode}, |
| | | #{job.processStatus}, |
| | | #{job.stdOp}, |
| | | #{job.stdOp} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | |
| | | op_num,work_center,dept, |
| | | start_date,complete_date,next_dept, |
| | | is_hold_release,is_out_source,org_code, |
| | | order_id,now(),'0',org_code,doc_status,,std_op |
| | | order_id,now(),'0',org_code,doc_status,std_op |
| | | from aps_work_order_job |
| | | where ( doc_status in (0,1,2,4) |
| | | and (mainitem_code like 'M03%' or mainitem_code like 'M04%'or mainitem_code like 'A75%') |
| | | ); |
| | | </insert> |
| | | |
| | | <delete id="deleteAllGasPiping" > |
| | | delete from aps_gas_piping_plan where del_flag in ('0','1') |
| | | </delete> |
| | | <insert id="batchInsertGasPiping"> |
| | | insert into aps_gas_piping_plan |
| | | ( |
| | | document_number,main_part_number,main_part_drawing_number, |
| | | customer,business_type,requirement_type, |
| | | document_status,item_number,drawing_no, |
| | | version_number,production_quantity,good_products_quantity, |
| | | process_number,work_center,department, |
| | | plan_start_day,plan_end_day,next_process_deparment, |
| | | is_suspended,is_outsourcing,account, |
| | | id,create_time,del_flag,plant,order_status,std_op,plan_type |
| | | ) |
| | | select |
| | | doc_no,mainitem_code,mainitem_figure, |
| | | customer_name,business_type,demand_type, |
| | | doc_status,item_code,item_figure, |
| | | item_figure_version,pruduct_qty,work_qty, |
| | | op_num,work_center,dept, |
| | | start_date,complete_date,next_dept, |
| | | is_hold_release,is_out_source,org_code, |
| | | order_id,now(),'0',org_code,doc_status,std_op, |
| | | case when substr(mainitem_code,3)='A65' then 'gas' else 'piping' end as plan_type |
| | | from aps_work_order_job |
| | | where ( doc_status in (0,1,2,4) |
| | | and (mainitem_code like 'A65%' or mainitem_code like 'W%')); |
| | | </insert> |
| | | </mapper> |
| | |
| | | #{item.scrapQty}, |
| | | #{item.opStatus}, |
| | | #{item.org}, |
| | | #{item.orgCode} |
| | | #{item.orgCode}, |
| | | #{item.workCenter} |
| | | ) |
| | | </foreach> |