|
@@ -6,6 +6,9 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.db.Entity;
|
|
import cn.hutool.db.Entity;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import com.google.gson.JsonArray;
|
|
|
|
|
+import com.google.gson.JsonElement;
|
|
|
|
|
+import com.google.gson.JsonParser;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
|
|
import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
|
|
@@ -109,26 +112,30 @@ public class ActivityInfoController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<ActivityEnrollRangeVo> userRelationList = new ArrayList<>();
|
|
List<ActivityEnrollRangeVo> userRelationList = new ArrayList<>();
|
|
|
- for (ActivityEnroll jsonElement : activityInfo.getActivityEnrollList()) {
|
|
|
|
|
- ActivityEnrollRangeVo relationDto = BeanUtil.toBean(jsonElement, ActivityEnrollRangeVo.class);
|
|
|
|
|
- if(relationDto.getUserId() != null){
|
|
|
|
|
- XjrUser xjrUser = xjrUserService.getById(relationDto.getUserId());
|
|
|
|
|
- if(xjrUser != null){
|
|
|
|
|
- relationDto.setName(xjrUser.getName());
|
|
|
|
|
- }
|
|
|
|
|
- }else if(relationDto.getDeptId() != null){
|
|
|
|
|
- Department department = departmentService.getById(relationDto.getDeptId());
|
|
|
|
|
- if(department != null){
|
|
|
|
|
- relationDto.setName(department.getName());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }else if(relationDto.getClassId() != null){
|
|
|
|
|
- BaseClass aClass = classService.getById(relationDto.getClassId());
|
|
|
|
|
- if(aClass != null){
|
|
|
|
|
- relationDto.setName(aClass.getName());
|
|
|
|
|
|
|
+ if(activityInfo.getEnrollRange() != null && !activityInfo.getEnrollRange().isEmpty()){
|
|
|
|
|
+ JsonParser parser = new JsonParser();
|
|
|
|
|
+ JsonArray asJsonArray = parser.parse(activityInfo.getEnrollRange()).getAsJsonArray();
|
|
|
|
|
+ for (JsonElement jsonElement : asJsonArray) {
|
|
|
|
|
+ ActivityEnrollRangeVo relationDto = BeanUtil.toBean(jsonElement.getAsJsonObject().toString(), ActivityEnrollRangeVo.class);
|
|
|
|
|
+ if(relationDto.getUserId() != null){
|
|
|
|
|
+ XjrUser xjrUser = xjrUserService.getById(relationDto.getUserId());
|
|
|
|
|
+ if(xjrUser != null){
|
|
|
|
|
+ relationDto.setName(xjrUser.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(relationDto.getDeptId() != null){
|
|
|
|
|
+ Department department = departmentService.getById(relationDto.getDeptId());
|
|
|
|
|
+ if(department != null){
|
|
|
|
|
+ relationDto.setName(department.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }else if(relationDto.getClassId() != null){
|
|
|
|
|
+ BaseClass aClass = classService.getById(relationDto.getClassId());
|
|
|
|
|
+ if(aClass != null){
|
|
|
|
|
+ relationDto.setName(aClass.getName());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ userRelationList.add(relationDto);
|
|
|
}
|
|
}
|
|
|
- userRelationList.add(relationDto);
|
|
|
|
|
}
|
|
}
|
|
|
infoVo.setActivityEnrollRangeList(userRelationList);
|
|
infoVo.setActivityEnrollRangeList(userRelationList);
|
|
|
|
|
|