src/main/java/com/ruoyi/home/service/impl/HomeServiceImpl.java
@@ -456,6 +456,7 @@ // 审批协同待办 Long aLong = approveProcessMapper.selectCount(new LambdaQueryWrapper<ApproveProcess>() .eq(ApproveProcess::getApproveUserCurrentId, SecurityUtils.getUserId()) .eq(ApproveProcess::getApproveDelete, 0) .in(ApproveProcess::getApproveStatus, 0, 1, 3)); // 设备报修待办 Long aLong1 = deviceRepairMapper.selectCount(new LambdaQueryWrapper<DeviceRepair>() src/main/java/com/ruoyi/inspectiontask/pojo/InspectionTask.java
@@ -89,4 +89,6 @@ @TableField(fill = FieldFill.INSERT) private Long tenantId; @TableField(exist = false) private String dateStr; } src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -151,6 +152,8 @@ dto.setInspector(inspectorNames); } dto.setDateStr(inspectionTask.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); // 初始化三个附件列表 dto.setBeforeProduction(new ArrayList<>()); dto.setAfterProduction(new ArrayList<>()); src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
@@ -80,12 +80,19 @@ } @PostMapping("/updateManagement") @Log(title = "采购入库-库存台账-修改", businessType = BusinessType.UPDATE) @Log(title = "成品入库-库存台账-修改", businessType = BusinessType.UPDATE) @Transactional public AjaxResult updateManagement(@RequestBody ProcurementManagementUpdateDto procurementDto) { return AjaxResult.success(procurementRecordService.updateManagement(procurementDto)); } @PostMapping("/updateManagementByCustom") @Log(title = "自定义入库-库存台账-修改", businessType = BusinessType.UPDATE) @Transactional public AjaxResult updateManagementByCustom(@RequestBody ProcurementManagementUpdateDto procurementDto) { return AjaxResult.success(procurementRecordService.updateManagementByCustom(procurementDto)); } @PostMapping("/del") @Log(title = "采购入库-入库管理-删除入库", businessType = BusinessType.DELETE) @Transactional src/main/java/com/ruoyi/procurementrecord/dto/ProcurementManagementUpdateDto.java
@@ -17,6 +17,22 @@ private String createBy; private BigDecimal minStock; /** * 单价 */ private BigDecimal unitPrice; /** * 总价 */ private BigDecimal totalPrice; // 单价 private BigDecimal taxInclusiveUnitPrice; // 总价 private BigDecimal taxInclusiveTotalPrice; private Long createUser; private String createTime; src/main/java/com/ruoyi/procurementrecord/dto/ProcurementUpdateDto.java
@@ -18,6 +18,10 @@ private BigDecimal quantityStock; private BigDecimal unitPrice; private BigDecimal totalPrice; private List<Integer> ids; /** src/main/java/com/ruoyi/procurementrecord/service/ProcurementRecordService.java
@@ -52,4 +52,6 @@ AjaxResult updateCustom(CustomStorage customStorage); AjaxResult deleteCustom(List<Long> ids); int updateManagementByCustom(ProcurementManagementUpdateDto procurementDto); } src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -110,6 +110,8 @@ procurementRecordStorageById.setWarnNum(procurementDto.getWarnNum()); procurementRecordStorageById.setUpdateUser(SecurityUtils.getLoginUser().getUserId()); procurementRecordStorageById.setUpdateTime(LocalDateTime.now()); procurementRecordStorageById.setUnitPrice(procurementDto.getUnitPrice()); procurementRecordStorageById.setTotalPrice(procurementDto.getTotalPrice()); return procurementRecordMapper.updateById(procurementRecordStorageById); } @@ -193,15 +195,28 @@ if(salesLedgerProduct == null){ throw new RuntimeException("销售台账产品不存在"); } // 根据大类,规格查询所有产品id LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); salesLedgerProductLambdaQueryWrapper.eq(SalesLedgerProduct::getProductCategory, salesLedgerProduct.getProductCategory()) .eq(SalesLedgerProduct::getSpecificationModel, salesLedgerProduct.getSpecificationModel()) .eq(SalesLedgerProduct::getType, 1); List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectList(salesLedgerProductLambdaQueryWrapper); if(CollectionUtils.isEmpty(salesLedgerProducts)){ throw new RuntimeException("没有找到对应的产品"); } salesLedgerProduct.setMinStock(procurementDto.getMinStock()); salesLedgerProductMapper.updateById(salesLedgerProduct); ProcurementRecordStorage procurementRecordStorageById = getProcurementRecordById(procurementDto.getId()); procurementRecordStorageById.setCreateBy(sysUser.getNickName()); procurementRecordStorageById.setCreateUser(sysUser.getUserId()); procurementRecordStorageById.setUpdateTime(LocalDateTime.parse(entryDateStr,df)); procurementRecordStorageById.setUpdateUser(loginUser.getUserId()); procurementRecordStorageById.setCreateTime(LocalDateTime.parse(createTimeStr,df)); procurementRecordMapper.updateById(procurementRecordStorageById); LambdaQueryWrapper<ProcurementRecordStorage> procurementRecordStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); procurementRecordStorageLambdaQueryWrapper.in(ProcurementRecordStorage::getSalesLedgerProductId, salesLedgerProducts.stream().map(SalesLedgerProduct::getId).collect(Collectors.toList())); ProcurementRecordStorage procurementRecordStorage = ProcurementRecordStorage.builder().build(); procurementRecordStorage.setUnitPrice(procurementDto.getUnitPrice()); procurementRecordStorage.setTotalPrice(procurementDto.getTotalPrice()); procurementRecordStorage.setCreateBy(sysUser.getNickName()); procurementRecordStorage.setCreateUser(sysUser.getUserId()); procurementRecordStorage.setUpdateTime(LocalDateTime.parse(entryDateStr,df)); procurementRecordStorage.setUpdateUser(loginUser.getUserId()); procurementRecordStorage.setCreateTime(LocalDateTime.parse(createTimeStr,df)); procurementRecordMapper.update(procurementRecordStorage,procurementRecordStorageLambdaQueryWrapper); return 0; } @@ -632,6 +647,21 @@ } @Override public int updateManagementByCustom(ProcurementManagementUpdateDto procurementDto) { CustomStorage customStorage = customStorageMapper.selectById(procurementDto.getId()); if(customStorage == null){ throw new RuntimeException("材料库存不存在"); } LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); customStorageLambdaQueryWrapper.eq(CustomStorage::getProductCategory, customStorage.getProductCategory()) .eq(CustomStorage::getSpecificationModel, customStorage.getSpecificationModel()); CustomStorage one = new CustomStorage(); one.setTaxInclusiveUnitPrice(procurementDto.getTaxInclusiveUnitPrice()); one.setTaxInclusiveTotalPrice(procurementDto.getTaxInclusiveTotalPrice()); return customStorageMapper.update(one,customStorageLambdaQueryWrapper); } @Override public int add(ProcurementAddDto procurementDto) { LoginUser loginUser = SecurityUtils.getLoginUser(); // 批量新增 src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
@@ -58,7 +58,7 @@ @Override public IPage<SalesLedgerSchedulingDto> listPage(Page page, SalesLedgerSchedulingDto salesLedgerSchedulingDto) { IPage<SalesLedgerSchedulingDto> list = salesLedgerSchedulingMapper.listPage(page, salesLedgerSchedulingDto); if(list.getTotal() == 0){ if(CollectionUtils.isEmpty(list.getRecords())){ return list; } Set<Long> collect = list.getRecords().stream().map(SalesLedgerSchedulingDto::getSalesLedgerProductId).collect(Collectors.toSet()); @@ -66,7 +66,6 @@ salesLedgerWorkLambdaQueryWrapper.in(SalesLedgerWork::getSalesLedgerProductId, collect) .ne(SalesLedgerWork::getStatus, 1); List<SalesLedgerWork> salesLedgerWorks = salesLedgerWorkMapper.selectList(salesLedgerWorkLambdaQueryWrapper); List<SalesLedgerSchedulingDto> list1 = new ArrayList<>(); list.getRecords().forEach(i -> { // 获取完成数量 i.setSuccessNum(salesLedgerWorks @@ -301,12 +300,6 @@ @Override public IPage<SalesLedgerSchedulingProcessDto> listPageProcess(Page page, SalesLedgerSchedulingProcessDto salesLedgerSchedulingDto) { IPage<SalesLedgerSchedulingProcessDto> list = salesLedgerSchedulingMapper.listPageProcess(page, salesLedgerSchedulingDto); // Set<Long> collect = list.getRecords().stream().map(SalesLedgerSchedulingProcessDto::getId).collect(Collectors.toSet()); // if(CollectionUtils.isEmpty(collect)) return list; // LambdaQueryWrapper<SalesLedgerWork> salesLedgerWorkLambdaQueryWrapper = new LambdaQueryWrapper<>(); // salesLedgerWorkLambdaQueryWrapper.in(SalesLedgerWork::getSalesLedgerSchedulingId, collect) // .ne(SalesLedgerWork::getStatus, 1); // List<SalesLedgerWork> salesLedgerWorks = salesLedgerWorkMapper.selectList(salesLedgerWorkLambdaQueryWrapper); list.getRecords().forEach(i -> { // 计算生产总量 = 规格 * 数量 / 1000 String[] split = i.getSpecificationModel().split("\\*");