feat(config): 添加部门ID字段到Mybatis处理器
- 在MybatisHandler中新增deptId字段用于数据填充
- 从SecurityUtils获取部门ID并填充到实体对象
- 更新时间戳和用户名信息填充逻辑
fix(inspection): 修复定时任务异常处理和中文显示
- 将JobExecutionException替换为RuntimeException提高异常处理一致性
- 修正定时任务不存在和设备不存在的错误消息显示
- 更新巡检任务备注中的中文描述内容
refactor(sales): 移除销售台账产品控制器中的注释代码
- 删除采购页面DTO相关注释代码块
- 清理未使用的库存数量计算逻辑
- 优化控制器代码结构和可读性
| | |
| | | Integer userId = null; |
| | | Long tenantId = null; |
| | | String userName = null; |
| | | Long deptId = null; |
| | | try { |
| | | userId = SecurityUtils.getUserId().intValue(); |
| | | tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | userName = SecurityUtils.getUsername(); |
| | | deptId = SecurityUtils.getDeptId()[0]; |
| | | } catch (Exception ignored) { |
| | | } |
| | | this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now()); |
| | |
| | | this.strictInsertFill(metaObject, "updateUser", Long.class, userId == null ? 0 : userId.longValue()); |
| | | this.strictInsertFill(metaObject, "createUserName", String.class, userName); |
| | | this.strictInsertFill(metaObject, "updateUserName", String.class, userName); |
| | | this.strictInsertFill(metaObject, "deptId", Long.class, deptId); |
| | | |
| | | this.strictInsertFill(metaObject, "tenantId", Long.class, tenantId); |
| | | } |
| | |
| | | ); |
| | | TimingTask timingTask = tasks.isEmpty() ? null : tasks.get(0); |
| | | if (timingTask == null) { |
| | | throw new JobExecutionException("鎵句笉鍒板畾鏃朵换鍔? " + taskId); |
| | | throw new RuntimeException("定时任务不存在: " + taskId); |
| | | } |
| | | |
| | | List<Long> deviceIds = resolveTaskIds(timingTask); |
| | | if (deviceIds.isEmpty()) { |
| | | throw new JobExecutionException("瀹氭椂浠诲姟鏈厤缃澶? " + taskId); |
| | | throw new RuntimeException("设备不存在: " + taskId); |
| | | } |
| | | |
| | | for (Long deviceId : deviceIds) { |
| | |
| | | inspectionTask.setAreaId(deviceLedger.getAreaId()); |
| | | inspectionTask.setInspectorId(timingTask.getInspectorIds()); |
| | | inspectionTask.setInspectionLocation(timingTask.getInspectionLocation()); |
| | | inspectionTask.setRemarks("鑷姩鐢熸垚鑷畾鏃朵换鍔D: " + timingTask.getId()); |
| | | inspectionTask.setRemarks("定时生成设备巡检任务 ID: " + timingTask.getId()); |
| | | inspectionTask.setRegistrantId(timingTask.getRegistrantId()); |
| | | inspectionTask.setRegistrant(timingTask.getRegistrant()); |
| | | inspectionTask.setFrequencyType(timingTask.getFrequencyType()); |
| | |
| | | if (item.getFutureTicketsAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setFutureTicketsAmount(BigDecimal.ZERO); |
| | | } |
| | | // ProcurementPageDto procurementDto = new ProcurementPageDto(); |
| | | // procurementDto.setSalesLedgerProductId(item.getId()); |
| | | // procurementDto.setProductCategory(item.getProductCategory()); |
| | | // IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(new Page<>(1,-1), procurementDto); |
| | | // BigDecimal stockQuantity = stockUtils.getStockQuantity(item.getProductModelId()).get("stockQuantity"); |
| | | |
| | | // ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0); |
| | | if (item.getApproveStatus() != 2) { |
| | | if (item.getHasSufficientStock() == 0) { |
| | | item.setApproveStatus(0); |