| | |
| | | package com.aps.job.controller; |
| | | |
| | | import java.util.List; |
| | | import java.io.IOException; |
| | | |
| | | import com.aps.job.param.ApsWorkOrderJobParam; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增工单同步 |
| | | */ |
| | | @RequiresPermissions("ApsWorkOrderJob:ApsWorkOrderJob:add") |
| | | @Log(title = "工单同步", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsWorkOrderJob apsWorkOrderJob) |
| | | { |
| | | return toAjax(apsWorkOrderJobService.insertApsWorkOrderJob(apsWorkOrderJob)); |
| | | } |
| | | |
| | | /** |
| | | * 修改工单同步 |
| | | */ |
| | | @RequiresPermissions("ApsWorkOrderJob:ApsWorkOrderJob:edit") |
| | | @Log(title = "工单同步", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsWorkOrderJob apsWorkOrderJob) |
| | | { |
| | | return toAjax(apsWorkOrderJobService.updateApsWorkOrderJob(apsWorkOrderJob)); |
| | | } |
| | | |
| | | /** |
| | | * 删除工单同步 |
| | | */ |
| | | @RequiresPermissions("ApsWorkOrderJob:ApsWorkOrderJob:remove") |
| | | @Log(title = "工单同步", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(apsWorkOrderJobService.deleteApsWorkOrderJobByIds(ids)); |
| | | } |
| | | |
| | | |
| | | * 同步工单数据 |
| | | * */ |
| | | @PostMapping("/batchInsertApsWorkOrderJob") |
| | | public AjaxResult batchInsertApsWorkOrderJob(@RequestBody ApsWorkOrderJobParam param) |
| | | { |
| | | apsWorkOrderJobService.batchInsertApsWorkOrderJob(param); |
| | | return success(); |
| | | } |
| | | /** |
| | | * 同步零件工单 |
| | | * */ |
| | | @PostMapping("/batchInsertPartOrderJob") |
| | | public AjaxResult batchInsertPartOrderJob() |
| | | { |
| | | apsWorkOrderJobService.syncPartOrderData(); |
| | | return success(); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public int updateApsWorkOrderJobPrccessStatus(String docNo); |
| | | |
| | | /** |
| | | * 批量删除零件工单数据 |
| | | * */ |
| | | int deleteAllPartPlan(); |
| | | /** |
| | | * 批量插入零件计划工单 |
| | | * */ |
| | | int batchInsertPartPlan(); |
| | | } |
| | |
| | | import java.util.List; |
| | | import com.aps.job.domain.ApsWorkOrderJob; |
| | | import com.aps.job.param.ApsWorkOrderJobParam; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 工单同步Service接口 |
| | |
| | | |
| | | |
| | | void batchInsertApsWorkOrderJob(ApsWorkOrderJobParam param); |
| | | |
| | | @Transactional |
| | | void syncPartOrderData(); |
| | | } |
| | |
| | | return apsWorkOrderJobMapper.batchInsertApsWorkOrderJob(jobs); |
| | | } |
| | | |
| | | /** |
| | | * 同步零件工单信息 |
| | | * */ |
| | | @Transactional |
| | | @Override |
| | | public void syncPartOrderData() { |
| | | apsWorkOrderJobMapper.deleteAllPartPlan(); |
| | | apsWorkOrderJobMapper.batchInsertPartPlan(); |
| | | } |
| | | } |
| | |
| | | update aps_work_order_job set process_status='1' where doc_no = #{docNo} |
| | | </update> |
| | | |
| | | <delete id="deleteAllPartPlan" > |
| | | delete from aps_part_plan where del_flag in ('0','1') |
| | | </delete> |
| | | <insert id="batchInsertPartPlan"> |
| | | insert into aps_part_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 |
| | | ) |
| | | 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 |
| | | from aps_work_order_job |
| | | where ( doc_status in (0,1,2,4) and |
| | | (mainitem_code like 'M01%' or mainitem_code like 'M02%'or mainitem_code like 'M05%' or mainitem_code like 'M10%' |
| | | or mainitem_code like 'M14%'or mainitem_code like 'M15%' or mainitem_code like 'F%' or mainitem_code like 'Z%') |
| | | ); |
| | | </insert> |
| | | </mapper> |