dzx преди 8 месеца
родител
ревизия
3b37d3c30a

+ 1 - 1
src/main/java/com/xjrsoft/module/liteflow/node/WfStudentRepeatStudyNode.java

@@ -79,7 +79,7 @@ public class WfStudentRepeatStudyNode extends NodeComponent {
                             return;
                         }
                         HistoricProcessInstance historicProcessInstance = historicProcessInstanceOptional.get();
-                        if (historicProcessInstance.getState().equals(HistoricProcessInstance.STATE_COMPLETED)) {
+                        if (!historicProcessInstance.getState().equals(HistoricProcessInstance.STATE_ACTIVE)) {
                             String tableName = "wf_student_repeat_study";
                             Entity where = Entity.create(tableName);
                             where.set("id", formId);

+ 1 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseStudentSchoolRollService.java

@@ -60,6 +60,7 @@ public interface IBaseStudentSchoolRollService extends MPJBaseService<BaseStuden
     Long getClassIdByUserId(Long userId);
 
     Boolean activateStudent(Long userId);
+    Boolean activateStudent(Long userId, Long modifyUserId);
 
     Boolean disableStudent(Long userId);
 

+ 8 - 3
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -275,11 +275,16 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean activateStudent(Long userId) {
+        return activateStudent(userId, StpUtil.getLoginIdAsLong());
+    }
+
+    @Override
+    public Boolean activateStudent(Long userId, Long modifyUserId) {
         //激活用户信息
         User user = userMapper.selectById(userId);
         user.setDeleteMark(DeleteMark.NODELETE.getCode());
         user.setEnabledMark(EnabledMark.ENABLED.getCode());
-        user.setModifyUserId(StpUtil.getLoginIdAsLong());
+        user.setModifyUserId(modifyUserId);
         user.setModifyDate(LocalDateTime.now());
         userMapper.updateById(user);
 
@@ -294,7 +299,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
         schoolRoll.setDeleteMark(DeleteMark.NODELETE.getCode());
         schoolRoll.setEnabledMark(EnabledMark.ENABLED.getCode());
         schoolRoll.setArchivesStatus(ArchivesStatusEnum.FB2901.getCode());
-        schoolRoll.setModifyUserId(StpUtil.getLoginIdAsLong());
+        schoolRoll.setModifyUserId(modifyUserId);
         schoolRoll.setModifyDate(LocalDateTime.now());
         this.updateById(schoolRoll);
 
@@ -304,7 +309,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
                         .eq(BaseStudent::getUserId, userId)
         );
         baseStudent.setIsNormal(1);
-        baseStudent.setModifyUserId(StpUtil.getLoginIdAsLong());
+        baseStudent.setModifyUserId(modifyUserId);
         baseStudent.setModifyDate(LocalDateTime.now());
         baseStudentMapper.updateById(baseStudent);
 

+ 0 - 1
src/main/java/com/xjrsoft/module/student/service/impl/PbCseFeeobjupdateServiceImpl.java

@@ -355,7 +355,6 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
                         .eq(EnrollmentStatisticsInfo::getDeleteMark, DeleteMark.NODELETE.getCode())
                         .eq(EnrollmentStatisticsInfo::getEnabledMark, EnabledMark.ENABLED.getCode())
                         .eq(EnrollmentStatisticsInfo::getDataType, 3)
-                        .eq(EnrollmentStatisticsInfo::getDataDay, LocalDate.now())
                         .eq(StrUtil.isNotEmpty(dto.getStartDay()), EnrollmentStatisticsInfo::getDataStartDay, dto.getStartDay())
                         .eq(StrUtil.isNotEmpty(dto.getEndDay()), EnrollmentStatisticsInfo::getDataEndDay, dto.getEndDay())
                         .orderByDesc(EnrollmentStatisticsInfo::getCreateDate)

+ 129 - 0
src/test/java/com/xjrsoft/module/liteflow/node/WfStudentRepeatStudyNodeTest.java

@@ -0,0 +1,129 @@
+package com.xjrsoft.module.liteflow.node;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.db.Entity;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.XjrSoftApplication;
+import com.xjrsoft.common.enums.ArchivesStatusEnum;
+import com.xjrsoft.common.enums.StudentTypeEnum;
+import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.mapper.UserMapper;
+import com.xjrsoft.module.student.dto.AddBaseStudentContactDto;
+import com.xjrsoft.module.student.dto.AddBaseStudentDto;
+import com.xjrsoft.module.student.dto.AddBaseStudentFamilyDto;
+import com.xjrsoft.module.student.dto.AddBaseStudentFamilyMemberDto;
+import com.xjrsoft.module.student.dto.AddBaseStudentSchoolRollDto;
+import com.xjrsoft.module.student.dto.AddBaseStudentSubsidizeDto;
+import com.xjrsoft.module.student.dto.AddBaseStudentUserDto;
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.service.IStudentManagerService;
+import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * @author dzx
+ * @date 2025/4/1
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = XjrSoftApplication.class)
+class WfStudentRepeatStudyNodeTest {
+
+    @Autowired
+    private IStudentManagerService studentService;
+
+    @Autowired
+    private IWorkflowExecuteService workflowExecuteService;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private IBaseStudentSchoolRollService schoolRollService;
+
+    @Test
+    void test(){
+        Long formId = 1906987877859340288L;
+
+        String tableName = "wf_student_repeat_study";
+        Entity where = Entity.create(tableName);
+        where.set("id", formId);
+        Map<String, Object> objectMap = SqlRunnerAdapter.db().dynamicSelectOne(tableName, where);
+        int isOriginal = Integer.parseInt(objectMap.get("is_original").toString());
+
+        String credentialNumber = objectMap.get("credential_number").toString();
+
+        User user = userMapper.selectOne(
+                new MPJLambdaWrapper<User>()
+                        .disableLogicDel()
+                        .select(User::getId)
+                        .select(User.class, x -> VoToColumnUtil.fieldsToColumns(User.class).contains(x.getProperty()))
+                        .eq(User::getCredentialNumber, credentialNumber)
+        );
+
+        if(isOriginal == 0 && user == null){
+            AddBaseStudentUserDto baseStudentUser = new AddBaseStudentUserDto();
+            baseStudentUser.setName(objectMap.get("name").toString());
+            baseStudentUser.setCredentialType("ZZLS10007");
+            baseStudentUser.setCredentialNumber(objectMap.get("credential_number").toString());
+            baseStudentUser.setMobile(objectMap.get("mobile").toString());
+            baseStudentUser.setUserName(objectMap.get("credential_number").toString());
+
+            List<AddBaseStudentSchoolRollDto> baseStudentSchoolRollList = new ArrayList<>();
+            AddBaseStudentSchoolRollDto rollDto = new AddBaseStudentSchoolRollDto();
+            rollDto.setStduyStatus(objectMap.get("stduy_status").toString());
+            rollDto.setStduyStatus(ArchivesStatusEnum.FB2901.getCode());
+            rollDto.setMajorSetId(Long.parseLong(objectMap.get("major_set_id").toString()));
+            rollDto.setStudentType(StudentTypeEnum.FB2801.getCode());
+            rollDto.setClassId(Long.parseLong(objectMap.get("class_id").toString()));
+            rollDto.setGradeId(Long.parseLong(objectMap.get("grade_id").toString()));
+            baseStudentSchoolRollList.add(rollDto);
+            baseStudentUser.setBaseStudentSchoolRollList(baseStudentSchoolRollList);
+
+            List<AddBaseStudentDto> baseStudentList = new ArrayList<>();
+            AddBaseStudentDto studentDto = new AddBaseStudentDto();
+            studentDto.setIsMigrateChildren(0);
+            studentDto.setStudentId(baseStudentUser.getCredentialNumber());
+            studentDto.setIsFloatingPopulation(0);
+            baseStudentList.add(studentDto);
+            baseStudentUser.setBaseStudentList(baseStudentList);
+
+            List<AddBaseStudentContactDto> baseStudentContactList = new ArrayList<>();
+            baseStudentContactList.add(new AddBaseStudentContactDto());
+            baseStudentUser.setBaseStudentContactList(baseStudentContactList);
+
+            List<AddBaseStudentFamilyDto> baseStudentFamilyList = new ArrayList<>();
+            baseStudentFamilyList.add(new AddBaseStudentFamilyDto());
+            baseStudentUser.setBaseStudentFamilyList(baseStudentFamilyList);
+
+            List<AddBaseStudentFamilyMemberDto> baseStudentFamilyMemberList = new ArrayList<>();
+            baseStudentFamilyMemberList.add(new AddBaseStudentFamilyMemberDto());
+            baseStudentUser.setBaseStudentFamilyMemberList(baseStudentFamilyMemberList);
+
+            List<AddBaseStudentSubsidizeDto> baseStudentSubsidizeList = new ArrayList<>();
+            baseStudentUser.setBaseStudentSubsidizeList(baseStudentSubsidizeList);
+
+            studentService.add(baseStudentUser);
+        }else{
+            schoolRollService.activateStudent(user.getId());
+            schoolRollService.updateStudentClassGradeMajorStduyStatus(
+                    Long.parseLong(objectMap.get("class_id").toString()),
+                    Long.parseLong(objectMap.get("grade_id").toString()),
+                    Long.parseLong(objectMap.get("major_set_id").toString()),
+                    objectMap.get("stduy_status").toString(),
+                    user.getId()
+            );
+        }
+    }
+}