OaJudgeController.java 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. package com.pj.api.pushfee.oa;
  2. import cn.hutool.json.JSONUtil;
  3. import com.pj.project.tb_business.TbBusinessService;
  4. import com.pj.utils.sg.AjaxJson;
  5. import lombok.extern.slf4j.Slf4j;
  6. import org.springframework.http.MediaType;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import javax.annotation.Resource;
  12. @RequestMapping("oa")
  13. @RestController
  14. @Slf4j
  15. public class OaJudgeController {
  16. @Resource
  17. private TbBusinessService tbBusinessService;
  18. @PostMapping(value = "approveCallback",
  19. consumes = MediaType.APPLICATION_JSON_VALUE,
  20. produces = {"application/json; charset=UTF-8"})
  21. public AjaxJson approveCallback(@RequestBody String req) {
  22. log.info("oa审批回调:{}", req);
  23. CallbackBO callbackBO=JSONUtil.toBean(req,CallbackBO.class);
  24. tbBusinessService.approveCallback(callbackBO);
  25. return AjaxJson.getSuccess();
  26. }
  27. }