Merge branch 'dev_新疆马铃薯pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_新疆马铃薯pro
| | |
| | | |
| | | @Schema(description = "出库批号") |
| | | private String outboundBatches; |
| | | |
| | | @Schema(description = "当前用户ID(查询时自动注入,用于过滤申请人和审核人)") |
| | | private Long currentUserId; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R listPage(Page<ApprovalInstanceVo> page, ApprovalInstanceDto approvalInstanceDto) { |
| | | // 注入当前用户ID,用于过滤只查看申请人和审核人是自己的数据 |
| | | approvalInstanceDto.setCurrentUserId(SecurityUtils.getUserId()); |
| | | IPage<ApprovalInstanceVo> approvalInstanceVoIPage = approvalInstanceMapper.listPage(page, approvalInstanceDto); |
| | | |
| | | List<ApprovalInstanceVo> records = approvalInstanceVoIPage.getRecords(); |
| | |
| | | <if test="ew.applicantName != null and ew.applicantName !=''"> |
| | | and ai.applicant_name = #{ew.applicantName} |
| | | </if> |
| | | <if test="ew.currentUserId != null"> |
| | | and (ai.applicant_id = #{ew.currentUserId} |
| | | or exists (select 1 from approval_task at2 |
| | | where at2.instance_id = ai.id |
| | | and at2.approver_id = #{ew.currentUserId} |
| | | and at2.deleted = 0)) |
| | | </if> |
| | | </where> |
| | | order by ai.create_time desc |
| | | </select> |