|
|
|
@ -1,43 +1,32 @@
|
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.jlw.util.ToolUtils;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.ibeetl.admin.core.entity.CoreOrg;
|
|
|
|
|
import com.ibeetl.admin.core.entity.CoreUser;
|
|
|
|
|
import com.ibeetl.admin.core.util.TimeTool;
|
|
|
|
|
import com.ibeetl.admin.core.rbac.UserLoginInfo;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreBaseService;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreUserService;
|
|
|
|
|
import com.ibeetl.admin.core.util.PlatformException;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonReturnCode;
|
|
|
|
|
import com.ibeetl.jlw.dao.CoreUserWxDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.CoreUserWx;
|
|
|
|
|
import com.ibeetl.jlw.web.query.CoreUserWxQuery;
|
|
|
|
|
import com.ibeetl.jlw.entity.FileEntity;
|
|
|
|
|
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreBaseService;
|
|
|
|
|
import com.ibeetl.admin.core.util.PlatformException;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
import org.beetl.sql.core.engine.PageQuery;
|
|
|
|
|
import org.beetl.sql.core.SqlId;
|
|
|
|
|
import org.beetl.sql.core.engine.PageQuery;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* CoreUserWx Service
|
|
|
|
@ -50,6 +39,7 @@ import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
|
|
|
|
|
public class CoreUserWxService extends CoreBaseService<CoreUserWx>{
|
|
|
|
|
|
|
|
|
|
@Autowired private CoreUserWxDao coreUserWxDao;
|
|
|
|
|
@Autowired private CoreUserService coreUserService;
|
|
|
|
|
|
|
|
|
|
public PageQuery<CoreUserWx>queryByCondition(PageQuery query){
|
|
|
|
|
PageQuery ret = coreUserWxDao.queryByCondition(query);
|
|
|
|
@ -167,4 +157,36 @@ public class CoreUserWxService extends CoreBaseService<CoreUserWx>{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 构建登录实体
|
|
|
|
|
* @param openId
|
|
|
|
|
* @param userId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public UserLoginInfo buildLoginInfoWithWx(@NotNull String openId, @NotNull Long userId){
|
|
|
|
|
// 构建的返回对象
|
|
|
|
|
UserLoginInfo loginInfo = new UserLoginInfo();
|
|
|
|
|
CoreUserWxQuery coreUserWxQuery = new CoreUserWxQuery();
|
|
|
|
|
coreUserWxQuery.setOpenid(openId);
|
|
|
|
|
coreUserWxQuery.setUserId(userId);
|
|
|
|
|
List<CoreUserWx> info = getValuesByQueryNotWithPermission(coreUserWxQuery);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(info)) {
|
|
|
|
|
CoreUserWx coreUserWx = info.get(0);
|
|
|
|
|
// 微信登录信息,绑定的系统级用户
|
|
|
|
|
CoreUser bindCoreUser = coreUserWx.getCoreUser();
|
|
|
|
|
Assert.notNull(bindCoreUser, "绑定的用户,处于不存在或者未启用状态!");
|
|
|
|
|
// 查询这个对象所在的机构列表
|
|
|
|
|
List<CoreOrg> orgs = coreUserService.getUserOrg(bindCoreUser.getId(), bindCoreUser.getOrgId());
|
|
|
|
|
|
|
|
|
|
loginInfo.setUser(bindCoreUser);
|
|
|
|
|
loginInfo.setOrgs(orgs);
|
|
|
|
|
loginInfo.setCurrentOrg(orgs.get(0));
|
|
|
|
|
return loginInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|