PmAuditDeptRefController.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package com.ozs.web.controller.pm;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.ozs.common.core.controller.BaseController;
  4. import com.ozs.common.core.domain.AjaxResult;
  5. import com.ozs.common.core.domain.entity.SysDept;
  6. import com.ozs.pm.doman.PmAuditDeptRef;
  7. import com.ozs.pm.service.PmAuditDeptRefService;
  8. import io.swagger.annotations.Api;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.util.ObjectUtils;
  11. import org.springframework.web.bind.annotation.PostMapping;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import java.util.List;
  16. @Api(tags = "审核关联")
  17. @RestController
  18. @RequestMapping("/pm/audit")
  19. public class PmAuditDeptRefController extends BaseController {
  20. @Autowired
  21. private PmAuditDeptRefService pmAuditDeptRefService;
  22. @Autowired
  23. private com.ozs.system.service.ISysDeptService deptService;
  24. @PostMapping("/list")
  25. public AjaxResult list(@RequestBody PmAuditDeptRef vo) {
  26. LambdaQueryWrapper<PmAuditDeptRef> lw = new LambdaQueryWrapper();
  27. lw.eq(PmAuditDeptRef::getRefId, vo.getRefId());
  28. lw.eq(PmAuditDeptRef::getRefType, vo.getRefType());
  29. List<PmAuditDeptRef> list = pmAuditDeptRefService.list(lw);
  30. if (!ObjectUtils.isEmpty(list)) {
  31. for (PmAuditDeptRef pmAuditDeptRef : list) {
  32. com.ozs.common.core.domain.entity.SysDept d = deptService.selectById(pmAuditDeptRef.getDeptId());
  33. if (!ObjectUtils.isEmpty(d)) {
  34. pmAuditDeptRef.setDeptName(d.getDeptName());
  35. }
  36. pmAuditDeptRef.setStatusStr(pmAuditDeptRef.getStatus().equals(Integer.parseInt("0")) ? "待审核" : "已审核");
  37. }
  38. }
  39. return success(list);
  40. }
  41. }