WfRoomApplicantNodeTest.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package com.xjrsoft.module.liteflow.node;
  2. import cn.hutool.core.convert.Convert;
  3. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  4. import com.xjrsoft.common.enums.RoomApplicantTypeEnum;
  5. import com.xjrsoft.common.enums.StudyStatusEnum;
  6. import com.xjrsoft.module.room.entity.WfRoomApplicant;
  7. import com.xjrsoft.module.room.mapper.WfRoomApplicantMapper;
  8. import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
  9. import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
  10. import org.junit.jupiter.api.Test;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.boot.test.context.SpringBootTest;
  13. import java.util.Map;
  14. import static org.junit.jupiter.api.Assertions.*;
  15. /**
  16. * @author dzx
  17. * @date 2024/4/19
  18. */
  19. @SpringBootTest
  20. class WfRoomApplicantNodeTest {
  21. @Autowired
  22. private WfRoomApplicantMapper wfRoomApplicantMapper;
  23. @Autowired
  24. private IBaseStudentSchoolRollService studentSchoolRollService;
  25. @Test
  26. public void process() throws Exception {
  27. // 获取表单中数据编号
  28. Long formId = Convert.toLong("1781242183456702464");
  29. if (formId != null) {
  30. //查询出数据
  31. WfRoomApplicant wfRoomApplicant = wfRoomApplicantMapper.selectById(formId);
  32. BaseStudentSchoolRoll schoolRoll = studentSchoolRollService.getOne(new QueryWrapper<BaseStudentSchoolRoll>().lambda().eq(BaseStudentSchoolRoll::getUserId, wfRoomApplicant.getApplicantUserId()));
  33. if(RoomApplicantTypeEnum.ToBeBoarder.getCode().equals(wfRoomApplicant.getRecedeType())){
  34. schoolRoll.setStduyStatus(StudyStatusEnum.InResidence.getCode());
  35. }else if(RoomApplicantTypeEnum.ToBeDayPupil.getCode().equals(wfRoomApplicant.getRecedeType())){
  36. schoolRoll.setStduyStatus(StudyStatusEnum.AttendDaySchool.getCode());
  37. }
  38. //修改学生班级
  39. studentSchoolRollService.updateById(schoolRoll);
  40. }
  41. }
  42. }