|
@@ -75,14 +75,22 @@ public class MobileUserServiceImpl implements MobileUserService {
|
|
|
|
|
|
@Override
|
|
|
public Result add(MobileUser entity){
|
|
|
+
|
|
|
+
|
|
|
if (entity == null){
|
|
|
return new Result(10002, ResultStatus.addNull);
|
|
|
}
|
|
|
+
|
|
|
+ String account = entity.getAccount();
|
|
|
+ MobileUser mobileUser = mobileUserRepository.findByAccount(account);
|
|
|
+ if (mobileUser != null) {
|
|
|
+ return new Result(10001,"账号已存在,添加失败!");
|
|
|
+ }
|
|
|
try {
|
|
|
String ycgApi = mobileUnitRepository.findByShortNameLike("油车港").get(0).getApi();
|
|
|
String wyApi = mobileUnitRepository.findByShortNameLike("武义").get(0).getApi();
|
|
|
String wjjApi = mobileUnitRepository.findByShortNameLike("王江泾").get(0).getApi();
|
|
|
-
|
|
|
+ mobileUserRepository.save(entity);
|
|
|
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
Integer id = mobileUserRepository.findID();
|
|
@@ -91,10 +99,12 @@ public class MobileUserServiceImpl implements MobileUserService {
|
|
|
if (grantClass ==null){
|
|
|
return new Result(10000,"msg");
|
|
|
}
|
|
|
- restTemplate.getForEntity(ycgApi+"/video/mobileUser/register?id="+(id+1)+"&password=123456",null);
|
|
|
- restTemplate.getForEntity(wyApi+"/video/mobileUser/register?id="+(id+1)+"&password=123456",null);
|
|
|
- restTemplate.getForEntity(wjjApi+"/video/mobileUser/register?id="+(id+1)+"&password=123456",null);
|
|
|
- mobileUserRepository.save(entity);
|
|
|
+ Long start = System.currentTimeMillis();
|
|
|
+
|
|
|
+ restTemplate.getForEntity(ycgApi+"/video/mobileUser/register?account="+start+"&id="+id+"&password=123456",null);
|
|
|
+ restTemplate.getForEntity(wyApi+"/video/mobileUser/register?account="+start+"&id="+id+"&password=123456",null);
|
|
|
+ restTemplate.getForEntity(wjjApi+"/video/mobileUser/register?account="+start+"&id="+id+"&password=123456",null);
|
|
|
+
|
|
|
return new Result(10000,ResultStatus.addSuccess);
|
|
|
}catch (Exception e){
|
|
|
log.error(e.getMessage(),e);
|
|
@@ -112,10 +122,10 @@ public class MobileUserServiceImpl implements MobileUserService {
|
|
|
String wjjApi = mobileUnitRepository.findByShortNameLike("王江泾").get(0).getApi();
|
|
|
|
|
|
|
|
|
- RestTemplate restTemplate = new RestTemplate();
|
|
|
- restTemplate.getForEntity(wjjApi+"/video/mobileUser/remove?ids="+ids,null);
|
|
|
- restTemplate.getForEntity(wyApi+"/video/mobileUser/remove?ids="+ids,null);
|
|
|
- restTemplate.getForEntity(ycgApi+"/video/mobileUser/remove?ids="+ids,null);
|
|
|
+// RestTemplate restTemplate = new RestTemplate();
|
|
|
+// restTemplate.getForEntity(wjjApi+"/video/mobileUser/remove?ids="+ids,null);
|
|
|
+// restTemplate.getForEntity(wyApi+"/video/mobileUser/remove?ids="+ids,null);
|
|
|
+// restTemplate.getForEntity(ycgApi+"/video/mobileUser/remove?ids="+ids,null);
|
|
|
|
|
|
|
|
|
try {
|