留样管理图片字段修正为wxSaveImg
This commit is contained in:
@@ -1,7 +1,15 @@
|
||||
package com.zf.foodpurchase.framework.web.service;
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
import com.zf.foodpurchase.fdsafe.entity.Edu;
|
||||
import com.zf.foodpurchase.fdsafe.entity.School;
|
||||
import com.zf.foodpurchase.fdsafe.entity.Supplier;
|
||||
import com.zf.foodpurchase.fdsafe.service.IEduService;
|
||||
import com.zf.foodpurchase.fdsafe.service.ISchoolService;
|
||||
import com.zf.foodpurchase.fdsafe.service.ISupplierService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
@@ -34,6 +42,16 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
||||
@Autowired
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
@Autowired
|
||||
private ISchoolService schoolService;
|
||||
|
||||
@Autowired
|
||||
private IEduService eduService;
|
||||
|
||||
@Autowired
|
||||
private ISupplierService supplierService;
|
||||
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
|
||||
{
|
||||
@@ -55,8 +73,42 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
||||
}
|
||||
|
||||
passwordService.validate(user);
|
||||
SysUser detailUser= new SysUser();
|
||||
BeanUtils.copyProperties(user,detailUser);
|
||||
Integer accountDeptId = user.getAccountDeptId();
|
||||
if(accountDeptId != null){
|
||||
String deptName = "";
|
||||
|
||||
return createLoginUser(user);
|
||||
|
||||
if(WxAPPAccountConstants.SCHOOL.equals(user.getAccountType())){
|
||||
School byId = schoolService.getById(accountDeptId);
|
||||
detailUser.setSchoolId(accountDeptId);
|
||||
if(byId != null){
|
||||
deptName = byId.getSchoolName();
|
||||
detailUser.setEduId(byId.getEduId());
|
||||
}
|
||||
}
|
||||
else if(WxAPPAccountConstants.SUPPLIER.equals(user.getAccountType())){
|
||||
detailUser.setSupplierId(accountDeptId);
|
||||
Supplier supplier = supplierService.getById(accountDeptId);
|
||||
if(supplier != null){
|
||||
deptName = supplier.getSupplierName();
|
||||
detailUser.setEduId(supplier.getEduId());
|
||||
}
|
||||
}
|
||||
else if(WxAPPAccountConstants.EDU.equals(user.getAccountType())){
|
||||
detailUser.setEduId(accountDeptId);
|
||||
Edu edu = eduService.getById(accountDeptId);
|
||||
if(edu != null){
|
||||
deptName = edu.getEduName();
|
||||
}
|
||||
}
|
||||
detailUser.setDeptName(deptName);
|
||||
}
|
||||
|
||||
|
||||
// return createLoginUser(user);
|
||||
return createLoginUser(detailUser);
|
||||
}
|
||||
|
||||
public UserDetails createLoginUser(SysUser user)
|
||||
|
||||
Reference in New Issue
Block a user