Ver código fonte

解决留宿申请后通知家长重复问题

dzx 8 meses atrás
pai
commit
4a0d23ca35

+ 5 - 0
src/main/java/com/xjrsoft/module/room/service/impl/WfRoomApplicantServiceImpl.java

@@ -21,7 +21,9 @@ import com.xjrsoft.module.room.mapper.WfRoomApplicantMapper;
 import com.xjrsoft.module.room.service.IWfRoomApplicantService;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper;
+import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
 import lombok.AllArgsConstructor;
+import org.camunda.bpm.engine.history.HistoricProcessInstance;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -84,10 +86,13 @@ public class WfRoomApplicantServiceImpl extends MPJBaseServiceImpl<WfRoomApplica
         WfRoomApplicant applicant = this.getById(id);
         List<User> list = userService.list(
                 new MPJLambdaWrapper<User>()
+                        .distinct()
                         .select(User::getId)
                         .select(User.class, x -> VoToColumnUtil.fieldsToColumns(User.class).contains(x.getProperty()))
                         .innerJoin(UserStudent.class, UserStudent::getUserId, User::getId)
+                        .innerJoin(WorkflowFormRelation.class, WorkflowFormRelation::getFormKeyValue, UserStudent::getId)
                         .eq(UserStudent::getStudentId, applicant.getApplicantUserId())
+                        .eq(WorkflowFormRelation::getCurrentState, HistoricProcessInstance.STATE_COMPLETED)
                         .isNotNull(User::getOpenId)
         );
         SimpleDateFormat sdf = new SimpleDateFormat("yyy年MM月dd日");