NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package com.highradius.admin.cam.slimfast.action;

import com.receivablesradius.deductions.action.BaseAction;
import com.receivablesradius.deductions.constants.JSONRowResult;
import com.receivablesradius.deductions.model.SortDTO;
import java.util.*;
import com.highradius.admin.cam.slimfast.manager.*;
import com.highradius.common.util.HRCLog;
import com.highradius.common.util.HRCLogFactory;
import com.highradius.credit.model.MapAccountSecurityType;
import com.google.gson.Gson;


public class CreditSlimfastManageSecurityTypesAction extends BaseAction {
private static final long serialVersionUID = 1L;
private static final HRCLog LOGGER = HRCLogFactory.getLog(CreditSlimfastManageSecurityTypesAction.class);
private String[] toBeDeletedRecordIds ;
private Boolean success;
private String securityName;
private String securityCode;
private Integer pkSecurityTypeId;
private CreditSlimfastManageSecurityTypesManager creditSlimfastManageSecurityTypesManager;
//used to map the input query
private static HashMap<String, String> manageSecurityTypeSpecialFieldMap = new HashMap<String, String>();


static {
manageSecurityTypeSpecialFieldMap.put("securityName", "securityName");
manageSecurityTypeSpecialFieldMap.put("securityCode", "securityCode");
}





public String getSecurityTypes() {
LOGGER.debug("Entered into getSecurityTypes method");
Integer fkAccountId = null;
// fetch data from database based on accountId [with pagination]
List<MapAccountSecurityType> securityTypes = new ArrayList<MapAccountSecurityType>();
JSONRowResult result = new JSONRowResult();

try {
LOGGER.debug("going to fetch data");

SortDTO sortObject = getSortDTO(null, manageSecurityTypeSpecialFieldMap);
fkAccountId = getUserFromSession().getAccountId();
securityTypes = getCreditSlimfastManageSecurityTypesManager().getSecurityTypes(getStartIndex(), getRowsToFetch(),fkAccountId,sortObject);
if(securityTypes != null) {
convertToJSON(securityTypes.size(), securityTypes);
}

}
catch (Exception e) {
LOGGER.error("Error in getSecurityTypes: ",e);
return ERROR;
}
LOGGER.debug("Finished the getSecurityTypes method");
return SUCCESS;
}




public String addOrEditSecurityTypes() {
LOGGER.debug("Inside addorEditSecurityTypes()");
JSONRowResult result = new JSONRowResult();
MapAccountSecurityType securityType = new MapAccountSecurityType();
// new addition
if (getPkSecurityTypeId().equals("") || getPkSecurityTypeId() == null) {

securityType.setFkAccountId(getUserFromSession().getAccountId());
securityType.setCreateUser(getUserFromSession().getFullName());
securityType.setCreateTime(new Date());
securityType.setUpdateUser(getUserFromSession().getFullName());
securityType.setUpdateTime(new Date());
securityType.setSecurityCode(securityCode);
securityType.setSecurityName(securityName);
try {
success = creditSlimfastManageSecurityTypesManager.addSecurityType(securityType);
} catch (Exception e) {
LOGGER.error("Add action failure : ", e);
return ERROR;
}

}
// update existing
else {
securityType.setPkSecurityTypeId(pkSecurityTypeId);
securityType.setCreateUser(getUserFromSession().getFullName());
securityType.setCreateTime(new Date());
securityType.setUpdateUser(getUserFromSession().getFullName());
securityType.setUpdateTime(new Date());
securityType.setSecurityCode(securityCode);
securityType.setSecurityName(securityName);
securityType.setUpdateTime(new Date());

try {
success = creditSlimfastManageSecurityTypesManager.editSecurityType(securityType);
} catch (Exception e) {
LOGGER.error("Edit action failure : ", e);
return ERROR;
}
}

result.success = success;
Gson gson = new Gson();
String jsonResult = gson.toJson(result);
setOutput(jsonResult);
return SUCCESS;
}

public String deleteSecurityType() {
JSONRowResult result = new JSONRowResult();

try {
success = (creditSlimfastManageSecurityTypesManager.deleteSecurityType(toBeDeletedRecordIds));
} catch (Exception e) {
LOGGER.error("delete action failure : ", e);
return ERROR;
}

result.success = success;
Gson gson = new Gson();
String jsonResult = gson.toJson(result);
setOutput(jsonResult);
return SUCCESS;

}





public String getSecurityName() {
return securityName;
}


public void setSecurityName(String securityName) {
this.securityName = securityName;
}


public String getSecurityCode() {
return securityCode;
}


public void setSecurityCode(String securityCode) {
this.securityCode = securityCode;
}


public Integer getPkSecurityTypeId() {
return pkSecurityTypeId;
}


public void setPkSecurityTypeId(Integer pkSecurityTypeId) {
this.pkSecurityTypeId = pkSecurityTypeId;
}

public CreditSlimfastManageSecurityTypesManager getCreditSlimfastManageSecurityTypesManager() {
return creditSlimfastManageSecurityTypesManager;
}


public void setCreditSlimfastManageSecurityTypesManager(
CreditSlimfastManageSecurityTypesManager creditSlimfastManageSecurityTypesManager) {
this.creditSlimfastManageSecurityTypesManager = creditSlimfastManageSecurityTypesManager;
}

public String[] getToBeDeletedRecordIds() {
return toBeDeletedRecordIds;
}

public void setToBeDeletedRecordIds(String[] toBeDeletedRecordIds) {
this.toBeDeletedRecordIds = toBeDeletedRecordIds;
}

public Boolean getSuccess() {
return success;
}

public void setSuccess(Boolean success) {
this.success = success;
}


}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.