|
@@ -45,20 +45,13 @@ public class InstitutionalInformationServiceImpl extends ServiceImpl<Institution
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg add(InstitutionalInformationVO institutionalInformationVO) {
|
|
public HttpRespMsg add(InstitutionalInformationVO institutionalInformationVO) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
- SystemUser institution = new SystemUser();
|
|
|
|
- Integer count = systemUserMapper.selectCount(new QueryWrapper<SystemUser>().eq("account", institutionalInformationVO.getAccount()));
|
|
|
|
|
|
+ Integer count = institutionalMapper.selectCount(new QueryWrapper<InstitutionalInformation>().eq("name", institutionalInformationVO.getName()));
|
|
if(count > 0){
|
|
if(count > 0){
|
|
- msg.setError("账号已存在!");
|
|
|
|
|
|
+ msg.setError("此机构已存在,请添加其他机构");
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
- institution.setAccount(institutionalInformationVO.getAccount());
|
|
|
|
- institution.setRoleName(institutionalInformationVO.getName());
|
|
|
|
- institution.setPassword(MD5Util.getPassword("000000"));
|
|
|
|
- institution.setRoleType(1);
|
|
|
|
- systemUserMapper.insert(institution);
|
|
|
|
InstitutionalInformation information = new InstitutionalInformation();
|
|
InstitutionalInformation information = new InstitutionalInformation();
|
|
BeanUtils.copyProperties(institutionalInformationVO,information);
|
|
BeanUtils.copyProperties(institutionalInformationVO,information);
|
|
- information.setSysId(institution.getId());
|
|
|
|
institutionalMapper.insert(information);
|
|
institutionalMapper.insert(information);
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
@@ -111,4 +104,31 @@ public class InstitutionalInformationServiceImpl extends ServiceImpl<Institution
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg getInstitutionDetail(SystemUser systemUser) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ InstitutionalInformationVO vo = institutionalMapper.selectDetail(systemUser.getId());
|
|
|
|
+ msg.data = vo;
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg addAccount(SystemUser systemUser) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ InstitutionalInformation information = new InstitutionalInformation();
|
|
|
|
+ information.setId(systemUser.getId());
|
|
|
|
+ Integer count = systemUserMapper.selectCount(new QueryWrapper<SystemUser>().eq("account", systemUser.getAccount()));
|
|
|
|
+ if(count > 0){
|
|
|
|
+ msg.setError("账号已存在!");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ systemUser.setPassword(MD5Util.getPassword("000000"));
|
|
|
|
+ systemUser.setRoleType(1);
|
|
|
|
+ systemUser.setId(null);
|
|
|
|
+ systemUserMapper.insert(systemUser);
|
|
|
|
+ information.setSysId(systemUser.getId());
|
|
|
|
+ institutionalMapper.updateById(information);
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|