|
@ -285,6 +285,14 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
|
* @return
|
|
|
*/
|
|
|
public MixEnvelop<IotCompanyVO, IotCompanyVO> create(IotCompanyDO iotCompany) {
|
|
|
|
|
|
//判断账户是否重复
|
|
|
IotCompanyDO account = iotCompanyDao.findByAccount(userAgent.getUID());
|
|
|
if (account==null){
|
|
|
return MixEnvelop.getSuccess("账户已注册",-1);
|
|
|
}
|
|
|
|
|
|
|
|
|
List<IotCompanyTypeDO> list = iotCompany.getTypeList();
|
|
|
if("1".equalsIgnoreCase(iotCompany.getAccountType())){
|
|
|
//产商注册
|
|
@ -387,6 +395,40 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_create,convertToModelVO(iotCompany));
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 新增平台应用
|
|
|
* @param iotCompany
|
|
|
* @return
|
|
|
*/
|
|
|
public MixEnvelop<IotCompanyVO, IotCompanyVO> addPlatformApp(IotCompanyDO iotCompany) {
|
|
|
|
|
|
IotCompanyDO platform = iotCompanyDao.findByNameAndAccountType(iotCompany.getName(), "0");
|
|
|
if (platform!=null){
|
|
|
return MixEnvelop.getError("企业已经注册");
|
|
|
}
|
|
|
|
|
|
iotCompany.setStatus("1");//默认审核通过
|
|
|
iotCompany.setSaasId(getCode());
|
|
|
iotCompany.setDel(1);
|
|
|
iotCompany.setAccount(iotCompany.getContactsMobile());
|
|
|
iotCompany.setEhrUserId(getCode());
|
|
|
iotCompany.setAccountType("0");
|
|
|
iotCompanyDao.save(iotCompany);
|
|
|
//保存应用
|
|
|
IotCompanyAppDO appDO = iotCompany.getAppList().get(0);
|
|
|
|
|
|
appDO.setCompanyId(iotCompany.getId());
|
|
|
appDO.setCompanyName(iotCompany.getName());
|
|
|
appDO.setDel("1");
|
|
|
appDO.setSaasId(getCode());
|
|
|
iotCompanyAppDao.save(appDO);
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 按id查找
|
|
|
* @param id
|
|
@ -743,7 +785,7 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
|
*/
|
|
|
public MixEnvelop<IotCompanyVO, IotCompanyVO> findCompanyByAccount() {
|
|
|
|
|
|
IotCompanyDO companyDO = iotCompanyDao.findByAccount(userAgent.getUNAME());
|
|
|
IotCompanyDO companyDO = iotCompanyDao.findByAccount(userAgent.getUID());
|
|
|
if (companyDO==null){
|
|
|
return MixEnvelop.getSuccess("未入驻企业",-1);
|
|
|
}
|
|
@ -757,7 +799,7 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
|
*/
|
|
|
public MixEnvelop<IotCompanyAppVO, IotCompanyAppVO> findCompanyApp() {
|
|
|
|
|
|
IotCompanyDO account = iotCompanyDao.findByAccount(userAgent.getUNAME());
|
|
|
IotCompanyDO account = iotCompanyDao.findByAccount(userAgent.getUID());
|
|
|
List<IotCompanyAppDO> appDOS = iotCompanyAppDao.findByCompanyId(account.getId());
|
|
|
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,appDOS);
|