| | |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("frozenQuality") |
| | | @Log(title = "采购入库-库存管理-冻结不合格产品", businessType = BusinessType.UPDATE) |
| | | public AjaxResult frozenQuality(@RequestBody List<Integer> frozenIds) { |
| | | boolean result = procurementRecordService.frozenQuality(frozenIds); |
| | | if (result) { |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("thawQuality") |
| | | @Log(title = "采购入库-库存管理-解冻不合格产品", businessType = BusinessType.UPDATE) |
| | | public AjaxResult thawQuality(@RequestBody List<Integer> thawIds) { |
| | | boolean result = procurementRecordService.thawQuality(thawIds); |
| | | if (result) { |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | @GetMapping("/listPageCopyByProduction") |
| | | @Log(title = "生产入库-库存管理-分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageCopyByProduction(Page page, ProcurementPageDto procurementDto) { |
| | |
| | | |
| | | private Long productModelId; |
| | | |
| | | @ApiModelProperty(value = "是否冻结(0:未冻结 1:已冻结)") |
| | | @Excel(name = "是否冻结") |
| | | private Boolean isFrozen; |
| | | |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate endDate; |
| | | |
| | | @Excel(name = "是否冻结") |
| | | private Boolean isFrozen; |
| | | |
| | | } |
| | |
| | | private Long productModelId; |
| | | |
| | | private Long qualityInspectId; |
| | | |
| | | /** |
| | | * 是否冻结(0:未冻结 1:已冻结) |
| | | */ |
| | | private Boolean isFrozen; |
| | | } |
| | |
| | | IPage<ProductModel> listPageProductionStock(Page page, ProcurementPageDto procurementDto); |
| | | |
| | | IPage<ProcurementPageDto> listPageByProductProduction(Page page, ProcurementPageDto procurementDto); |
| | | |
| | | boolean frozenQuality(List<Integer> frozenIds); |
| | | |
| | | boolean thawQuality(List<Integer> thawIds); |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | return procurementPageDtoIPage; |
| | | } |
| | | |
| | | @Override |
| | | public boolean frozenQuality(List<Integer> frozenIds) { |
| | | if (frozenIds == null || frozenIds.isEmpty()) { |
| | | return true; |
| | | } |
| | | |
| | | LambdaUpdateWrapper<ProcurementRecordStorage> storageLambdaUpdateWrapper = new LambdaUpdateWrapper<ProcurementRecordStorage>() |
| | | .set(ProcurementRecordStorage::getIsFrozen, true) |
| | | .in(ProcurementRecordStorage::getId, frozenIds) |
| | | .eq(ProcurementRecordStorage::getIsFrozen, false); |
| | | |
| | | return update(storageLambdaUpdateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean thawQuality(List<Integer> thawIds) { |
| | | if (thawIds == null || thawIds.isEmpty()) { |
| | | return true; |
| | | } |
| | | |
| | | LambdaUpdateWrapper<ProcurementRecordStorage> storageLambdaUpdateWrapper = new LambdaUpdateWrapper<ProcurementRecordStorage>() |
| | | .set(ProcurementRecordStorage::getIsFrozen, false) |
| | | .in(ProcurementRecordStorage::getId, thawIds) |
| | | .eq(ProcurementRecordStorage::getIsFrozen, true); |
| | | |
| | | return update(storageLambdaUpdateWrapper); |
| | | } |
| | | |
| | | } |
| | |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_by, |
| | | t2.warn_num |
| | | t2.warn_num, |
| | | t1.is_frozen |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_by, |
| | | t2.warn_num |
| | | t2.warn_num, |
| | | t1.is_frozen |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | |
| | | t1.update_time, |
| | | t1.create_by, |
| | | t2.warn_num, |
| | | t2.product_id |
| | | t2.product_id, |
| | | t1.is_frozen |
| | | from procurement_record_storage t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getSumQuantity" resultType="BigDecimal"> |
| | | |
| | | <select id="getSumQuantity" resultType="java.math.BigDecimal"> |
| | | select COALESCE(sum(inbound_num), 0) |
| | | from procurement_record_storage |
| | | where product_model_id = #{productModelId} |
| | | where product_model_id = #{productModelId} and is_frozen = false |
| | | </select> |
| | | |
| | | <select id="listPageByProductProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto"> |
| | | select |
| | | t1.*, |