1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package com.xjrsoft.module.liteflow.node;
- import cn.hutool.core.convert.Convert;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.xjrsoft.common.enums.RoomApplicantTypeEnum;
- import com.xjrsoft.common.enums.StudyStatusEnum;
- import com.xjrsoft.module.room.entity.WfRoomApplicant;
- import com.xjrsoft.module.room.mapper.WfRoomApplicantMapper;
- import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
- import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
- import org.junit.jupiter.api.Test;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.boot.test.context.SpringBootTest;
- import java.util.Map;
- import static org.junit.jupiter.api.Assertions.*;
- /**
- * @author dzx
- * @date 2024/4/19
- */
- @SpringBootTest
- class WfRoomApplicantNodeTest {
- @Autowired
- private WfRoomApplicantMapper wfRoomApplicantMapper;
- @Autowired
- private IBaseStudentSchoolRollService studentSchoolRollService;
- @Test
- public void process() throws Exception {
- // 获取表单中数据编号
- Long formId = Convert.toLong("1781242183456702464");
- if (formId != null) {
- //查询出数据
- WfRoomApplicant wfRoomApplicant = wfRoomApplicantMapper.selectById(formId);
- BaseStudentSchoolRoll schoolRoll = studentSchoolRollService.getOne(new QueryWrapper<BaseStudentSchoolRoll>().lambda().eq(BaseStudentSchoolRoll::getUserId, wfRoomApplicant.getApplicantUserId()));
- if(RoomApplicantTypeEnum.ToBeBoarder.getCode().equals(wfRoomApplicant.getRecedeType())){
- schoolRoll.setStduyStatus(StudyStatusEnum.InResidence.getCode());
- }else if(RoomApplicantTypeEnum.ToBeDayPupil.getCode().equals(wfRoomApplicant.getRecedeType())){
- schoolRoll.setStduyStatus(StudyStatusEnum.AttendDaySchool.getCode());
- }
- //修改学生班级
- studentSchoolRollService.updateById(schoolRoll);
- }
- }
- }
|