| | |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.production.mapper.*; |
| | | import com.ruoyi.production.pojo.*; |
| | | import com.ruoyi.production.service.ProductionProductMainService; |
| | | import com.ruoyi.production.service.impl.ProductionProductMainServiceImpl; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | |
| | | private ProductMapper productMapper; |
| | | @Autowired |
| | | private ProductStructureMapper productStructureMapper; |
| | | @Autowired |
| | | private ProductionProductMainService productionProductMainService; |
| | | ; |
| | | |
| | | @Override |
| | |
| | | commonFileService.deleteByBusinessIds(idList, FileNameType.SALE.getValue()); |
| | | |
| | | // 删除生产管控数据 |
| | | // 删除生产订单数据 |
| | | LambdaQueryWrapper<SalesLedgerScheduling> in = new LambdaQueryWrapper<SalesLedgerScheduling>() |
| | | .in(SalesLedgerScheduling::getSalesLedgerId, idList); |
| | | salesLedgerSchedulingMapper.delete(in); |
| | | // 删除生产派工数据 |
| | | LambdaQueryWrapper<SalesLedgerWork> workOrderWrapper = new LambdaQueryWrapper<>(); |
| | | workOrderWrapper.in(SalesLedgerWork::getSalesLedgerId, idList); |
| | | salesLedgerWorkMapper.delete(workOrderWrapper); |
| | | // 删除生产核算数据 |
| | | LambdaQueryWrapper<SalesLedgerProductionAccounting> reportWrapper = new LambdaQueryWrapper<>(); |
| | | reportWrapper.in(SalesLedgerProductionAccounting::getSalesLedgerId, idList); |
| | | salesLedgerProductionAccountingMapper.delete(reportWrapper); |
| | | //查询生产报工id |
| | | ArrayList<Long> mainIdList = productionProductMainService.listMain(idList); |
| | | if (CollectionUtils.isNotEmpty(mainIdList)) { |
| | | mainIdList.stream().forEach(mainId -> { |
| | | productionProductMainService.removeProductMain(mainId); |
| | | }); |
| | | } |
| | | // 2. 再删除主表数据 |
| | | return salesLedgerMapper.deleteBatchIds(idList); |
| | | } |