|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
package com.foreverwin.mesnac.dispatch.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.foreverwin.mesnac.common.dto.UsrDto;
|
|
|
|
|
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
|
|
|
|
import com.foreverwin.mesnac.common.service.UserService;
|
|
|
|
|
import com.foreverwin.mesnac.dispatch.dto.UserResourceDto;
|
|
|
|
|
import com.foreverwin.mesnac.dispatch.mapper.UserResourceMapper;
|
|
|
|
|
import com.foreverwin.mesnac.dispatch.model.UserResource;
|
|
|
|
@ -13,7 +13,6 @@ import com.foreverwin.mesnac.meapi.service.NwaUserService;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.service.ResrceService;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BusinessException;
|
|
|
|
|
import com.foreverwin.modular.core.util.CommonMethods;
|
|
|
|
|
import com.foreverwin.modular.core.util.FrontPage;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@ -45,6 +44,10 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
|
|
|
|
|
@Autowired
|
|
|
|
|
private NwaUserService nwaUserService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserService userService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<NwaUser> findEmployeeList(String site) {
|
|
|
|
|
return userResourceMapper.findEmployeeList(site);
|
|
|
|
@ -62,7 +65,9 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
|
|
|
|
|
String userId = userResourceDto.getUserId();
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> hashMap = new HashMap<>();;
|
|
|
|
|
List<NwaUser> nwaUserList = nwaUserService.selectList(null);
|
|
|
|
|
// List<NwaUser> nwaUserList = nwaUserService.selectList(null);
|
|
|
|
|
List<UsrDto> nwaUserList = userService.findList(null);
|
|
|
|
|
|
|
|
|
|
List<UserResourceDto> userResourceList = userResourceMapper.findAll(site, resource, userId);
|
|
|
|
|
hashMap.put("users",nwaUserList);
|
|
|
|
|
hashMap.put("userResources",userResourceList);
|
|
|
|
@ -88,14 +93,15 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
|
|
|
|
|
userResource.setUserId(userResourceDto.getUserId());
|
|
|
|
|
userResource.setTemporaryUser(userResourceDto.getTemporaryUser());
|
|
|
|
|
userResource.setUserDescription(userResourceDto.getUserDescription());
|
|
|
|
|
NwaUser userByUserName = nwaUserService.findUserByUserName(userResource.getUserId());
|
|
|
|
|
//NwaUser userByUserName = nwaUserService.findUserByUserName(userResource.getUserId());
|
|
|
|
|
List<UsrDto> userByUserName = userService.findList(userResource.getUserId());
|
|
|
|
|
if("false".equals(userResource.getTemporaryUser()) &&
|
|
|
|
|
userByUserName == null){
|
|
|
|
|
userByUserName.size() <= 0){
|
|
|
|
|
throw BusinessException.build("第"+(i+1)+"行的用户不存在,必须为临时用户");
|
|
|
|
|
}else if(userByUserName != null){
|
|
|
|
|
}else if(userByUserName != null && userByUserName.size() > 0){
|
|
|
|
|
//userByUserName.setFullName(userResource.getUserDescription());
|
|
|
|
|
userResource.setUserDescription(userByUserName.getFullName());
|
|
|
|
|
nwaUserService.saveOrUpdate(userByUserName);
|
|
|
|
|
userResource.setUserDescription(userByUserName.get(0).getFullName());
|
|
|
|
|
//nwaUserService.saveOrUpdate(userByUserName);
|
|
|
|
|
}
|
|
|
|
|
userResource.setStatus(userResourceDto.getStatus());
|
|
|
|
|
userResource.setHandle("UserResourceBo:"+userResource.getSite()+","+
|
|
|
|
|