| | |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | |
| | | private final QualityInspectMapper qualityInspectMapper; |
| | | private final QualityTestStandardBindingMapper qualityTestStandardBindingMapper; |
| | | private final QualityTestStandardParamMapper qualityTestStandardParamMapper; |
| | | private final QualityTestStandardMapper qualityTestStandardMapper; |
| | | private final QualityInspectParamMapper qualityInspectParamMapper; |
| | | |
| | | private final ProcurementRecordMapper procurementRecordStorageMapper; |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | | |
| | |
| | | qualityInspect.setUnit(saleProduct.getUnit()); |
| | | qualityInspect.setQuantity(saleProduct.getQuantity()); |
| | | qualityInspectMapper.insert(qualityInspect); |
| | | List<QualityTestStandardBinding> qualityTestStandardBindings = qualityTestStandardBindingMapper.selectList( |
| | | new LambdaQueryWrapper<QualityTestStandardBinding>() |
| | | .eq(QualityTestStandardBinding::getProductId, saleProduct.getProductId())); |
| | | if (qualityTestStandardBindings.size()>0){ |
| | | List<QualityTestStandard> qualityTestStandard = qualityTestStandardMapper.getQualityTestStandardByProductId(saleProduct.getProductId(), 0,null); |
| | | if (qualityTestStandard.size()>0){ |
| | | qualityInspect.setTestStandardId(qualityTestStandard.get(0).getId()); |
| | | qualityInspectMapper.updateById(qualityInspect); |
| | | qualityTestStandardParamMapper.selectList(Wrappers.<QualityTestStandardParam>lambdaQuery() |
| | | .eq(QualityTestStandardParam::getTestStandardId,qualityTestStandardBindings.get(0).getTestStandardId())) |
| | | .eq(QualityTestStandardParam::getTestStandardId,qualityTestStandard.get(0).getId())) |
| | | .forEach(qualityTestStandardParam -> { |
| | | QualityInspectParam param = new QualityInspectParam(); |
| | | com.ruoyi.common.utils.bean.BeanUtils.copyProperties(qualityTestStandardParam, param); |
| | |
| | | if (ids == null || ids.length == 0) { |
| | | throw new BaseException("请选中至少一条数据"); |
| | | } |
| | | // 批量删除关联的采购入库记录 |
| | | LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductQueryWrapper = new LambdaQueryWrapper<>(); |
| | | salesLedgerProductQueryWrapper.in(SalesLedgerProduct::getSalesLedgerId, ids) |
| | | .eq(SalesLedgerProduct::getType, 2); |
| | | List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectList(salesLedgerProductQueryWrapper); |
| | | if (CollectionUtils.isNotEmpty(salesLedgerProducts)) { |
| | | salesLedgerProducts.stream().forEach(salesLedgerProduct -> { |
| | | // 批量删除关联的采购台账产品 |
| | | LambdaQueryWrapper<ProcurementRecordStorage> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ProcurementRecordStorage::getSalesLedgerProductId, salesLedgerProduct.getId()); |
| | | procurementRecordStorageMapper.delete(queryWrapper); |
| | | }); |
| | | } |
| | | // 批量删除关联的采购台账产品 |
| | | LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(SalesLedgerProduct::getSalesLedgerId, ids) |