Commit fdf68485 authored by bsatyanarayana-nisum-com's avatar bsatyanarayana-nisum-com Committed by tdutta-nisum-com

MT-97_1 : SNS :: Update_RoleTable_While_Account_CRUD_operations (#60)

parent a8426665
...@@ -45,7 +45,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -45,7 +45,7 @@ public class AccountServiceImpl implements AccountService {
String roleId = roleInfoService.getRole(MyTimeUtils.ACCOUNT); String roleId = roleInfoService.getRole(MyTimeUtils.ACCOUNT);
if( action != null && action.equals("N")) {//N means adding New Account if( action != null && action.equals(MyTimeUtils.STRING_N)) {//N means adding New Account
List<Account> accounts = validateAccounts(account.getAccountName()); List<Account> accounts = validateAccounts(account.getAccountName());
if( !accounts.isEmpty() && accounts.size() > 0){ if( !accounts.isEmpty() && accounts.size() > 0){
...@@ -53,7 +53,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -53,7 +53,7 @@ public class AccountServiceImpl implements AccountService {
}else { }else {
List<String> accDms = account.getDeliveryManagers(); List<String> accDms = account.getDeliveryManagers();
account.setAccountId(generateAccountId()); account.setAccountId(generateAccountId());
account.setStatus(MyTimeUtils.ACTIVE); account.setStatus(MyTimeUtils.STRING_Y);
accountResult = accountRepo.save(account); accountResult = accountRepo.save(account);
if(accDms != null && !accDms.isEmpty() && accDms.size() > 0) { if(accDms != null && !accDms.isEmpty() && accDms.size() > 0) {
...@@ -105,7 +105,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -105,7 +105,7 @@ public class AccountServiceImpl implements AccountService {
} }
} }
account.setStatus(MyTimeUtils.ACTIVE); account.setStatus(MyTimeUtils.STRING_Y);
accountResult = accountRepo.save(account); accountResult = accountRepo.save(account);
response="Updated succesfully"; response="Updated succesfully";
} }
...@@ -170,7 +170,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -170,7 +170,7 @@ public class AccountServiceImpl implements AccountService {
public Account deleteAccount(String accountId) throws MyTimeException { public Account deleteAccount(String accountId) throws MyTimeException {
Query query = new Query(Criteria.where(MyTimeUtils.ACCOUNT_ID).is(accountId)); Query query = new Query(Criteria.where(MyTimeUtils.ACCOUNT_ID).is(accountId));
Update update = new Update(); Update update = new Update();
update.set(MyTimeUtils.STATUS, MyTimeUtils.IN_ACTIVE); update.set(MyTimeUtils.STATUS, MyTimeUtils.STRING_N);
FindAndModifyOptions options = new FindAndModifyOptions(); FindAndModifyOptions options = new FindAndModifyOptions();
options.upsert(true); options.upsert(true);
return mongoTemplate.findAndModify(query, update, options, Account.class); return mongoTemplate.findAndModify(query, update, options, Account.class);
......
...@@ -70,6 +70,9 @@ public class MyTimeUtils { ...@@ -70,6 +70,9 @@ public class MyTimeUtils {
public final static String DOMAIN_ID="domainId"; public final static String DOMAIN_ID="domainId";
//public final static String NAME="deliveryManagers"; //public final static String NAME="deliveryManagers";
public final static String STRING_Y="Y";
public final static String STRING_N="N";
//Biometric Attendance //Biometric Attendance
public final static String ABESENT_STATUS_QUERY = "select emp.EmployeeCode,emp.FirstName," public final static String ABESENT_STATUS_QUERY = "select emp.EmployeeCode,emp.FirstName,"
......
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