|
@@ -5,12 +5,14 @@ import com.dk.common.infrastructure.constant.Constant;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
import com.dk.common.model.pojo.mst.StaffPurview;
|
|
import com.dk.common.model.pojo.mst.StaffPurview;
|
|
|
import com.dk.common.model.pojo.mst.StaffRight;
|
|
import com.dk.common.model.pojo.mst.StaffRight;
|
|
|
|
|
+import com.dk.common.model.vo.core.StaffEntity;
|
|
|
import com.dk.common.response.ResponseCodeEnum;
|
|
import com.dk.common.response.ResponseCodeEnum;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.mdm.feign.CompanyFeign;
|
|
import com.dk.mdm.feign.CompanyFeign;
|
|
|
import com.dk.mdm.infrastructure.convert.mst.StaffConvert;
|
|
import com.dk.mdm.infrastructure.convert.mst.StaffConvert;
|
|
|
import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
|
|
|
+import com.dk.mdm.mapper.common.CommonMapper;
|
|
|
import com.dk.mdm.model.pojo.mst.*;
|
|
import com.dk.mdm.model.pojo.mst.*;
|
|
|
import com.dk.mdm.mapper.mst.StaffMapper;
|
|
import com.dk.mdm.mapper.mst.StaffMapper;
|
|
|
import com.dk.common.service.BaseService;
|
|
import com.dk.common.service.BaseService;
|
|
@@ -25,9 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.HashMap;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author : 姜永辉
|
|
* @author : 姜永辉
|
|
@@ -71,6 +71,9 @@ public class StaffService extends BaseService<Staff> {
|
|
|
private CommonService commonService;
|
|
private CommonService commonService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private CommonMapper commonMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
private AuthUtils authUtils;
|
|
private AuthUtils authUtils;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -259,4 +262,33 @@ public class StaffService extends BaseService<Staff> {
|
|
|
return ResponseResultUtil.success();
|
|
return ResponseResultUtil.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @desc : 登录后获取信息
|
|
|
|
|
+ * @author : 周兴
|
|
|
|
|
+ * @date : 2024/3/4 11:41
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional(
|
|
|
|
|
+ rollbackFor = {Exception.class}
|
|
|
|
|
+ )
|
|
|
|
|
+ public ResponseResultVO<Dictionary<String,Object>> getInfoAfterLogin(Map<String, Object> param) {
|
|
|
|
|
+ // 先根据userId查询当前企业的员工信息
|
|
|
|
|
+ StaffResponse staff = staffMapper.selectByUserId(param.get("userId").toString());
|
|
|
|
|
+ if (staff != null) {
|
|
|
|
|
+ // 存Redis
|
|
|
|
|
+ authUtils.saveStaff(new StaffEntity().setStaffId(staff.getStaffId())
|
|
|
|
|
+ .setStaffCode(staff.getStaffCode())
|
|
|
|
|
+ .setStaffName(staff.getStaffName())
|
|
|
|
|
+ .setCpId(Integer.parseInt(param.get("cpId").toString()))
|
|
|
|
|
+ .setAppCode(param.get("appCode").toString()));
|
|
|
|
|
+ // 更新员工登录状态
|
|
|
|
|
+ this.updateByUuid(new Staff().setStaffId(staff.getStaffId()).setFlgCanLogin(true));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 获取菜单
|
|
|
|
|
+ List menuList = commonMapper.getMenuByUser(param);
|
|
|
|
|
+ Dictionary<String,Object> dic = new Hashtable<>();
|
|
|
|
|
+ dic.put("menuList", menuList);
|
|
|
|
|
+ dic.put("staff",staff);
|
|
|
|
|
+ return ResponseResultUtil.success(dic);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|