Commit 8bbf0eb2 authored by wangxl's avatar wangxl

77

parent 60026cb7
......@@ -18,4 +18,6 @@ public class loginUser implements Serializable {
private String type;
/** 项目类型 1 申报科研项目 2申报重点学科项目 */
private String projType;
/** 信息是否完整 */
private boolean complete;
}
......@@ -178,27 +178,18 @@ public class AuthorizationController {
@RequestMapping(value = "/getUser")
@GetMapping
public ResponseDataModel<Map<String, Object>> getUser() {
ComPerson person = comPersonService.entityById(SecurityUserHolder.getPersonId());
boolean isComplete = true;
if (null != person) {
if (Objects.isNull(person.getNation()) || Objects.isNull(person.getTitle()) || Objects.isNull(person.getEducation()) || Objects.isNull(person.getSpec()) || Objects.isNull(person.getEmail())) {
isComplete = false;
}
}
loginUser user = new loginUser();
StringUtil.copyObj2Obj(SecurityUserHolder.getCurrentUser(), user);
user.setType(systemSetService.getByKey(SystemSetKey.SysProjectType));
if(!user.getType().equals("3")){
user.setProjType(systemSetService.getByKey(SystemSetKey.SysProjectType));
}
boolean finalIsComplete = isComplete;
user.setComplete(comPersonService.isComplete(SecurityUserHolder.getPersonId()));
List<UserMenuDTO> menuList = systemMenuService.findByRoleId(SecurityUserHolder.getRoles());
Map<String, Object> userInfo = new HashMap<String, Object>(3) {
{
put("userInfo", user);
put("menuList", menuList);
put("isComplete", finalIsComplete);
}
};
return ResponseDataModel.ok(userInfo);
......
......@@ -15,6 +15,7 @@ import com.yiboshi.science.service.ComPersonService;
import com.yiboshi.science.service.ComUnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
......@@ -176,10 +177,15 @@ public class ComPersonController extends BaseController<ComPersonService, ComPer
public ResponseDataModel<Map<String, Object>> getAppPersonInfo() {
boolean isComplete = true;
ComPerson comPerson = comPersonService.entityById(SecurityUserHolder.getPersonId());
if (null != comPerson) {
if (Objects.isNull(comPerson.getNation()) || Objects.isNull(comPerson.getTitle()) || Objects.isNull(comPerson.getEducation()) || Objects.isNull(comPerson.getSpec()) || Objects.isNull(comPerson.getEmail())) {
isComplete = false;
}
if (null == comPerson)
isComplete= false;
if (StringUtils.isEmpty(comPerson.getNation()) ||
StringUtils.isEmpty(comPerson.getTitle()) ||
StringUtils.isEmpty(comPerson.getDegree()) ||
StringUtils.isEmpty(comPerson.getEducation()) ||
StringUtils.isEmpty(comPerson.getSpec()) ||
StringUtils.isEmpty(comPerson.getEmail())) {
isComplete= false;
}
boolean finalComplete = isComplete;
Map<String, Object> data = new HashMap<String, Object>(3) {
......
......@@ -8,6 +8,7 @@ import com.yiboshi.science.param.dto.DataStatisticsDTO;
import com.yiboshi.science.param.dto.UserImportDTO;
import com.yiboshi.science.param.query.ComPersonQueryVO;
import com.yiboshi.science.param.query.ComUnitQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.IOException;
import java.util.List;
......@@ -107,4 +108,6 @@ public interface ComPersonService extends BaseService<ComPersonQueryVO, ComPerso
List<UserImportDTO> userImport(List<UserImportDTO> list) throws IOException;
DataStatisticsDTO getRegisterPersonCount(ComPersonQueryVO v);
DataStatisticsDTO getRegisterPersonCountByDay(ComPersonQueryVO v);
boolean isComplete(String id);
}
......@@ -205,13 +205,13 @@ public class ComPersonServiceImpl extends BaseServiceImpl<ComPersonDAO, ComPerso
comPerson.setAuditResult(10);
comPerson.setPersonState(1);
if (person.getAuditResult().equals(1)) {
this.SMSSending(person.getMobile(), person.getPersonName(), properties.getSystemName(),"用户", "已审核通过", "请使用注册账户登录系统");
this.SMSSending(person.getMobile(), person.getPersonName(), properties.getSystemName(), "用户", "已审核通过", "请使用注册账户登录系统");
}
} else {
comPerson.setAuditResult(20);
comPerson.setPersonState(2);
if (person.getAuditResult().equals(1)) {
this.SMSSending(person.getMobile(), person.getPersonName(), properties.getSystemName(),"用户", "审核不通过" + "(" + dto.getAuditContent() + ")", "请联系单位处理");
this.SMSSending(person.getMobile(), person.getPersonName(), properties.getSystemName(), "用户", "审核不通过" + "(" + dto.getAuditContent() + ")", "请联系单位处理");
}
}
ComPersonDTO d = this.getPersonById(dto.getId());
......@@ -327,6 +327,21 @@ public class ComPersonServiceImpl extends BaseServiceImpl<ComPersonDAO, ComPerso
return state;
}
public boolean isComplete(String id) {
ComPerson person = this.getById(id);
if (null == person)
return false;
if (StringUtils.isEmpty(person.getNation()) ||
StringUtils.isEmpty(person.getTitle()) ||
StringUtils.isEmpty(person.getDegree()) ||
StringUtils.isEmpty(person.getEducation()) ||
StringUtils.isEmpty(person.getSpec()) ||
StringUtils.isEmpty(person.getEmail())) {
return false;
}
return true;
}
public List<ComPersonDTO> getManagerListByUnitId(String unitId) {
List<ComPersonDTO> list = comPersonDAO.getManagerListByUnitId(unitId);
if (null != list && !SecurityUserHolder.getRoles().contains(CommonEnum.systemRole.sys.getCode().toString())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment