|
|
@@ -4,15 +4,18 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.MaterialCategoryEnum;
|
|
|
import com.xjrsoft.common.utils.RedisUtil;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.config.CommonPropertiesConfig;
|
|
|
+import com.xjrsoft.module.concat.service.IXjrUserService;
|
|
|
import com.xjrsoft.module.form.dto.FormExecuteAddOrUpdateDto;
|
|
|
import com.xjrsoft.module.form.service.IFormExecuteService;
|
|
|
import com.xjrsoft.module.material.dto.*;
|
|
|
@@ -31,8 +34,10 @@ import com.xjrsoft.module.organization.entity.User;
|
|
|
import com.xjrsoft.module.organization.entity.UserDeptRelation;
|
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
|
import com.xjrsoft.module.organization.service.IWeChatService;
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
+import com.xjrsoft.module.teacher.vo.XjrUserVo;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -59,7 +64,7 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
|
|
|
|
|
|
private final IMaterialTypeService materialTypeService;
|
|
|
private final IWeChatService weChatService;
|
|
|
-
|
|
|
+ private final IXjrUserService xjrUserService;
|
|
|
private final IFormExecuteService formExecuteService;
|
|
|
|
|
|
private final CommonPropertiesConfig commonPropertiesConfig;
|
|
|
@@ -73,17 +78,56 @@ public class MaterialTaskServiceImpl extends MPJBaseServiceImpl<MaterialTaskMapp
|
|
|
materialTask.setAssignPerson(dto.getUserList().size());
|
|
|
}
|
|
|
materialTaskMaterialTaskMapper.insert(materialTask);
|
|
|
+
|
|
|
//新增任务人
|
|
|
for (MaterialAssignUserDto materialAssignUserDto : dto.getUserList()){
|
|
|
- materialTaskMaterialTaskAssignMapper.insert(new MaterialTaskAssign(){{
|
|
|
- setMaterialTaskId(materialTask.getId());
|
|
|
- setUserId(materialAssignUserDto.getUserId());
|
|
|
- setUserType(materialAssignUserDto.getUserType());
|
|
|
- setUserNumber(materialAssignUserDto.getUserNumber());
|
|
|
- setStatus(1);
|
|
|
- setExecutiveStatus(1);
|
|
|
- setSendMessage(dto.getSendMessage());
|
|
|
- }});
|
|
|
+ if(materialAssignUserDto.getUserType() == 1){
|
|
|
+ List<XjrUserVo> xjrUserVos = xjrUserService.selectJoinList(XjrUserVo.class,
|
|
|
+ new MPJLambdaWrapper<XjrUser>()
|
|
|
+ .leftJoin(UserDeptRelation.class, UserDeptRelation::getUserId, XjrUser::getId)
|
|
|
+ .eq(UserDeptRelation::getDeptId, materialAssignUserDto.getUserId())
|
|
|
+ .eq(XjrUser::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ );
|
|
|
+ for (XjrUserVo xjrUserVo : xjrUserVos) {
|
|
|
+ materialTaskMaterialTaskAssignMapper.insert(new MaterialTaskAssign(){{
|
|
|
+ setMaterialTaskId(materialTask.getId());
|
|
|
+ setUserId(xjrUserVo.getId());
|
|
|
+ setUserType(materialAssignUserDto.getUserType());
|
|
|
+ setUserNumber(xjrUserVo.getName());
|
|
|
+ setStatus(1);
|
|
|
+ setExecutiveStatus(1);
|
|
|
+ setSendMessage(dto.getSendMessage());
|
|
|
+ }});
|
|
|
+ }
|
|
|
+ }else if(materialAssignUserDto.getUserType() == 2){
|
|
|
+ List<XjrUserVo> xjrUserVos = xjrUserService.selectJoinList(XjrUserVo.class,
|
|
|
+ new MPJLambdaWrapper<XjrUser>()
|
|
|
+ .leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, XjrUser::getId)
|
|
|
+ .eq(BaseStudentSchoolRoll::getClassId, materialAssignUserDto.getUserId())
|
|
|
+ .eq(XjrUser::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ );
|
|
|
+ for (XjrUserVo xjrUserVo : xjrUserVos) {
|
|
|
+ materialTaskMaterialTaskAssignMapper.insert(new MaterialTaskAssign(){{
|
|
|
+ setMaterialTaskId(materialTask.getId());
|
|
|
+ setUserId(xjrUserVo.getId());
|
|
|
+ setUserType(materialAssignUserDto.getUserType());
|
|
|
+ setUserNumber(xjrUserVo.getName());
|
|
|
+ setStatus(1);
|
|
|
+ setExecutiveStatus(1);
|
|
|
+ setSendMessage(dto.getSendMessage());
|
|
|
+ }});
|
|
|
+ }
|
|
|
+ }else if(materialAssignUserDto.getUserType() == 3){
|
|
|
+ materialTaskMaterialTaskAssignMapper.insert(new MaterialTaskAssign(){{
|
|
|
+ setMaterialTaskId(materialTask.getId());
|
|
|
+ setUserId(materialAssignUserDto.getUserId());
|
|
|
+ setUserType(materialAssignUserDto.getUserType());
|
|
|
+ setUserNumber(materialAssignUserDto.getUserNumber());
|
|
|
+ setStatus(1);
|
|
|
+ setExecutiveStatus(1);
|
|
|
+ setSendMessage(dto.getSendMessage());
|
|
|
+ }});
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// materialTaskMaterialTaskMapper.insert(materialTask);
|