Initial Commit

This commit is contained in:
2025-04-19 17:50:17 +05:30
parent 2b8c050afa
commit 0080857d4e
140 changed files with 35037 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.wst.jsdt.core.javascriptValidator"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>

35
pom.xml Normal file
View File

@@ -0,0 +1,35 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>matrix</groupId>
<artifactId>matrix</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<warSourceDirectory>build/WebContent</warSourceDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

1334
reporting.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,255 @@
package matrix.nimble.admin.controller;
import java.util.Calendar;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import matrix.nimble.admin.model.MaintenanceHandler;
import matrix.nimble.admin.model.PortfolioBranch;
import matrix.nimble.admin.model.PortfolioHandler;
import matrix.nimble.admin.model.User;
import matrix.nimble.admin.model.UserHandler;
import matrix.nimble.hr.model.EmployeeHandler;
import matrix.nimble.model.Session;
import matrix.nimble.operation.tools.model.Belt;
import matrix.nimble.operation.tools.model.ToolsHandler;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class Admin {
@RequestMapping(value="inituser",method=RequestMethod.POST )
public String InitManageUser(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
UserHandler uh= new UserHandler();
uh.setProcessFlag(true);
uh.setErrCode("USRINIT01");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("userlist",uh.UserList(Sessvals.getBranchID()));
model.addAttribute("user",new User());
model.addAttribute("msg",uh.isProcessFlag() ? "" : uh.getErrMsg());
return "admin/user/inituser";
}
@RequestMapping(value="changeuserstatus",method=RequestMethod.POST )
public @ResponseBody String ChangeUserStatus(@RequestParam String user,@RequestParam String oprby)
{
UserHandler uh= new UserHandler();
uh.setProcessFlag(true);
uh.setErrCode("USRCS02");
return uh.ChangerUserStatus(user, oprby);
}
@RequestMapping(value="userdetail",method=RequestMethod.GET )
public String UserDetail(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@RequestParam String uid,@RequestParam String suuid)
{
User user = new User();
UserHandler uh = new UserHandler();
String retval="";
String sUUID=session.getAttribute("UUID").toString();
if(sUUID.equals(suuid))
{
uh.setProcessFlag(true);
uh.setErrCode("USRDET03");
user.setSuuid(sUUID);
user.setUid(uid);
user=uh.GetUserDetails(user);
if(user.getGroup() == null)
{
retval="error";
}
else
{
retval="admin/user/userdetail";
}
}
else
{
retval="error";
}
ModuleFunctions modFunc=new ModuleFunctions("USRDET03");
modFunc.setProcessFlag(true);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("grouplist",modFunc.GetResultArray(511, new String[] {Sessvals.getUserGroupID()}));
model.addAttribute("emailist",modFunc.GetResultArray(516, null));
model.addAttribute("userdetail",user);
model.addAttribute("retval","0");
model.addAttribute("msg",uh.getErrMsg());
model.addAttribute("stat",uh.isProcessFlag());
return retval;
}
@RequestMapping(value="updateuser",method=RequestMethod.POST )
public String UpdateUser(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@ModelAttribute(value="userdetail") User user)
{
String retval="";
String winvalue="0";
UserHandler uh=new UserHandler();
uh.setErrCode("USRUPD04");
String sUUID=session.getAttribute("UUID").toString();
if(sUUID.equals(user.getSuuid()))
{
user.setSuuid(sUUID);
user=uh.SaveUserDetail(Sessvals.getUserID(), Sessvals.getBranchID(), user);
retval="admin/user/userdetail";
winvalue=user.getUid();
}
else
{
retval="error";
}
ModuleFunctions modFunc=new ModuleFunctions("USRUPD04");
modFunc.setProcessFlag(true);
model.addAttribute("grouplist",modFunc.GetResultArray(511, new String[] {Sessvals.getUserGroupID()}));
model.addAttribute("emailist",modFunc.GetResultArray(516, null));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("userdetail",user);
model.addAttribute("retval",winvalue);
model.addAttribute("msg",uh.getErrMsg());
model.addAttribute("stat",uh.isProcessFlag());
return retval;
}
@RequestMapping(value="initmaintenance",method=RequestMethod.POST )
public String InitMaintenance(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
Date defaultDate = new Date();
Calendar c = Calendar.getInstance();
c.setTime(defaultDate);
c.add(Calendar.MONTH, -3);
defaultDate = c.getTime();
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("defaultdate",GlobalClass.DateTime("dd/MM/yyyy", defaultDate));
return "admin/maintenance";
}
@RequestMapping(value="startmaintenance",method=RequestMethod.POST )
public @ResponseBody String StartMaintenance(@RequestParam String oprtype,@RequestParam String oprby,@RequestParam String upto)
{
MaintenanceHandler mh= new MaintenanceHandler();
mh.setProcessFlag(true);
mh.setErrCode("MNTSMNT01");
return mh.startMaintenance(oprtype, oprby, upto);
}
@RequestMapping(value="initportbranch",method=RequestMethod.POST )
public String InitPortBranch(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
PortfolioHandler ph= new PortfolioHandler();
ph.setProcessFlag(true);
ph.setErrCode("BRNINIT01");
ModuleFunctions modFunc=new ModuleFunctions(ph.getErrCode());
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("branchform",new PortfolioBranch());
model.addAttribute("msg",ph.isProcessFlag() ? "" : ph.getErrMsg());
return "admin/portfolio/branchlist";
}
@RequestMapping(value="getportbranchlist",method=RequestMethod.POST )
public String GetPortBranchList(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@ModelAttribute(value="branchform") PortfolioBranch branch)
{
PortfolioHandler ph= new PortfolioHandler();
ph.setProcessFlag(true);
ph.setErrCode("BRNINIT01");
ModuleFunctions modFunc=new ModuleFunctions(ph.getErrCode());
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("branchform",ph.getPortfolioBranch(branch));
model.addAttribute("msg",ph.isProcessFlag() ? "" : ph.getErrMsg());
return "admin/portfolio/branchlist";
}
@RequestMapping(value="changebranchstatus",method=RequestMethod.POST )
public @ResponseBody String ChangeBranchStatus(@RequestParam String branch,@RequestParam String oprby)
{
PortfolioHandler ph= new PortfolioHandler();
ph.setProcessFlag(true);
ph.setErrCode("BRNINIT02");
return ph.ChangeBranchStatus(branch, oprby);
}
@RequestMapping(value="branchdetail",method=RequestMethod.GET )
public String GetPortBranchDetail(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@RequestParam int pid,@RequestParam int bid,@RequestParam String suuid)
{
PortfolioBranch branch = new PortfolioBranch();
PortfolioHandler ph = new PortfolioHandler();
String retval="";
String sUUID=session.getAttribute("UUID").toString();
if(sUUID.equals(suuid))
{
ph.setProcessFlag(true);
ph.setErrCode("USRDET03");
branch.setSuuid(sUUID);
branch.setBranchid(bid);
branch.setPortfolio(pid);
branch= ph.getBranchDetails(branch);
if(branch.getPortfolio() == 0)
{
retval="error";
}
else
{
retval="admin/portfolio/branchdetail";
}
}
else
{
retval="error";
}
ModuleFunctions modFunc=new ModuleFunctions("BRNINIT03");
modFunc.setProcessFlag(true);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("banklist",modFunc.GetResultArray(519,(pid+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("branchdetail",branch);
model.addAttribute("retval","0");
model.addAttribute("msg",ph.getErrMsg());
model.addAttribute("stat",ph.isProcessFlag());
return retval;
}
@RequestMapping(value="updateportbranch",method=RequestMethod.POST )
public String UpdatePortBranch(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@ModelAttribute(value="branchdetail") PortfolioBranch branch)
{
String retval="";
String winvalue="0";
PortfolioHandler ph=new PortfolioHandler();
ph.setErrCode("BRNUPD04");
String sUUID=session.getAttribute("UUID").toString();
if(sUUID.equals(branch.getSuuid()))
{
branch.setSuuid(sUUID);
branch=ph.SaveBranchDetail(Sessvals.getUserID(), Sessvals.getBranchID(), branch);
retval="admin/portfolio/branchdetail";
winvalue=branch.getBranchid()+"";
}
else
{
retval="error";
}
ModuleFunctions modFunc=new ModuleFunctions("BRNUPD04");
modFunc.setProcessFlag(true);
model.addAttribute("banklist",modFunc.GetResultArray(519,(branch.getPortfolio()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("branchdetail",branch);
model.addAttribute("retval",winvalue);
model.addAttribute("msg",ph.getErrMsg());
model.addAttribute("stat",ph.isProcessFlag());
return retval;
}
}

View File

@@ -0,0 +1,61 @@
package matrix.nimble.admin.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
public class MaintenanceHandler {
String ErrMsg;
String ErrCode;
String ErrDesc;
boolean ProcessFlag;
public MaintenanceHandler()
{
setProcessFlag(true);
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String startMaintenance(String oprType,String oprBy, String upTo)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(isProcessFlag());
upTo = GlobalClass.ConvertToYMD(upTo);
dbf.FetchRunQuery(513, new String[]{oprType,oprBy,upTo});
setProcessFlag(dbf.isProcessFlag());
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
if(isProcessFlag())
{
return dbf.getProcResult();
}
else {
return getErrCode()+":error:"+dbf.getErrMsg();
}
}
}

View File

@@ -0,0 +1,112 @@
package matrix.nimble.admin.model;
public class PortfolioBranch {
private int portfolio;
private int branchid;
private String branchcode;
private String branchname;
private String address1;
private String address2;
private String address3;
private String state;
private String pincode;
private String gstno;
private String isactive;
private String suuid;
private int bank;
private int bankbranchid;
private String [][] branchlist;
public int getPortfolio() {
return portfolio;
}
public void setPortfolio(int portfolio) {
this.portfolio = portfolio;
}
public int getBranchid() {
return branchid;
}
public void setBranchid(int branchid) {
this.branchid = branchid;
}
public String getBranchcode() {
return branchcode;
}
public void setBranchcode(String branchcode) {
this.branchcode = branchcode;
}
public String getBranchname() {
return branchname;
}
public void setBranchname(String branchname) {
this.branchname = branchname;
}
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getAddress3() {
return address3;
}
public void setAddress3(String address3) {
this.address3 = address3;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getGstno() {
return gstno;
}
public void setGstno(String gstno) {
this.gstno = gstno;
}
public String getIsactive() {
return isactive;
}
public void setIsactive(String isactive) {
this.isactive = isactive;
}
public String getSuuid() {
return suuid;
}
public void setSuuid(String suuid) {
this.suuid = suuid;
}
public String[][] getBranchlist() {
return branchlist;
}
public void setBranchlist(String[][] branchlist) {
this.branchlist = branchlist;
}
public int getBank() {
return bank;
}
public void setBank(int bank) {
this.bank = bank;
}
public int getBankbranchid() {
return bankbranchid;
}
public void setBankbranchid(int bankbranchid) {
this.bankbranchid = bankbranchid;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
}

View File

@@ -0,0 +1,153 @@
package matrix.nimble.admin.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
public class PortfolioHandler {
String ErrMsg;
String ErrCode;
String ErrDesc;
boolean ProcessFlag;
public PortfolioHandler()
{
setProcessFlag(true);
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public PortfolioBranch getPortfolioBranch(PortfolioBranch branch) {
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(isProcessFlag());
dbf.FetchRunQuery(517, new String[]{branch.getPortfolio()+""});
setProcessFlag(dbf.isProcessFlag());
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
if(isProcessFlag())
{
branch.setBranchlist(dbf.getResultArray());
}
return branch;
}
public String ChangeBranchStatus(String branch, String oprby)
{
String response = "";
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(isProcessFlag());
dbf.FetchRunQuery(518, new String[]{branch, oprby});
setProcessFlag(dbf.isProcessFlag());
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
if(isProcessFlag())
{
response = dbf.getProcResult();
if(response.equals("success"))
response = "{\"status\":\""+response+"\",\"message\":\""+dbf.getErrMsg()+"\"}";
else
response = "{\"status\":\"failed\",\"message\":\""+getErrCode()+":error:"+response+"\"}";
}
else {
response = "{\"status\":\"failed\",\"message\":\""+dbf.getErrMsg()+"\"}";
}
return response;
}
public PortfolioBranch getBranchDetails(PortfolioBranch branch) {
if (branch.getBranchid() != 0) {
DBFunctions dbf = new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(520, new String[] {branch.getBranchid()+""});
setProcessFlag(dbf.isProcessFlag());
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
if (dbf.isProcessFlag()) {
String [][] branchdetail = dbf.getResultArray();
branch.setBankbranchid(Integer.parseInt(branchdetail[0][0]));
branch.setBranchname(branchdetail[0][1]);
branch.setBranchcode(branchdetail[0][2]);
branch.setAddress1(branchdetail[0][3]);
branch.setAddress2(branchdetail[0][4]);
branch.setAddress3(branchdetail[0][5]);
branch.setState(branchdetail[0][6]);
branch.setGstno(branchdetail[0][7]);
branch.setBank(Integer.parseInt(branchdetail[0][8]));
branch.setPincode(branchdetail[0][9]);
}
}
else {
branch.setBank(-1);
}
return branch;
}
public PortfolioBranch SaveBranchDetail(String userID, String branchID, PortfolioBranch branch) {
String[] qvals = new String[15];
qvals[0] = branch.getBranchid()+"";
qvals[1] = branch.getBankbranchid()+"";
qvals[2] = branch.getBank()+"";
qvals[3] = branch.getPortfolio()+"";
qvals[4] = branch.getBranchcode();
qvals[5] = branch.getBranchname();
qvals[6] = branch.getAddress1();
qvals[7] = branch.getAddress2();
qvals[8] = branch.getAddress3();
qvals[9] = branch.getState();
qvals[10] = branch.getPincode();
qvals[11] = branch.getGstno();
qvals[12] = GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date());
qvals[13] = userID;
qvals[14] = branchID;
DBFunctions dbFunc = new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
dbFunc.FetchRunQuery(521, qvals);
if (dbFunc.isProcessFlag()) {
if (dbFunc.getProcResult().equals("Duplicate entry.")) {
setErrMsg(getErrCode() + ":error:" + dbFunc.getProcResult() + " Branch already exists.");
setProcessFlag(false);
} else {
setErrMsg(getErrCode() + ":info:Details updated successfully");
setProcessFlag(true);
}
branch.setBranchid(Integer.parseInt(dbFunc.getProcResult()));
} else {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(dbFunc.isProcessFlag());
}
return branch;
}
}

View File

@@ -0,0 +1,64 @@
package matrix.nimble.admin.model;
public class User {
private String uid;
private String loginid;
private String group;
private String displayname;
private String isactive;
private String suuid;
private String emailid;
private int resetpass;
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getLoginid() {
return loginid;
}
public void setLoginid(String loginid) {
this.loginid = loginid;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public String getDisplayname() {
return displayname;
}
public void setDisplayname(String displayname) {
this.displayname = displayname;
}
public String getIsactive() {
return isactive;
}
public void setIsactive(String isactive) {
this.isactive = isactive;
}
public String getSuuid() {
return suuid;
}
public void setSuuid(String suuid) {
this.suuid = suuid;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public int getResetpass() {
return resetpass;
}
public void setResetpass(int resetpass) {
this.resetpass = resetpass;
}
}

View File

@@ -0,0 +1,136 @@
package matrix.nimble.admin.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
public class UserHandler {
String ErrMsg;
String ErrCode;
String ErrDesc;
boolean ProcessFlag;
public UserHandler()
{
setProcessFlag(true);
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String[][] UserList(String compBranchid)
{
String[][] userlist = null;
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(isProcessFlag());
dbf.FetchRunQuery(364, new String[]{compBranchid});
setProcessFlag(dbf.isProcessFlag());
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
if(isProcessFlag())
{
userlist = dbf.getResultArray();
}
return userlist;
}
public String ChangerUserStatus(String user, String oprby)
{
String response = "";
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(isProcessFlag());
dbf.FetchRunQuery(509, new String[]{user, oprby});
setProcessFlag(dbf.isProcessFlag());
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
if(isProcessFlag())
{
response = dbf.getProcResult();
if(response.equals("success"))
response = "{\"status\":\""+response+"\",\"message\":\""+dbf.getErrMsg()+"\"}";
else
response = "{\"status\":\"failed\",\"message\":\""+getErrCode()+":error:"+response+"\"}";
}
else {
response = "{\"status\":\"failed\",\"message\":\""+dbf.getErrMsg()+"\"}";
}
return response;
}
public User GetUserDetails(User user) {
if (!user.getUid().equals("0")) {
DBFunctions dbf = new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(510, new String[] {user.getUid()+""});
setProcessFlag(dbf.isProcessFlag());
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
if (dbf.isProcessFlag()) {
String [][] userDetail = dbf.getResultArray();
user.setLoginid(userDetail[0][1]);
user.setDisplayname(userDetail[0][2]);
user.setGroup(userDetail[0][3]);
user.setEmailid(userDetail[0][4]);
}
}
else {
user.setGroup("-1");
}
return user;
}
public User SaveUserDetail(String userID, String branchID, User user) {
String[] qvals = new String[9];
qvals[0] = user.getUid();
qvals[1] = user.getLoginid();
qvals[2] = user.getDisplayname();
qvals[3] = user.getGroup();
qvals[4] = GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date());
qvals[5] = userID;
qvals[6] = branchID;
qvals[7] = user.getEmailid();
qvals[8] = user.getResetpass()+"";
DBFunctions dbFunc = new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
dbFunc.FetchRunQuery(512, qvals);
if (dbFunc.isProcessFlag()) {
if (dbFunc.getProcResult().equals("Duplicate entry.")) {
setErrMsg(getErrCode() + ":error:" + dbFunc.getProcResult() + " User already exists.");
setProcessFlag(false);
} else {
setErrMsg(getErrCode() + ":info:Details updated successfully");
setProcessFlag(true);
}
user.setUid(dbFunc.getProcResult());
} else {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(dbFunc.isProcessFlag());
}
return user;
}
}

View File

@@ -0,0 +1,52 @@
smtphost0=smtp.gmail.com
smtpport0=587
uname0=matrixinfotech.it6@gmail.com
pwd0=Nimble@2014
smtphost1=smtp.gmail.com
smtpport1=587
uname1=matrixinfotech.it1@gmail.com
pwd1=Nimble@2018
smtphost2=smtp.gmail.com
smtpport2=587
uname2=matrixinfotech.it2@gmail.com
pwd2=Nimble@2014
smtphost3=smtp.gmail.com
smtpport3=587
uname3=matrixinfotech.it3@gmail.com
pwd3=Nimble@2014
smtphost4=smtp.gmail.com
smtpport4=587
uname4=matrixinfotech.it4@gmail.com
pwd4=Algorithm@2015
smtphost5=smtp.gmail.com
smtpport5=587
uname5=matrixinfotech.it5@gmail.com
pwd5=Nimble@2015
smtphost6=smtp.gmail.com
smtpport6=587
uname6=matrixinfotech.it@gmail.com
pwd6=Nimble@2015
smtphost7=smtp.gmail.com
smtpport7=587
uname7=matrixinfotech.it7@gmail.com
pwd7=Nimble@2018
smtphost8=smtp.gmail.com
smtpport8=587
uname8=matrixinfotech.it2@gmail.com
pwd8=Nimble@2014
smtphost9=smtp.gmail.com
smtpport9=587
uname9=matrixinfotech.it3@gmail.com
pwd9=Nimble@2014
smtphost10=smtp.gmail.com
smtpport10=587
uname10=matrixinfotech.it4@gmail.com
pwd10=Algorithm@2015
smtphost11=smtp.gmail.com
smtpport11=587
uname11=matrixinfotech.it5@gmail.com
pwd11=Nimble@2015
smtphost12=smtp.rediffmailpro.com
smtpport12=587
uname12=matrixver4@matrixlimited.com
pwd12=matrixdel

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
lTdVBzyzc1n+pcfcZT2MohJkTFDAiaouI0de8R96Qw4=!C0L!9Va8Z4IzdrqQ5SCyari2VsvErk/GDXMjgKUepzYip9Z9nKglWDQE3J5+8yPLbtAh!C0L!MyUjDoz+jaeUiO57485K6A==!C0L!z3hPQUiN6QBom9qz2YeSIw==!C0L!0

View File

@@ -0,0 +1 @@
lTdVBzyzc1n+pcfcZT2MohJkTFDAiaouI0de8R96Qw4=!C0L!9Va8Z4IzdrqQ5SCyari2VgfQrOwGo4jxih14XwLQxImTOnL65ll4Ayxt8YYaiI31!C0L!MyUjDoz+jaeUiO57485K6A==!C0L!0A7Ci4vbf7v6Sc7f7C2VMg==!C0L!0

View File

@@ -0,0 +1 @@
lTdVBzyzc1n+pcfcZT2MohJkTFDAiaouI0de8R96Qw4=!C0L!9Va8Z4IzdrqQ5SCyari2VvE5G78wWEjyD0b5ITHWnx19nKglWDQE3J5+8yPLbtAh!C0L!MyUjDoz+jaeUiO57485K6A==!C0L!0A7Ci4vbf7v6Sc7f7C2VMg==!C0L!0

View File

@@ -0,0 +1 @@
lpehLUufgBwbQAxOyL70qRJkTFDAiaouI0de8R96Qw4=!C0L!ZNN4/JGmC2eZI8CVf4rdPedHFwBi73FZhl2n0B1/Tx8=!C0L!dJGkIOH9VRWCPRea1CLYZQ==!C0L!0A7Ci4vbf7v6Sc7f7C2VMg==!C0L!0

View File

@@ -0,0 +1,35 @@
select!C0L!select u.user_id,u.group_id,g.name,b.branch_id,b.branchname,b.branchcode,b.city,c.company_id,c.companyname,c.companycode,u.displayname,u.isactive from app_user u,user_group g,company c,company_branch b where u.loginid='val0' and u.loginpassword='val1' and u.group_id=g.group_id and u.company_id=c.company_id and u.branch_id=b.branch_id
select!C0L!select p.page_id,p.menulabel,p.targeturl,p.parentpage,p.pageorder,up.permission,p.targetwindow from permission up,pages p where up.group_id=val0 and p.isvisible=1 and up.page_id=p.page_id order by p.parentpage asc,p.pageorder desc
select!C0L!select p.portfolio_id,p.portname,b.bank_branch_id,b.bkbranchname from portfolio_branch pb,bank_branch b,portfolio p where p.portfolio_id=pb.portfolio_id and b.bank_branch_id = pb.bank_branch_id and p.isactive=1 and b.isactive=1
select!C0L!select b.bank_branch_id,b.bkbranchname from bank_branch b,portfolio_branch pb where pb.portfolio_id=val0 and pb.bank_branch_id=b.bank_branch_id and pb.isactive=1
select!C0L!select p.description as product,p.description from product p,product_mapping pm where pm.portfolio_id=val0 and pm.product_id=p.product_id and p.isactive=1
select!C0L!select description,description as city from master where type='CITY'
select!C0L!select description,aliasname from master where type='DOCUMENT'
select!C0L!select description,description as apptype from master where type='APPTYPE'
select!C0L!select description,description as apptype from master where type='CATEGORY'
select!C0L!select control from app_process where page_id=val0 and val1>0 and process_id not in (select process_id from denied_process where portfolio_id=val1 and isdenied=1)
select!C0L!select f.label,f.control,f.controlid,f.valuetypescript,f.validationscript,f.style,f.cssclass,f.field_id from field f,field_mapping fm where fm.portfolio_id=val0 and fm.field_id=f.field_id order by fm.fieldorder
select!C0L!select field_id,fieldvalue as valuepart, fieldvalue as textpart from field_value where field_id=val0 order by valorder
select!C0L!select concat(colony_id,'#-#',pincode,'#-#',city) as id,concat(location,' ',city) as location from colony where location like 'val0%' order by location
insert!C0L!insert into user_loginhistory (loginid,logintime) values ('val0','val1')
update!C0L!update user_loginhistory set logouttime='val0',ipaddr='val1' where logintime='val2' and loginid='val3'
procedure!C0L!call casepunching('insert into main (portfolio_id,bank_branch_id,mvcode,applno,bankcode,product,loanamount,customername,fathername,apptype,category,dob,contactperson,mobileno,specialinst,rv,sradd,rtv,raddr1,raddr2,raddr3,rlandmark,rcolony,rcity,rpincode,rphone,ov,rco,soadd,otv,companyname,oaddr1,oaddr2,oaddr3,olandmark,ocolony,ocity,opincode,department,designation,ophone,extension,pv,rcp,ocp,spadd,paddr1,paddr2,paddr3,plandmark,pcolony,pcity,ppincode,refv,refname1,refaddress1,refcontactno1,refname2,refaddress2,refcontactno2,docv,field1,field2,field3,field4,field5,field6,field7,field8,field9,field10,field11,field12,dtfield1,dtfield2,dtfield3,dtfield4,dtfield5,uuid,receivedate,addedon,addedby,company_id,branch_id) values (val0,val1,'val2','val3','val4','val5','val6','val7','val8','val9','val10','val11','val12','val13','val14',val15,val16,val17,'val18','val19','val20','val21',val22,'val23','val24','val25',val26,val27,val28,val29,'val30','val31','val32','val33','val34',val35,'val36','val37','val38','val39','val40','val41',val42,val43,val44,val45,'val46','val47','val48','val49',val50,'val51','val52',val53,'val54','val55','val56','val57','val58','val59',val60,'val61','val62','val63','val64','val65','val66','val67','val68','val69','val70','val71','val72','val73','val74','val75','val76','val77','val78','val79','val80',val81,val82,val83) ',val84,val85,val86)
update!C0L!update cutoff_operations c set telesheet= IFNULL((select -1 from denied_process d where process_id=9 and d.portfolio_id=c.portfolio_id and d.isdenied=1),(case when rtv+otv > 0 then 1 else 0 end)), allocation= IFNULL((select -1 from denied_process d where process_id=7 and d.portfolio_id=c.portfolio_id and d.isdenied=1),1), sms= IFNULL((select -1 from denied_process d where process_id=8 and d.portfolio_id=c.portfolio_id and d.isdenied=1),1), earlier= IFNULL((select -1 from denied_process d where process_id=11 and d.portfolio_id=c.portfolio_id and d.isdenied=1),1), negative= IFNULL((select -1 from denied_process d where process_id=12 and d.portfolio_id=c.portfolio_id and d.isdenied=1),1), cutoffon='val0',islocked=val3 where (c.cutoffby is null or c.cutoffby=0) and company_id=val1 and branch_id=val2 and (islocked=0 or islocked=val3)
select!C0L!select portfolio_id,concat(portname,' <b>(',count(*),')</b>') as portname,(case when sum(allocation)<=0 then -1 else 1 end) as allocation,(case when sum(sms)<=0 then -1 else 1 end) as sms,(case when sum(telesheet)>=1 then 1 else 0 end) as telesheet,(case when sum(earlier)<=0 then -1 else 1 end) as earlier,(case when sum(negative)<=0 then -1 else 1 end) as negative,(case when islocked!=val3 then 1 else 0 end) as islocked,(select concat(loginid,' (',displayname,')') from app_user where user_id=islocked) as lockedby from cutoff_operations where (cutoffby is null or cutoffby=0) and company_id=val1 and branch_id=val2 group by portfolio_id,portname,islocked
select!C0L!select distinct raddr1,raddr2,raddr3,rlandmark,rcolony,rcity,rpincode,rphone from main where applno='val0' and portfolio_id=val1 and receivedate='val2' and isdeleted=0 and rcolony>0
select!C0L!select distinct companyname,oaddr1,oaddr2,oaddr3,olandmark,ocolony,ocity,opincode,ophone,extension from main where applno='val0' and portfolio_id=val1 and receivedate='val2' and isdeleted=0 and ocolony>0
select!C0L!select distinct paddr1,paddr2,paddr3,plandmark,pcolony,pcity,ppincode from main where applno='val0' and portfolio_id=val1 and receivedate='val2' and isdeleted=0 and pcolony>0
select!C0L!select distinct bankcode,bank_branch_id,product,loanamount,'Co-Applicant' as apptype,contactperson,specialinst from main where applno='val0' and portfolio_id=val1 and receivedate='val2' and isdeleted=0
select!C0L!select case_id, uuid,portfolio_id, mvcode, applno, customername, apptype,rv,ov,pv,rtv,otv,refv,docv, DATE_FORMAT(receivedate, '%d/%m/%Y') as receivedate, bkbranchcode from editcasesgrid where portfolio_id=val0 and branch_id=val1 order by applno,bkbranchcode,customername
select!C0L!select case_id, portfolio_id, bank_branch_id, mvcode, applno, bankcode,product, loanamount, customername, fathername, apptype, category,dob, contactperson, mobileno, raddr1, raddr2, raddr3, rlandmark,rcolony, rcity, rpincode, rphone, companyname, oaddr1, oaddr2,oaddr3, olandmark, ocolony, ocity, opincode, department, designation,ophone, extension, paddr1, paddr2, paddr3, plandmark, pcolony,pcity, ppincode, refname1, refaddress1, refcontactno1, refname2,refaddress2, refcontactno2, rv, rtv, ov, otv, pv, refv, docv,rco, rcp, ocp, sradd, soadd, spadd, specialinst, receivedate,addedby, addedon, field1, field2, field3, field4, field5, field6,field7, field8, field9, field10, field11, field12, dtfield1,dtfield2, dtfield3, dtfield4, dtfield5, company_id, branch_id,uuid from main where case_id=val0 and uuid='val1'
procedure!C0L!call caseediting('update main set applno='val3',product='val5',customername='val7',apptype='val9',dob='val11',contactperson='val12',mobileno='val13',raddr1='val18',raddr2='val19',raddr3='val20',rlandmark='val21',rcolony=val22,rcity='val23',rpincode='val24',rphone='val25',companyname='val30',oaddr1='val31',oaddr2='val32',oaddr3='val33',olandmark='val34',ocolony=val35,ocity='val36',opincode='val37',department='val38',designation='val39',ophone='val40',extension='val41',paddr1='val46',paddr2='val47',paddr3='val48',plandmark='val49',pcolony=val50,pcity='val51',ppincode='val52',refname1='val54',refaddress1='val55',refcontactno1='val56',refname2='val57',refaddress2='val58',refcontactno2='val59',rv=val15,rtv=val17,ov=val26,otv=val29,pv=val42,refv=val53,docv=val60,rco=val27,rcp=val43,ocp=val44,specialinst='val14',bank_branch_id=val1,sradd=val16,soadd=val28,spadd=val45,bankcode='val4',loanamount='val6',fathername='val8',category='val10',field1='val61',field2='val62',field3='val63',field4='val64',field5='val65',field6='val66',field7='val67',field8='val68',field9='val69',field10='val70',field11='val71',field12='val72',dtfield1='val73',dtfield2='val74',dtfield3='val75',dtfield4='val76',dtfield5='val77',lasteditedon='val80',lasteditedby=val81',val84,val78)
procedure!C0L!call createcutofflist('val0')
update!C0L!update cutoff_operations set islocked=val2 where cutoffby > 0 and (islocked=0 or islocked=val2) and (allocatedby is null or allocatedby=0) and company_id=val0 and branch_id=val1 and allocation=1
select!C0L!select portfolio_id,concat(portname,' <b>(',count(*),')</b>') as portname,sum(rv) as rv,sum(ov) as ov,sum(pv) as pv,(case when islocked!=val2 then 1 else 0 end) as islocked,allocation,(select concat(loginid,' (',displayname,')') from app_user where user_id=islocked) as lockedby from cutoff_operations where (allocatedby is null or allocatedby=0) and cutoffby>=0 and company_id=val0 and branch_id=val1 and allocation=1 group by portfolio_id,portname,islocked,allocation
select!C0L!select mvcode,applno,customername,apptype,rv,ov,pv,(case when islocked!=val2 then 1 else 0 end) as islocked,(select concat(loginid,' (',displayname,')') from app_user where user_id=islocked) as lockedby,allocation,rcolony,ocolony,pcolony,uuid from cutoff_operations where (allocatedby is null or allocatedby=0) and cutoffby>0 and islocked=val2 and company_id=val0 and branch_id=val1 and allocation=1 and portfolio_id=val3 order by applno,apptype
procedure!C0L!call allocatecase('val0',val1,val2,val3,val4,val5,val6,val7,'val8')
update!C0L!update cutoff_operations set islocked=val2 where cutoffby > 0 and (islocked=0 or islocked=val2) and (telesheetby is null or telesheetby=0) and company_id=val0 and branch_id=val1 and telesheet=1
select!C0L!select portfolio_id,concat(portname,' <b>(',count(*),')</b>') as portname,sum(rtv) as rtv,sum(otv) as otv,sum(refv) as refv,(case when islocked!=val2 then 1 else 0 end) as islocked,telesheet,(select concat(loginid,' (',displayname,')') from app_user where user_id=islocked) as lockedby,(select outputformat from process_formats p where p.portfolio_id=portfolio_id and process_id=9) as outputformat,(select outputfunction from process_formats p where p.portfolio_id=portfolio_id and process_id=9) as outputfunction from cutoff_operations where (telesheetby is null or telesheetby=0) and cutoffby>=0 and company_id=val0 and branch_id=val1 and telesheet=1 group by portfolio_id,portname,islocked,telesheet
select!C0L!select mvcode,applno,customername,apptype,rtv,otv,refv,(case when islocked!=val2 then 1 else 0 end) as islocked,(select concat(loginid,' (',displayname,')') from app_user where user_id=islocked) as lockedby,telesheet,uuid from cutoff_operations where (telesheetby is null or telesheetby=0) and cutoffby>0 and islocked=val2 and company_id=val0 and branch_id=val1 and telesheet=1 and portfolio_id=val3 order by applno,apptype
update!C0L!update main_operations set islocked=val0,telesheeton='val1',telesheetby=val2 where uuid='val3'
select!C0L!select concat('Tele Verification Report ( ',portname,' )') as title,'Received Date' as recdate,receivedate,'Branch' as region,upper(b.bkbranchname) as branchname,'Verification Code' as vercode,mvcode,'Application Ref. No.' as fileno,upper(applno),'Agency Name' as agname,'MATRIX' as matrx,'RESIDENCE TELEPHONE' as ressec,'Name of Applicant' as appname,upper(customername),upper(apptype),'Resi Address of Applicant' as resadd,concat(upper(raddr1),' ',upper(raddr2),' ',upper(raddr3),' ',(case when rcity='-1' then '' else upper(rcity) end)) as radd,'Permanent Add of Applicant' as permadd,'' as padd,'Contact Telephone Numbers' as ctel,concat(mobileno,',',rphone) as contactno,'Type of Residence' as restype,'Owned' as owned,'Rented' as rented,'Company Accomodation' as compacc,'With Parents' withpar,'With Relatives' as withrel,'With Friends' as withf,'Paying Guest' as withp,'Special Instructions' as splinst,upper(specialinst),'The following is based on Telephonic conversation :' as t1,'Name of the Person spoken to' as spkto,'' as spkto2,'Relation with application' as relwith,'' as relwith2,'The following is based on CD-ROM Check:' as t2,'Name of applicant confirmed at given telephone number' as t3,'Yes' as ys,'No' as no,'Telecalling Log' as t4,'Attempt' as atmp,'1st' as fst,'2nd' as iind,'3rd' as rd,'4th' as fth,'5th' as ffth,'Date & Time of Calling' as dtc,'' as dt1,'' as dt2,'' as dt3,'' as dt4,'' as dt5,'Other Remarks :' as othrem,'' as ln1,'' as ln2,'' as ln3,'' as ln4,'' as ln5,'Televerification Results' as rtr,'Positive' as pos,'Negative' as neg,'OFFICE TELEPHONE' as oftel,'Office Telephone Numbers' as oftelno,concat(mobileno,'/',ophone) as ocontactno,'Extn. No.' as ext,extension,'Name of Applicant' as appname,upper(customername) as ocust,'Designation' as des,upper(designation),'Working Since' as wks,'' as wks1,'Department' as dept,upper(department) as department,'For Self employed-Type of organization' as t6,'Proprietorship' as propr,'Partnership' as partnr,'Pvt. Ltd.' as pvtld,'Public. Ltd.' as publtd,'Others' as othr,'Nature of Business' as nob,'Trading' as trd,'Manufacturing' as mfg,'Processing' as prcs,'Builder' as buildr,'Contractor' as contr,'' as nob1,'Brokerage' as brok,'Consultancy' as consult,'Professional' as profs,'Others' as othr,'' as blnk,'Nature of the Company' as noc,'' as noc1,'Office Address' as offad,concat(upper(oaddr1),' ',upper(oaddr2),' ',upper(oaddr3),' ',(case when ocity='-1' then '' else upper(ocity) end)) as oaddr,'Landmarks' as lndm,'' as ldnmk,'Special Instructions' as sploins,upper(specialinst) as ospel,'The following is based on Telephonic conversation :' as t7,'Name of the person spoken to' as pspkto,'' as pspkt2,'Designation' as cdesig,'' as cdesig1,'Relationship with applicant' as orelwith,'Colleague' as ocoll,'Partner' as optnr,'Superior' as osup,'Relative' as orelv,'Others' as othro,'The following is based on CD-ROM Check:' as t8,'Name of applicant confirmed at given telephone number' as t9,'Yes' as oys,'No' as onso,'Telecalling Log' as t10,'Attempt' as oatmp,'1st' as of1,'2nd' as of2,'3rd' as of3,'4th' as of4,'5th' as of5,'Date & Time of Calling' as odt,'' as odt1,'' as odt2,'' as odt3,'' as odt4,'' as odt5,'Others Remarks :' as othrrem,'' as orm1,'' as orm2,'' as orm3,'' as orm4,'' as orm5,'Televerification Results' as otlst,'Positive' as opost,'Negative' as onegt,rtv,otv from cutoff_operations c,bank_branch b where c.bank_branch_id=b.bank_branch_id and portfolio_id=val0 and islocked=val1 and telesheeton='val2' and (rtv=1 or otv=1)

View File

@@ -0,0 +1,10 @@
cols=40
repdata=ReportDate!C0L!03-Nov-12!C0L!Region!C0L!PIT!C0L!Verification Code!C0L!A75956!C0L!Application Ref. No.!C0L!120602!C0L!Agency Name!C0L!MATRIX!C0L!RESIDENCE TELEPHONE!C0L!Name of Applicant!C0L!KAILASH KUMAR!C0L!APPLICANT!C0L!Resi Address of Applicant!C0L!WZ 632/ D SRI NAGAR GALI NO 2!C0L!Permanent Add of Applicant!C0L!permanent address!C0L!Contact Telephone Numbers!C0L!9811074450, 9811074450!C0L!Type of Residence!C0L!Owned!C0L!Rented!C0L!Company Accomodation!C0L!With Parents!C0L!With Relatives!C0L!With Friends!C0L!Paying Guest!C0L!Special Instructions!C0L!Instruction Special!C0L!The following is based on Telephonic conversation :!C0L!Name of the Person spoken to!C0L!Jisse baat ki uska naam!C0L!Relation with application!C0L!Jisse baat ki uska relation!C0L!The following is based on CD-ROM Check:!C0L!Name of applicant confirmed at given telephone number!C0L!Yes!C0L!No!C0L!Telecalling Log!C0L!Attempt!C0L!1st!C0L!2nd!C0L!3rd!C0L!4th!C0L!5th!C0L!Date & Time of Calling!C0L!12/102012 4:55!C0L!12/102012 4:56!C0L!12/102012 4:57!C0L!12/102012 4:58!C0L!12/102012 4:59!C0L!Other Remarks :!C0L!!C0L!!C0L!!C0L!!C0L!!C0L!Televerification Results!C0L!Positive!C0L!Negative!C0L!OFFICE TELEPHONE!C0L!Office Telephone Numbers!C0L!98,102,231,759,811,000,000!C0L!Extn. No.!C0L!!C0L!Name of Applicnat!C0L!KAILASH KUMAR!C0L!Designation!C0L!AG 3E No!C0L!Working Since!C0L!!C0L!Department!C0L!CEG & EHV ENGG!C0L!For Self employed-Type of organization!C0L!Proprietorship!C0L!Partnership!C0L!Pvt. Ltd.!C0L!Public. Ltd.!C0L!Others!C0L!Nature of Business!C0L!Trading!C0L!Manufacturing!C0L!Processing!C0L!Builder!C0L!Contractor!C0L!!C0L!Brokerage!C0L!Consultancy!C0L!Professional!C0L!Others!C0L!!C0L!Nature of the Company!C0L!!C0L!Office Address!C0L!2/9 SECTOR 9 ROHINI DELHI!C0L!Landmarks!C0L!!C0L!Special Instructions!C0L!!C0L!The following is based on Telephonic conversation :!C0L!Name of the person spoken to!C0L!!C0L!Designation!C0L!!C0L!Relationship with applicant!C0L!Colleague!C0L!Partner!C0L!Superior!C0L!Relative!C0L!Others!C0L!The following is based on CD-ROM Check:!C0L!Name of applicant confirmed at given telephone number!C0L!Yes!C0L!No!C0L!Telecalling Log!C0L!Attempt!C0L!1st!C0L!2nd!C0L!3rd!C0L!4th!C0L!5th!C0L!Date & Time of Calling!C0L!!C0L!!C0L!!C0L!!C0L!!C0L!Others Remarks :!C0L!!C0L!!C0L!!C0L!!C0L!!C0L!Televerification Results!C0L!Positive!C0L!Negative
fontstyle=1!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!1!C0L!1!C0L!0!C0L!1!C0L!1!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!1!C0L!1!C0L!1!C0L!1!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!1!C0L!1!C0L!1!C0L!1!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0
alignment=C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!C!C0L!C!C0L!L!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!C!C0L!R!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!L!C0L!C!C0L!C!C0L!L!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!C!C0L!R
paddingleft=0!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!10!C0L!3!C0L!3!C0L!3!C0L!3!C0L!10!C0L!3!C0L!3!C0L!3!C0L!10!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!10!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!10!C0L!3!C0L!3!C0L!3!C0L!10!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3
colspan=40!C0L!5!C0L!7!C0L!4!C0L!11!C0L!7!C0L!8!C0L!8!C0L!8!C0L!12!C0L!12!C0L!40!C0L!12!C0L!16!C0L!12!C0L!12!C0L!28!C0L!12!C0L!28!C0L!12!C0L!28!C0L!6!C0L!3!C0L!3!C0L!8!C0L!5!C0L!5!C0L!5!C0L!5!C0L!12!C0L!28!C0L!40!C0L!12!C0L!28!C0L!12!C0L!28!C0L!40!C0L!20!C0L!10!C0L!10!C0L!40!C0L!10!C0L!6!C0L!6!C0L!6!C0L!6!C0L!6!C0L!10!C0L!6!C0L!6!C0L!6!C0L!6!C0L!6!C0L!40!C0L!40!C0L!40!C0L!40!C0L!40!C0L!40!C0L!15!C0L!10!C0L!15!C0L!40!C0L!8!C0L!16!C0L!4!C0L!12!C0L!8!C0L!16!C0L!4!C0L!12!C0L!8!C0L!16!C0L!4!C0L!12!C0L!13!C0L!6!C0L!5!C0L!5!C0L!5!C0L!6!C0L!13!C0L!6!C0L!5!C0L!5!C0L!5!C0L!6!C0L!13!C0L!6!C0L!5!C0L!5!C0L!5!C0L!6!C0L!10!C0L!30!C0L!10!C0L!30!C0L!10!C0L!30!C0L!10!C0L!30!C0L!40!C0L!13!C0L!11!C0L!4!C0L!12!C0L!13!C0L!5!C0L!5!C0L!6!C0L!6!C0L!5!C0L!40!C0L!20!C0L!10!C0L!10!C0L!40!C0L!10!C0L!6!C0L!6!C0L!6!C0L!6!C0L!6!C0L!10!C0L!6!C0L!6!C0L!6!C0L!6!C0L!6!C0L!40!C0L!40!C0L!40!C0L!40!C0L!40!C0L!40!C0L!15!C0L!10!C0L!15
border=0!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!0!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!0!C0L!15!C0L!15!C0L!15!C0L!15!C0L!0!C0L!15!C0L!15!C0L!15!C0L!0!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!108!C0L!102!C0L!107!C0L!0!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!104!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!110!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!0!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!0!C0L!15!C0L!15!C0L!15!C0L!0!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!15!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!108!C0L!102!C0L!107
paddingtop=0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0
paddingbottom=8!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0
paddingright=0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!3

View File

@@ -0,0 +1,10 @@
cols=120
repdata=Customer Visit Report!C0L!SECURED BUSINESS LOAN-Periodic Review!C0L!Customer Name:!C0L!define!C0L!Card Id:!C0L!define!C0L!Loan No:!C0L!define!C0L!Facility Since:!C0L!define!C0L!Sanctioned Amount: Rs!C0L!define!C0L!lacs!C0L!Current O/S!C0L!define!C0L!Balance Tenure!C0L!define!C0L!Total Borrowing From Banking/Financial Sector: Rs !C0L!define!C0L!lacs!C0L!Prepared By : !C0L!define!C0L!Person Met : !C0L!define!C0L!Visit Date : !C0L!define!C0L!Address of Place Visited :!C0L!define!C0L!City Name : !C0L!define!C0L!Sr. No.!C0L!Description!C0L!Yes/No!C0L!1./!C0L!Nature Of Business ?!C0L!Blnk!C0L!Manufacturing/Service/Trading Whole Sale/Trading Retail Industry :-!C0L!2./!C0L!Is there a significant dip or spurt in sales ?!C0L!YES/NO!C0L!If yes- aproximate % age-------------%!C0L!3./!C0L!Is there a significant delay of payments From customer debtors?!C0L!YES/NO!C0L!If yes- aproximate days-------------days!C0L!4./!C0L!Is there a change in the line of business ?!C0L!YES/NO!C0L!If yes,has there been any diversion of funds to real estate!C0L!5./!C0L!Future Expansion plans!C0L!YES/NO!C0L!If Yes-!C0L!Blank!C0L!6./!C0L!Any new loans added in last 12 month!C0L!YES/NO!C0L!If Yes-(pls give details)!C0L!1)!C0L!Blank!C0L!2)!C0L!Blank!C0L!7./!C0L!Has the customer indicated that they are unable to reply loans or interest or any other obligation ?!C0L!YES/NO!C0L!If yes- Temporary problem/Major Problem!C0L!Remarks: !C0L!8./!C0L!Any change in constitution of business - any addtion /deletion of partners/directors!C0L!YES/NO!C0L!If Yes-(pls give details)!C0L!1)!C0L!Blank!C0L!2)!C0L!Blank!C0L!9/!C0L!Are the collaterals provided maintained in satisfactory condition ?!C0L!Yes/No!C0L!10./!C0L!Is there any other relevant information ?!C0L!Yes/No!C0L!If Yes (Please fill remarks below)!C0L!11/!C0L!SC/ST status of the borrower Yes NO!C0L!Yes/No!C0L!(In case of proprietorship , the SC/ST status of the proprietor is to be considered.Ignore if constitution is other than individual or sole proprietorship))!C0L!12./!C0L!End Use of Loan :!C0L!YES/NO!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Remarks :!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Sign :!C0L!Blank!C0L!Date :!C0L!Blank!C0L!Blnk!C0L!(For Office Use Only)!C0L!Reviewer Comment :!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Blank!C0L!Are you satisfied with the conduct of the account ?!C0L!YES/NO!C0L!Blank!C0L!Reviewer Name :!C0L!Blank!C0L!Designation!C0L!Blank!C0L!Blnk!C0L!Signature:!C0L!Blank!C0L!Date :!C0L!Blank!C0L!Blnk
fontstyle=1!C0L!0!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!4!C0L!1!C0L!1!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!4!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!4!C0L!0!C0L!4!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!4!C0L!0!C0L!4!C0L!1!C0L!1!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!1!C0L!0!C0L!4!C0L!4!C0L!4!C0L!0!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!1!C0L!4!C0L!1!C0L!4!C0L!0!C0L!1!C0L!1!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!0!C0L!1!C0L!0!C0L!1!C0L!4!C0L!1!C0L!4!C0L!0!C0L!1!C0L!4!C0L!1!C0L!4!C0L!0
alignment=C!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!L!C0L!C!C0L!C!C0L!C!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L
paddingleft=0!C0L!0!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3
colspan=120!C0L!120!C0L!20!C0L!100!C0L!15!C0L!25!C0L!15!C0L!65!C0L!15!C0L!30!C0L!20!C0L!20!C0L!35!C0L!15!C0L!35!C0L!25!C0L!45!C0L!50!C0L!20!C0L!50!C0L!15!C0L!25!C0L!20!C0L!25!C0L!15!C0L!20!C0L!35!C0L!85!C0L!15!C0L!105!C0L!10!C0L!100!C0L!10!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!10!C0L!90!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!90!C0L!10!C0L!90!C0L!10!C0L!100!C0L!10!C0L!100!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!90!C0L!10!C0L!90!C0L!10!C0L!100!C0L!10!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!10!C0L!100!C0L!100!C0L!100!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!8!C0L!30!C0L!8!C0L!30!C0L!44!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!120!C0L!20!C0L!30!C0L!20!C0L!30!C0L!20!C0L!20!C0L!30!C0L!20!C0L!30!C0L!20
border=0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!15!C0L!15!C0L!15!C0L!15!C0L!109!C0L!15!C0L!110!C0L!15!C0L!109!C0L!15!C0L!110!C0L!15!C0L!109!C0L!15!C0L!110!C0L!15!C0L!109!C0L!15!C0L!110!C0L!15!C0L!109!C0L!15!C0L!105!C0L!106!C0L!15!C0L!109!C0L!15!C0L!104!C0L!4!C0L!8!C0L!105!C0L!106!C0L!15!C0L!109!C0L!15!C0L!104!C0L!110!C0L!15!C0L!109!C0L!15!C0L!104!C0L!4!C0L!8!C0L!105!C0L!106!C0L!15!C0L!15!C0L!15!C0L!15!C0L!109!C0L!15!C0L!110!C0L!15!C0L!109!C0L!15!C0L!110!C0L!15!C0L!109!C0L!15!C0L!104!C0L!104!C0L!110!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0
paddingtop=5!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2
paddingbottom=2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!2
paddingright=0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0

View File

@@ -0,0 +1,10 @@
cols=120
repdata=REFERENCE TELE - CHECK LIST!C0L!Name of Applicant!C0L!YASHPAL SINGH!C0L!File No:!C0L!3106002518!C0L!Refree # 1!C0L!Name!C0L!NAME OF REFREE!C0L!Address!C0L!Address of refree!C0L!blank!C0L!blank!C0L!blank!C0L!blank!C0L!blank!C0L!blank!C0L!Tel No.!C0L!Telephone No OF Refree!C0L!Questions!C0L!1. Name of the Person Contacted!C0L!blank!C0L!2. How is referee related to the applicant!C0L!blank!C0L!3. Since how long referee is known to the applicant!C0L!blank!C0L!4. Does referee recommend this loan to the Applicant!C0L!blank!C0L!blank!C0L!Refree # 2!C0L!Name!C0L!NAME OF REFREE!C0L!Address!C0L!Address of refree!C0L!blank!C0L!blank!C0L!blank!C0L!blank!C0L!blank!C0L!blank!C0L!Tel No.!C0L!Telephone No OF Refree!C0L!Questions!C0L!1. Name of the Person Contacted!C0L!blank!C0L!2. How is referee related to the applicant!C0L!blank!C0L!3. Since how long referee is known to the applicant!C0L!blank!C0L!4. Does referee recommend this loan to the Applicant!C0L!blank
fontstyle=2!C0L!1!C0L!1!C0L!1!C0L!1!C0L!1!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!1!C0L!1!C0L!1!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!1!C0L!1!C0L!1!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0!C0L!1!C0L!0
alignment=C!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L!C0L!L
paddingleft=0!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!12!C0L!3!C0L!12!C0L!3!C0L!12!C0L!3!C0L!12!C0L!3!C0L!0!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!12!C0L!3!C0L!12!C0L!3!C0L!12!C0L!3!C0L!12!C0L!3
colspan=120!C0L!30!C0L!45!C0L!20!C0L!25!C0L!120!C0L!30!C0L!90!C0L!30!C0L!90!C0L!30!C0L!90!C0L!30!C0L!90!C0L!30!C0L!90!C0L!30!C0L!90!C0L!120!C0L!40!C0L!80!C0L!40!C0L!80!C0L!40!C0L!80!C0L!40!C0L!80!C0L!120!C0L!120!C0L!30!C0L!90!C0L!30!C0L!90!C0L!30!C0L!90!C0L!30!C0L!90!C0L!30!C0L!90!C0L!30!C0L!90!C0L!120!C0L!40!C0L!80!C0L!40!C0L!80!C0L!40!C0L!80!C0L!40!C0L!80
border=2!C0L!2!C0L!2!C0L!2!C0L!2!C0L!0!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!2!C0L!0!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2!C0L!0!C0L!2
paddingtop=10!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!5!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3!C0L!3
paddingbottom=10!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!5!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4!C0L!4
paddingright=0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0!C0L!0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,218 @@
package matrix.nimble.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import matrix.nimble.utilities.DBFunctions;
@Controller
public class AjaxV2 {
@RequestMapping(value="dashgetvisits",method=RequestMethod.GET )
public @ResponseBody String InitDashboard(@RequestParam String usid)
{
DBFunctions DBF=new DBFunctions("1001");
DBF.setProcessFlag(true);
String response= DBF.FetchRunQuery(473, new String[] {usid});
if(!DBF.isProcessFlag())
{
response=DBF.getErrMsg();
}else {
response = DBF.getProcResult();
}
return response;
}
@RequestMapping(value="dashpartial",method=RequestMethod.GET )
public @ResponseBody String PartialDashboard(@RequestParam String widget,@RequestParam String params)
{
DBFunctions DBF=new DBFunctions("1001");
DBF.setProcessFlag(true);
String paramsJson = "{}";
if(widget.equals("3monthsfigures")) {
paramsJson = "{\"monthgap\":"+params+"}";
}
String response= DBF.FetchRunQuery(525, new String[] {widget,paramsJson});
if(!DBF.isProcessFlag())
{
response=DBF.getErrMsg();
}else {
response = DBF.getProcResult();
}
return response;
}
@RequestMapping(value="dashdethourlymis",method=RequestMethod.GET )
public @ResponseBody String hourlyCasesDetails(@RequestParam String usid,@RequestParam String hour)
{
DBFunctions DBF=new DBFunctions("1002");
DBF.setProcessFlag(true);
String response = "";
String condition = "";
if(!usid.equals("0")) {
condition = condition+ " and user_id="+usid;
}
if(!hour.equals("0")) {
condition = condition+ " and timeperiod="+hour;
}
DBF.FetchRunQuery(477, new String[] {condition});
if(!DBF.isProcessFlag())
{
response=DBF.getErrMsg();
}else {
response = "{\"data\":[";
String [][] result = DBF.getResultArray();
if(result.length > 0) {
for(int indx=0; indx < result.length; indx++)
{
response = response + "{\"displayname\":\""+result[indx][0]+"\",\"portname\":\""+result[indx][1]+"\",\"timeperiod\":"
+result[indx][2]+",\"portfolio_id\":"+result[indx][3]+",\"mvcode\":\""+result[indx][4]+"\",\"applno\":\""
+result[indx][5]+"\",\"customername\":\""+result[indx][6]+"\",\"recdate\":\""+result[indx][7]+"\",\"raddr\":\""
+result[indx][8]+"\",\"oaddr\":\""+result[indx][9]+"\",\"paddr\":\""+result[indx][10]+"\",\"resiverifier\":\""
+result[indx][11]+"\",\"offverifier\":\""+result[indx][12]+"\",\"propverifier\":\""+result[indx][13]+"\",\"doneon\":\""
+result[indx][14]+"\",\"overallstatus\":\""+result[indx][15]+"\"},";
}
response = response.substring(0, response.length()-1);
}
response = response+"]}";
}
return response;
}
@RequestMapping(value="dashdetriskmis",method=RequestMethod.GET )
public @ResponseBody String riskAlertCases(@RequestParam String risklevel)
{
DBFunctions DBF=new DBFunctions("1003");
DBF.setProcessFlag(true);
String response = "";
String condition = "oprrisk='1' or oprrisk='2' or oprrisk='3' or oprrisk='4'";
if(risklevel !=null && risklevel.length() > 0) {
condition = "oprrisk='"+risklevel+"'";
}
DBF.FetchRunQuery(483, new String[] {condition});
if(!DBF.isProcessFlag())
{
response=DBF.getErrMsg();
}else {
response = "{\"data\":[";
String [][] result = DBF.getResultArray();
if(result.length > 0) {
for(int indx=0; indx < result.length; indx++)
{
response = response + "{\"verifiercode\":\""+result[indx][0]+"\",\"addr\":\""+result[indx][1]+"\",\"oprrisk\":"
+result[indx][2]+",\"portname\":\""+result[indx][3]+"\",\"customername\":\""+result[indx][4]+"\",\"applno\":\""
+result[indx][5]+"\",\"recdate\":\""+result[indx][6]+"\",\"batch\":\""+result[indx][7]+"\",\"visit\":\""
+result[indx][8]+"\",\"oprname\":\""+result[indx][9]+"\",\"downloaded\":\""+result[indx][10]+"\"},";
}
response = response.substring(0, response.length()-1);
}
response = response+"]}";
}
return response;
}
@RequestMapping(value="dashdetageingmis",method=RequestMethod.GET )
public @ResponseBody String ageingCases(@RequestParam int age,@RequestParam int portfolioid)
{
DBFunctions DBF=new DBFunctions("1003");
DBF.setProcessFlag(true);
String response = "";
String condition = portfolioid > 0 ? "portfolio_id="+portfolioid+" and " : "";
if(age >= 0) {
if(age == 0) {
condition = condition + "receivedon > current_date";
}
else if(age == 5){
condition = condition + "receivedon < current_date-4";
}
else {
condition = condition + "receivedon < current_date-"+(age-1)+" and receivedon > current_date-"+age;
}
}
if(age < 0) {
condition = condition + "1=1";
}
DBF.FetchRunQuery(486, new String[] {condition});
if(!DBF.isProcessFlag())
{
response=DBF.getErrMsg();
}else {
response = "{\"data\":[";
String [][] result = DBF.getResultArray();
if(result.length > 0) {
for(int indx=0; indx < result.length; indx++)
{
response = response + "{\"portname\":\""+result[indx][0]+"\",\"mvcode\":\""+result[indx][1]+"\",\"applno\":\""
+result[indx][2]+"\",\"customername\":\""+result[indx][3]+"\",\"receivedon\":\""+result[indx][4]+"\",\"rv\":"
+result[indx][5]+",\"ov\":"+result[indx][6]+",\"pv\":"+result[indx][7]+",\"verifier\":\""
+result[indx][8]+"\",\"pendingremarks\":\""+result[indx][9]+"\"},";
}
response = response.substring(0, response.length()-1);
}
response = response+"]}";
}
return response;
}
@RequestMapping(value="scanstartreportfigures",method=RequestMethod.GET )
public @ResponseBody String StarReportFigureMonthly(@RequestParam String portid,@RequestParam String month)
{
DBFunctions DBF=new DBFunctions("1001");
DBF.setProcessFlag(true);
String response= DBF.FetchRunQuery(506, new String[] {portid, month});
if(!DBF.isProcessFlag())
{
response=DBF.getErrMsg();
}else {
response = DBF.getProcResult();
}
return response;
}
@RequestMapping(value="calculatetat",method=RequestMethod.GET)
public @ResponseBody String CalculateTat(@RequestParam String uuid,@RequestParam String type,@RequestParam String key)
{
DBFunctions DBF=new DBFunctions("1001");
DBF.setProcessFlag(true);
String response= DBF.FetchRunQuery(529, new String[] {uuid, type});
if(!DBF.isProcessFlag())
{
response = "{\"status\":\"failed\",\"response\":\""+DBF.getErrMsg()+"\"}";
}else {
response = "{\"status\":\"success\",\"response\":\""+DBF.getProcResult()+"\",\"key\":\""+key+"\"}";
}
return response;
}
}

View File

@@ -0,0 +1,128 @@
package matrix.nimble.controller;
import javax.servlet.http.HttpServletRequest;
//spring libraries
import matrix.nimble.model.DownloadUploadSettings;
import matrix.nimble.model.Session;
import matrix.nimble.model.UploadHandler;
import matrix.nimble.utilities.ModuleFunctions;
import matrix.nimble.utilities.GlobalClass;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
@Controller
@SessionAttributes({"Sessvals"})
public class CaseUpload {
@RequestMapping(value="caseupload",method=RequestMethod.POST )
public String UploadCases(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(),"download"));
DownloadUploadSettings us=new DownloadUploadSettings();
us.setPortfolioid("-1");
model.addAttribute("uploadsettings",us);
return "general/onlinedownload";
}
@RequestMapping(value="downloadsettings",method=RequestMethod.POST )
public String FetchDownloadSettings(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="uploadsettings") DownloadUploadSettings us)
{
UploadHandler UH=new UploadHandler();
UH.setErrCode("1111");
UH.setProcessFlag(true);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(),"download"));
UH.FetchSettings(us,158);
model.addAttribute("uploadsettings", us);
if(us.getDomainname().equals("localhost"))
{
return "general/offlinedownload";
}
else
{
return "general/onlinedownload";
}
}
@RequestMapping(value = "/startexcelupload", method = RequestMethod.POST)
public String StartExcelUpload(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="uploadsettings") DownloadUploadSettings us,@RequestParam MultipartFile file)
{
HSSFWorkbook excel = null;
XSSFWorkbook excelx = null;
UploadHandler UH=new UploadHandler();
UH.setErrCode("1111");
UH.setProcessFlag(true);
try
{
if(file.getOriginalFilename().endsWith("xlsx"))
{
excelx = new XSSFWorkbook(file.getInputStream());
UH.StartXLXUpload(us,Sessvals.getUserID(),Sessvals.getCompanyID(),Sessvals.getBranchID(),excelx);
}
else if(file.getOriginalFilename().endsWith("xls"))
{
excel = new HSSFWorkbook(file.getInputStream());
UH.StartXLUpload(us,Sessvals.getUserID(),Sessvals.getCompanyID(),Sessvals.getBranchID(),excel);
}
else
{
UH.setErrMsg(UH.getErrCode()+"INFIL:error:Invlaid file format. Please check the format of file you are uploading.");
UH.setProcessFlag(false);
}
}catch(Exception exce)
{
UH.setErrMsg(UH.getErrCode()+"INFIL:error:"+exce.getMessage());
UH.setProcessFlag(false);
}
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(),"download"));
model.addAttribute("uploadsettings", us);
model.addAttribute("msg",UH.getErrMsg());
return "general/offlinedownload";
}
@RequestMapping(value="startupload",method=RequestMethod.POST )
public String StartUpload(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="uploadsettings") DownloadUploadSettings us)
{
UploadHandler UH=new UploadHandler();
UH.setErrCode("1111");
UH.setProcessFlag(true);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(),"download"));
UH.StartUpload(us,Sessvals.getUserID(),Sessvals.getCompanyID(),Sessvals.getBranchID());
model.addAttribute("uploadsettings", us);
model.addAttribute("msg",UH.getErrMsg());
return "general/onlinedownload";
}
@RequestMapping(value="reportupload",method=RequestMethod.POST )
public String UploadReports(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(),"upload"));
DownloadUploadSettings us=new DownloadUploadSettings();
us.setPortfolioid("-1");
model.addAttribute("uploadsettings",us);
return "general/uploadreports";
}
@RequestMapping(value="fileuploadsettings",method=RequestMethod.POST )
public String FetchUploadSettings(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="uploadsettings") DownloadUploadSettings us)
{
UploadHandler UH=new UploadHandler();
UH.setErrCode("1112");
UH.setProcessFlag(true);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(),"upload"));
UH.FetchSettings(us,159);
UH.FetchFilesToUpload(us);
model.addAttribute("uploadsettings", us);
return "general/uploadreports";
}
public String [][] FillPortList(String BranchId,String Action)
{
return new ModuleFunctions("1001").GetResultArray(157,(BranchId+GlobalClass.ColDelim+Action+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}

View File

@@ -0,0 +1,62 @@
package matrix.nimble.controller;
import java.util.HashMap;
import java.util.Map;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("doc/")
public class DocAjax {
@RequestMapping(value="updcasedocs",method=RequestMethod.POST )
public @ResponseBody String UpdateEmpRecords(@RequestBody String jsonString)
{
String [] qparams=null;
Map<String,String> jsonMap=new HashMap<String, String>();
String [] splitted = (jsonString.replace(":\"\"", ":\"null\"").replace("\",\"","!R0@W@0L!").replace("\":\"","!C@~@L!").replace("{\"", "").replace("\"}", "")).split("!R0@W@0L!");
String query="";
String opron = GlobalClass.DateTime("yyyy/MM/dd",new java.util.Date());
for(int indx=0;indx < splitted.length; indx++)
{
jsonMap.put(splitted[indx].split("!C@~@L!")[0], splitted[indx].split("!C@~@L!")[1]);
}
String opr = jsonMap.get("doc_id").toString().equals("0") ? "ADD DOC":"UPDATE DOC";
if(jsonMap.get("doc_id").toString().equals("0"))
{
query = "INSERT INTO case_documents(uuid, doctype, bank_id, docholdername, serviceprovider,uniqueno, yearmonth,";
query += "city, docvendor, addedby, addedon) values (''"+jsonMap.get("uuid")+"'',"+jsonMap.get("doctype")+",";
query += jsonMap.get("serviceprovider_hidden")+",''"+jsonMap.get("docholdername")+"'',''"+jsonMap.get("serviceprovider")+"'',";
query += "''"+jsonMap.get("uniqueno")+"'',''"+jsonMap.get("yearmonth")+"'',''"+jsonMap.get("city")+"'',";
query += jsonMap.get("vendor_id")+","+jsonMap.get("usid")+",''"+opron+"'')";
}
else
{
query = "update case_documents set doctype=''"+jsonMap.get("doctype")+"'',bank_id="+jsonMap.get("serviceprovider_hidden")+",";
query += "docholdername=''"+jsonMap.get("docholdername")+"'',serviceprovider=''"+jsonMap.get("serviceprovider")+"'',";
query += "uniqueno=''"+jsonMap.get("uniqueno")+"'',yearmonth=''"+jsonMap.get("yearmonth")+"'',";
query += "city=''"+jsonMap.get("city")+"'',docvendor=''"+jsonMap.get("vendor_id")+"'',";
query += "addedby="+jsonMap.get("usid")+",addedon=''"+jsonMap.get("opr")+"'' where doc_id="+jsonMap.get("doc_id");
}
qparams = new String[]{query,jsonMap.get("usid").toString(),opr,opron};
String response="failed";
DBFunctions DBF=new DBFunctions("D001");
DBF.setProcessFlag(true);
DBF.FetchRunQuery(354, qparams);
if(DBF.isProcessFlag())
{
response="{\"status\":\"success\",\"did\":\""+DBF.getProcResult()+"\",\"result\":"+jsonString+"}";
}
else
{
response="{\"status\":\"success\",\"did\":\""+jsonMap.get("doc_id")+"\",\"result\":\""+DBF.getErrMsg()+"\"}";
}
return response;
}
}

View File

@@ -0,0 +1,90 @@
package matrix.nimble.controller;
import matrix.nimble.edp.cutoff.model.SMS;
import matrix.nimble.model.GeneralHandler;
import matrix.nimble.model.LoginKey;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.CommonFunctions;
import matrix.nimble.utilities.GlobalClass;
//servlet libraries
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes("Sessvals")
public class General {
@RequestMapping(value="/emails",method=RequestMethod.POST )
public String FetchEmails(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("mailtype",request.getParameter("pageval"));
return "/general/mailbox";
}
//---> SMS
@RequestMapping(value="sms",method=RequestMethod.POST )
public String SMS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
SMS Sms=new SMS();
Sms.setErrCode("1005");
Sms.setProcessFlag(true);
session.removeAttribute("UUID");
session.setAttribute("gateway", "");
session.setAttribute("Company", Sessvals.getCompanyID());
session.setAttribute("Branch", Sessvals.getBranchID());
session.setAttribute("User", Sessvals.getUserID());
CommonFunctions comFunc=new CommonFunctions();
comFunc.setErrCode("1005");
comFunc.setProcessFlag(true);
String [] RequestVal=request.getParameter("pageval").split("!SPLT!");
String [][] GatewayList=comFunc.GetSmsGateways((Sessvals.getCompanyID()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim),38);
if(comFunc.isProcessFlag())
{
model.addAttribute("Sms",Sms.getSmsMsgList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID(),Integer.parseInt(RequestVal[0])));
}
else
{
Sms.setProcessFlag(false);
Sms.setErrMsg(comFunc.getErrMsg());
Sms.setErrDesc(comFunc.getErrDesc());
model.addAttribute("Sms",Sms);
}
model.addAttribute("qid",RequestVal[1]);
model.addAttribute("Gatewaylist",GatewayList);
model.addAttribute("Sessvals",Sessvals);
return "general/sms";
}
//<--- SMS Ends
//---> Change Password
@RequestMapping(value="/loadcpass",method=RequestMethod.POST )
public String LoadCPass(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("logkey",new LoginKey());
model.addAttribute("msg","");
return "/general/clogkey";
}
@RequestMapping(value="/changepass",method=RequestMethod.POST )
public String ChangePassword(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="logkey") LoginKey logkey,HttpSession session)
{
GeneralHandler GH=new GeneralHandler();
GH.setErrCode("6666");
GH.ChangePassword(logkey, Sessvals.getUserID());
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("logkey",logkey);
model.addAttribute("msg",GH.getErrMsg());
return "/general/clogkey";
}
//<--- Change Password Ends
}

View File

@@ -0,0 +1,98 @@
package matrix.nimble.controller;
//application libraries
import java.text.SimpleDateFormat;
import java.util.Map;
import matrix.nimble.model.Authenticate;
import matrix.nimble.model.Login;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
//servlet libraries
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes("Sessvals")
public class SessionController {
ModuleFunctions modf = new ModuleFunctions("");
@RequestMapping(value="login",method=RequestMethod.POST )
public String LoginPage(ModelMap model,@RequestHeader Map<String, String> headers)
{
model.addAttribute("login", new Login());
try {
//System.out.println(modf.decrypt("Sr4uHrfVDmPJz9GWNxT/6Q=="));
System.out.println(modf.encrypt("Mcrc@2024"));
}catch(Exception exce) {
}
String host = headers.get("host").toString();
if(!host.contains("192.168.10.205:8585") &&
!host.contains("192.168.10.250:8585") &&
!headers.get("host").toString().contains("localhost:8686")) {
return "error";
}
System.out.println(GlobalClass.getStoragePath());
return "login";
}
@RequestMapping(value="logout",method=RequestMethod.POST )
public String LogoutPage(HttpServletRequest request, ModelMap model,@ModelAttribute(value="Sessvals") Session Sessvals)
{
DBFunctions DBF=new DBFunctions("1000");
DBF.setProcessFlag(true);
HttpSession session = request.getSession(false);
if (session != null) {
session.invalidate();
}
DBF.FetchRunQuery(15, (new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new java.util.Date())+"#S#"+request.getRemoteAddr()+"#S#"+Sessvals.getLoginTime()+"#S#"+Sessvals.getUsername()+"#S#").split("#S#"));
model.addAttribute("login", new Login());
return "login";
}
@RequestMapping(value="authenticatelogin",method=RequestMethod.POST )
public String Authenticate(ModelMap model,HttpServletRequest request,@ModelAttribute(value="login") Login login)
{
Authenticate authenticate=new Authenticate();
authenticate.setErrCode("1000");
String realPath=request.getServletContext().getRealPath("/WEB-INF/app/usermenu");
Session Sessvals=authenticate.AuthenticateLogin(login.getLoginid(), login.getPassword(),realPath);
String ErrMsg=authenticate.getErrMsg();
if(!authenticate.isProcessFlag())
{
login.setErrMsg(ErrMsg);
login.setPassword("");
model.addAttribute("login",login);
return "login";
}
else
{
model.remove("login");
model.addAttribute("Sessvals",Sessvals);
return "home";
}
}
@RequestMapping(value="dashboard",method=RequestMethod.POST )
public String Dashboard(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
if(Sessvals == null)
{
return "redirect:/logout";
}
else
{
model.addAttribute("Sessvals",Sessvals);
return "dashboard";
}
}
}

View File

@@ -0,0 +1,276 @@
package matrix.nimble.edp.cutoff.controller;
//servlet libraries
import java.util.concurrent.TimeUnit;
import javax.naming.Reference;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.edp.cutoff.model.Allocation;
import matrix.nimble.edp.cutoff.model.PhotoCases;
import matrix.nimble.edp.cutoff.model.ReferenceSheet;
import matrix.nimble.edp.cutoff.model.SendToOperation;
import matrix.nimble.edp.cutoff.model.Telesheet;
import matrix.nimble.edp.cutoff.model.CutOffList;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class CutOff {
//---> Start Cut
@RequestMapping(value="cutoff",method=RequestMethod.POST )
public String OpenCutOff(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
CutOffList CList=new CutOffList();
CList.setErrCode("1003");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
CList.setSessUUID(UUID);
model.addAttribute("cutOff",CList.getCutOffList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/cutoff";
}
@RequestMapping(value="savecut",method=RequestMethod.POST )
public String StartCut(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="cutOff") CutOffList CList,HttpSession session)
{
CList.setErrCode("1003");
if(session.getAttribute("UUID").toString().equals(CList.getSessUUID()))
{
CList.FinalizeCutoffList(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID());
}
else
{
CList.setProcessFlag(true);
CList.setErrMsg("");
}
if(CList.isProcessFlag())
{
CutOffList BlankClist=new CutOffList();
BlankClist.setErrMsg(CList.getErrMsg());
BlankClist.setProcessFlag(false);
model.addAttribute("cutOff",BlankClist);
}
else
{
model.addAttribute("cutOff",CList);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/cutoff";
}
//<--- Start Cut Ends
//---> Allocation
@RequestMapping(value="allocation",method=RequestMethod.POST )
public String Allocation(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
Allocation AList=new Allocation();
AList.setErrCode("1004");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
AList.setSessUUID(UUID);
model.addAttribute("allocation",AList.getAllocList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/allocation";
}
@RequestMapping(value="savealloc",method=RequestMethod.POST )
public String SaveAlloc(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="allocation") Allocation AList,HttpSession session)
{
AList.setErrCode("1004");
if(session.getAttribute("UUID").toString().equals(AList.getSessUUID()))
{
AList.FinalizeAllocation(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID());
}
else
{
AList.setProcessFlag(true);
AList.setErrMsg("");
}
if(AList.isProcessFlag())
{
Allocation BlankAlloc=new Allocation();
BlankAlloc.setErrMsg(AList.getErrMsg());
BlankAlloc.setProcessFlag(false);
model.addAttribute("allocation",BlankAlloc);
}
else
{
model.addAttribute("allocation",AList);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/allocation";
}
//<--- Allocation Ends
//---> Telesheet
@RequestMapping(value="telesheet",method=RequestMethod.POST )
public String Telesheet(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
Telesheet TList=new Telesheet();
TList.setErrCode("1006");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
TList.setSessUUID(UUID);
model.addAttribute("telesheet",TList.getTeleList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/telesheet";
}
@RequestMapping(value="gentelesheet",method=RequestMethod.POST )
public String GenTelesheet(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="telesheet") Telesheet TList,HttpSession session)
{
String Rootdir= request.getServletContext().getRealPath("/");
TList.setErrCode("1006");
if(session.getAttribute("UUID").toString().equals(TList.getSessUUID()))
{
TList.FinalizeTeleSheet(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID(),Rootdir);
}
else
{
TList.setProcessFlag(true);
TList.setErrMsg("");
}
if(TList.isProcessFlag())
{
Telesheet BlankTList=new Telesheet();
BlankTList.setTelePDFLink(TList.getTelePDFLink());
BlankTList.setErrMsg(TList.getErrMsg());
BlankTList.setProcessFlag(false);
model.addAttribute("telesheet",BlankTList);
}
else
{
model.addAttribute("telesheet",TList);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/telesheet";
}
//<--- Telesheet Ends
//---> Referencesheet
@RequestMapping(value="refsheet",method=RequestMethod.POST )
public String Refsheet(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
ReferenceSheet RList=new ReferenceSheet();
RList.setErrCode("1006");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
RList.setSessUUID(UUID);
model.addAttribute("refsheet",RList.getRefList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/referencesheet";
}
@RequestMapping(value="genrefsheet",method=RequestMethod.POST )
public String GenRefsheet(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="refsheet") ReferenceSheet RList,HttpSession session)
{
String Rootdir= request.getServletContext().getRealPath("/");
RList.setErrCode("1006");
if(session.getAttribute("UUID").toString().equals(RList.getSessUUID()))
{
RList.FinalizeRefList(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID(),Rootdir);
}
else
{
RList.setProcessFlag(true);
RList.setErrMsg("");
}
if(RList.isProcessFlag())
{
ReferenceSheet BlankRList=new ReferenceSheet();
BlankRList.setTelePDFLink(RList.getTelePDFLink());
BlankRList.setErrMsg(RList.getErrMsg());
BlankRList.setProcessFlag(false);
model.addAttribute("refsheet",BlankRList);
}
else
{
model.addAttribute("telesheet",RList);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/referencesheet";
}
//<--- Telesheet Ends
//---> Send To Operation
@RequestMapping(value="sendtoopr",method=RequestMethod.POST )
public String GatherCaseList(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
SendToOperation Sopr=new SendToOperation();
Sopr.setErrCode("1007");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
Sopr.setSessUUID(UUID);
Sopr=Sopr.getRecordList(Sessvals.getCompanyID(), Sessvals.getBranchID(),Sessvals.getUserID());
model.addAttribute("sendtoopr",Sopr);
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/sendtoopr";
}
@RequestMapping(value="sendcasestoopr",method=RequestMethod.POST )
public String SendToOpr(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="sendtoopr") SendToOperation Sopr,HttpSession session)
{
Sopr.setErrCode("1004");
if(session.getAttribute("UUID").toString().equals(Sopr.getSessUUID()))
{
Sopr.SendToOpr(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID());
}
else
{
Sopr.setProcessFlag(true);
Sopr.setErrMsg("");
}
if(Sopr.isProcessFlag())
{
SendToOperation BSopr=new SendToOperation();
BSopr.setErrMsg(Sopr.getErrMsg());
BSopr.setProcessFlag(false);
model.addAttribute("sendtoopr",BSopr);
}
else
{
model.addAttribute("sendtoopr",Sopr);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/sendtoopr";
}
//<--- Send To Operation Ends
//---> Generate F-SAM List Starts
@RequestMapping(value="photocases",method=RequestMethod.POST )
public String PhotoCaseList(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
PhotoCases pc=new PhotoCases();
pc.setProcessFlag(true);
pc.setErrCode("16001");
pc.setSessUUID(UUID);
model.addAttribute("caselist",pc.getPhotoCaseList(Sessvals.getBranchID()));
model.addAttribute("pcases",pc);
model.addAttribute("Sessvals",Sessvals);
return "edp/cutoff/mnimblepcases";
}
//<--- Generate F-SAM List Ends
//---> Finalize F-SAM List Starts
@RequestMapping(value="finalizepcases",method=RequestMethod.POST )
public @ResponseBody String PhotoCaseGenerated(@RequestParam String val0,@RequestParam String val1,@RequestParam String val2)
{
String OprTime=GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date());
String [] Qvals=new String[4];
Qvals[0]=val0;
Qvals[1]=val1.trim().endsWith("R") ? "res":(val1.trim().endsWith("O") ? "off" : "pro");
Qvals[2]=val2;
Qvals[3]=OprTime;
PhotoCases pc=new PhotoCases();
pc.setProcessFlag(true);
pc.setErrCode("16001");
return pc.FinalizePhotoCaseList(Qvals);
}
//<--- Finalize F-SAM List Ends
}

View File

@@ -0,0 +1,238 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class Allocation {
private List<CutOffRecord> allocationlist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String AllocTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<CutOffRecord> getAllocationlist() {
return allocationlist;
}
public String getAllocTime() {
return AllocTime;
}
public void setAllocTime(String allocTime) {
AllocTime = allocTime;
}
public void setAllocationlist(List<CutOffRecord> allocationlist) {
this.allocationlist = allocationlist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public Allocation getAllocList(String CompanyId,String BranchId,String UserId)
{
Allocation AList=new Allocation();
StringFunctions StrFunc=new StringFunctions(getErrCode());
setAllocTime(StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(27, Vals);
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(28, Vals); //Generating list of portfolios to be allocated
if(DBF.isProcessFlag())
{
String [][] AllocListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<AllocListData.length;RecCount++)
{
DBF.setProcessFlag(true);
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(AllocListData[RecCount][0]);
CORec.setPortname(AllocListData[RecCount][1]);
CORec.setTotrv(Integer.parseInt(AllocListData[RecCount][2]));
CORec.setTotov(Integer.parseInt(AllocListData[RecCount][3]));
CORec.setTotpv(Integer.parseInt(AllocListData[RecCount][4]));
CORec.setIslocked(Integer.parseInt(AllocListData[RecCount][5]));
if(CORec.getIslocked()>0)
{
CORec.setAllocation(false);
}
else
{
CORec.setAllocation(Integer.parseInt(AllocListData[RecCount][6])<=0 ? false:true);
}
CORec.setLockedby(AllocListData[RecCount][7]);
//Collecting records for sublist
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+CORec.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(29, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> SubRecord=new ArrayList<CutOffRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
CutOffRecord SCORec=new CutOffRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotrv(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setTotov(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setTotpv(Integer.parseInt(SubListData[ListCount][6]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][7]));
SCORec.setLockedby(SubListData[ListCount][8]);
SCORec.setAllocation(Integer.parseInt(SubListData[ListCount][9])<=0 ? false:true);
SCORec.setResiloc(SubListData[ListCount][10]);
SCORec.setOffloc(SubListData[ListCount][11]);
SCORec.setProploc(SubListData[ListCount][12]);
SCORec.setUuid(SubListData[ListCount][13]);
SCORec.setPortgroup(SubListData[ListCount][14]);
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
AList.setAllocTime(getAllocTime());
AList.setAllocationlist(Record);
AList.setSessUUID(getSessUUID());
AList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
AList.setErrDesc(DBF.getErrDesc());
AList.setErrMsg(DBF.getErrMsg());
AList.setErrCode(getErrCode());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
AList.setErrDesc(DBF.getErrDesc());
AList.setErrMsg(DBF.getErrMsg());
AList.setErrCode(getErrCode());
}
return AList;
}
public void FinalizeAllocation(String UserId,String CompanyId,String BranchId)
{
setProcessFlag(true);
//---> Allocation status
int TotRv=0;
int TotOv=0;
int TotPv=0;
int TotRvAlloc=0;
int TotOvAlloc=0;
int TotPvAlloc=0;
int TotRvFailed=0;
int TotOvFailed=0;
int TotPvFailed=0;
setAllocTime(new StringFunctions(getErrCode()).FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
//<--- Allocation status ends
DBFunctions DBF=new DBFunctions(getErrCode());
int PortList=getAllocationlist().size();
for(int LIndx=0;LIndx<PortList;LIndx++)
{
CutOffRecord AllocRec=(CutOffRecord)getAllocationlist().get(LIndx);
/*if (AllocRec.getIslocked()==0 && AllocRec.isAllocation())
{*/
String Portfolioid=AllocRec.getPortfolioid();
int SubList=AllocRec.getSublist().size();
for(int SIndx=0;SIndx<SubList;SIndx++)
{
CutOffRecord SubRec=(CutOffRecord)AllocRec.getSublist().get(SIndx);
if(SubRec.isAllocation())
{
TotRv=TotRv+SubRec.getTotrv();
TotOv=TotOv+SubRec.getTotov();
TotPv=TotPv+SubRec.getTotpv();
}
DBF.setProcessFlag(true);
String Query="";
Query=Query+""+SubRec.getUuid()+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isAllocation() ? 1:0)+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getTotrv()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getTotov()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getTotpv()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getResiloc()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getOffloc()+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getProploc()+""+GlobalClass.ColDelim;
Query=Query+""+getAllocTime()+""+GlobalClass.ColDelim;
Query=Query+""+CompanyId+""+GlobalClass.ColDelim;
Query=Query+""+BranchId+""+GlobalClass.ColDelim;
Query=Query+""+Portfolioid+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getPortgroup()+""+GlobalClass.ColDelim;
String Temp=DBF.FetchRunQuery(30, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
if(SubRec.isAllocation())
{
TotRvAlloc=TotRvAlloc+SubRec.getTotrv();
TotOvAlloc=TotOvAlloc+SubRec.getTotov();
TotPvAlloc=TotPvAlloc+SubRec.getTotpv();
}
}
else
{
if(SubRec.isAllocation())
{
TotRvFailed=TotRvFailed+SubRec.getTotrv();;
TotOvFailed=TotOvFailed+SubRec.getTotov();;
TotPvFailed=TotPvFailed+SubRec.getTotpv();;
}
}
}
/*}*/
}
if(TotRvAlloc>0 || TotOvAlloc >0 || TotPvAlloc >0)
{
setErrMsg(getErrCode()+"ALFAIL:Info:Total ("+TotRvAlloc+" / "+TotRv+")-RV, ("+TotOvAlloc+" / "+TotOv+")-OV, ("+TotPvAlloc+" / "+TotPv+")-PV allocated successfully.");
}
else
{
setErrMsg(getErrCode()+"ALFAIL:Error:Allocation failed please try again.");
}
}
}

View File

@@ -0,0 +1,58 @@
package matrix.nimble.edp.cutoff.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
public class AutoCutThread extends Thread {
private String uuid;
private String portfolioid;
private String userid;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public void run(){
DBFunctions dbf=new DBFunctions("3600");
dbf.setProcessFlag(true);
String [] Qvals=(getPortfolioid()+GlobalClass.ColDelim+getUuid()+GlobalClass.ColDelim+getUserid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
dbf.FetchRunQuery(475, Qvals);
if(dbf.isProcessFlag())
{
System.out.println(dbf.getProcResult());
}
else
{
System.out.println(dbf.getErrDesc());
}
}
}

View File

@@ -0,0 +1,196 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class CutOffList {
private List<CutOffRecord> cofflist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String CutoffTime;
private String Batch;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<CutOffRecord> getCofflist() {
return cofflist;
}
public void setCofflist(List<CutOffRecord> cofflist) {
this.cofflist = cofflist;
}
public String getCutoffTime() {
return CutoffTime;
}
public void setCutoffTime(String cutoffTime) {
CutoffTime = cutoffTime;
}
public String getBatch() {
return Batch;
}
public void setBatch(String batch) {
Batch = batch;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public CutOffList getCutOffList(String CompanyId,String BranchId,String UserId)
{
CutOffList CList=new CutOffList();
StringFunctions StrFunc=new StringFunctions(getErrCode());
String CutTime=StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date());
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CutTime+GlobalClass.ColDelim+CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(17, Vals); //Updating enabled process in cutoff table
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(18, Vals);
if(DBF.isProcessFlag())
{
String [][] COffListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<COffListData.length;RecCount++)
{
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(COffListData[RecCount][0]);
CORec.setPortname(COffListData[RecCount][1]);
CORec.setAllocation(COffListData[RecCount][2].equals("1") ? true:false);
CORec.setSms(COffListData[RecCount][3].equals("1") ? true:false);
CORec.setTelesheet(COffListData[RecCount][4].equals("1") ? true:false);
CORec.setEarlier(COffListData[RecCount][5].equals("1") ? true:false);
CORec.setNegative(COffListData[RecCount][6].equals("1") ? true:false);
CORec.setIslocked(Integer.parseInt(COffListData[RecCount][7]));
CORec.setLockedby(COffListData[RecCount][8]);
CORec.setDocut(CORec.getIslocked()==0 ? true:false);
Record.add(CORec);
}
CList.setCutoffTime(CutTime);
CList.setCofflist(Record);
CList.setSessUUID(getSessUUID());
CList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
return CList;
}
public void FinalizeCutoffList(String UserId,String CompanyId,String BranchId)
{
setProcessFlag(true);
int Listcount=getCofflist().size();
String Query="";
for(int Indx=0;Indx<Listcount;Indx++)
{
CutOffRecord CRec=(CutOffRecord)getCofflist().get(Indx);
if(CRec.isDocut())
{
Query=Query+"update main_operations set ";
Query=Query+"allocation="+(CRec.isAllocation()? "1":"-2")+",";
Query=Query+"sms="+(CRec.isSms()? "1":"-2")+",";
if(!CRec.isSms())
{
Query=Query+"smsby="+UserId+",";
}
Query=Query+"telesheet=(case when telesheet=0 then 0 else "+(CRec.isTelesheet()? "1":"-2")+" end),";
if(!CRec.isTelesheet())
{
Query=Query+"telesheetby="+UserId+",";
}
Query=Query+"earlier="+(CRec.isEarlier()? "1":"-2")+",";
if(!CRec.isEarlier())
{
Query=Query+"earlierby="+UserId+",";
}
Query=Query+"negative="+(CRec.isNegative()? "1":"-2")+",";
if(!CRec.isNegative())
{
Query=Query+"negativeby="+UserId+",";
}
Query=Query+"cutoffby="+UserId+",";
Query=Query+"islocked=0,";
Query=Query+"batch=''"+getBatch()+"'' ";
Query=Query+"where (cutoffby is null or cutoffby=0) and cutoffon=''"+getCutoffTime()+"'' and islocked="+UserId+" ";
Query=Query+"and company_id="+CompanyId+" and branch_id="+BranchId+" and portfolio_id="+CRec.getPortfolioid()+";";
}
else
{
Query=Query+"update main_operations set ";
Query=Query+"cutoffon=NULL,";
Query=Query+"islocked=0 ";
Query=Query+"where (cutoffby is null or cutoffby=0) and cutoffon=''"+getCutoffTime()+"'' and islocked="+UserId+" ";
Query=Query+"and company_id="+CompanyId+" and branch_id="+BranchId+" and portfolio_id="+CRec.getPortfolioid()+";";
}
}
if(Query.length()>0)
{
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
DBF.FetchRunQuery(26, (Query+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
setProcessFlag(true);
setErrMsg(getErrCode()+"STCUT:Info:Cut List is now ready to be processed.");
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
}
else
{
setProcessFlag(false);
setErrMsg(getErrCode()+"STCUT:Info:Please select atleast one portfolio for Cut-Off Process.");
}
}
}

View File

@@ -0,0 +1,235 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class CutOffRecord {
private List<CutOffRecord> sublist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String portfolioid;
private String portname;
private String customername;
private String apptype;
private String mvcode;
private String applno;
private boolean allocation;
private boolean sms;
private boolean telesheet;
private boolean earlier;
private boolean negative;
private int islocked;
private String lockedby;
private boolean docut;
private int ischanged;
private int totrv;
private int totov;
private int totpv;
private int totrtv;
private int tototv;
private int totref;
private boolean tv;
private boolean oprsend;
private String resiloc;
private String offloc;
private String proploc;
private String uuid;
private String repformat;
private String repfunction;
private String message;
private String portgroup;
public List<CutOffRecord> getSublist() {
return sublist;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getApptype() {
return apptype;
}
public void setApptype(String apptype) {
this.apptype = apptype;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getApplno() {
return applno;
}
public void setApplno(String applno) {
this.applno = applno;
}
public void setSublist(List<CutOffRecord> sublist) {
this.sublist = sublist;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getPortname() {
return portname;
}
public void setPortname(String portname) {
this.portname = portname;
}
public boolean isAllocation() {
return allocation;
}
public void setAllocation(boolean allocation) {
this.allocation = allocation;
}
public boolean isSms() {
return sms;
}
public void setSms(boolean sms) {
this.sms = sms;
}
public boolean isTelesheet() {
return telesheet;
}
public void setTelesheet(boolean telesheet) {
this.telesheet = telesheet;
}
public boolean isEarlier() {
return earlier;
}
public void setEarlier(boolean earlier) {
this.earlier = earlier;
}
public boolean isNegative() {
return negative;
}
public void setNegative(boolean negative) {
this.negative = negative;
}
public int getIslocked() {
return islocked;
}
public void setIslocked(int islocked) {
this.islocked = islocked;
}
public String getLockedby() {
return lockedby;
}
public void setLockedby(String lockedby) {
this.lockedby = lockedby;
}
public int getIschanged() {
return ischanged;
}
public void setIschanged(int ischanged) {
this.ischanged = ischanged;
}
public boolean isDocut() {
return docut;
}
public void setDocut(boolean docut) {
this.docut = docut;
}
public int getTotrv() {
return totrv;
}
public void setTotrv(int totrv) {
this.totrv = totrv;
}
public int getTotov() {
return totov;
}
public void setTotov(int totov) {
this.totov = totov;
}
public int getTotpv() {
return totpv;
}
public void setTotpv(int totpv) {
this.totpv = totpv;
}
public int getTotrtv() {
return totrtv;
}
public void setTotrtv(int totrtv) {
this.totrtv = totrtv;
}
public int getTototv() {
return tototv;
}
public void setTototv(int tototv) {
this.tototv = tototv;
}
public int getTotref() {
return totref;
}
public void setTotref(int totref) {
this.totref = totref;
}
public boolean isTv() {
return tv;
}
public void setTv(boolean tv) {
this.tv = tv;
}
public boolean isOprsend() {
return oprsend;
}
public void setOprsend(boolean oprsend) {
this.oprsend = oprsend;
}
public String getResiloc() {
return resiloc;
}
public void setResiloc(String resiloc) {
this.resiloc = resiloc;
}
public String getOffloc() {
return offloc;
}
public void setOffloc(String offloc) {
this.offloc = offloc;
}
public String getProploc() {
return proploc;
}
public void setProploc(String proploc) {
this.proploc = proploc;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getRepformat() {
return repformat;
}
public void setRepformat(String repformat) {
this.repformat = repformat;
}
public String getRepfunction() {
return repfunction;
}
public void setRepfunction(String repfunction) {
this.repfunction = repfunction;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getPortgroup() {
return portgroup;
}
public void setPortgroup(String portgroup) {
this.portgroup = portgroup;
}
}

View File

@@ -0,0 +1,83 @@
package matrix.nimble.edp.cutoff.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
public class PhotoCases {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String[][] getPhotoCaseList(String BranchId)
{
String [][] CaseList=null;
PhotoCases PC=new PhotoCases();
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(303, (BranchId).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
CaseList=dbf.getResultArray();
}
else
{
setProcessFlag(false);
setErrDesc(dbf.getErrDesc());
setErrMsg(dbf.getErrMsg());
PC.setErrCode(getErrCode());
PC.setErrDesc(getErrDesc());
PC.setErrMsg(getErrMsg());
}
return CaseList;
}
public String FinalizePhotoCaseList(String [] Qvals)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
String Result=dbf.FetchRunQuery(300, Qvals);
if(dbf.isProcessFlag())
{
Result="success";
}
else
{
setProcessFlag(false);
setErrDesc(dbf.getErrDesc());
setErrMsg(dbf.getErrMsg());
Result=getErrMsg();
}
return Result;
}
}

View File

@@ -0,0 +1,245 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.edp.output.model.ReportOutput;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class ReferenceSheet {
private List<CutOffRecord> tvrlist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String TeleSheetTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
private String TelePDFLink;
public List<CutOffRecord> getTvrlist() {
return tvrlist;
}
public String getTeleSheetTime() {
return TeleSheetTime;
}
public void setTeleSheetTime(String teleSheetTime) {
TeleSheetTime = teleSheetTime;
}
public void setTvrlist(List<CutOffRecord> tvrlist) {
this.tvrlist = tvrlist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getTelePDFLink() {
return TelePDFLink;
}
public void setTelePDFLink(String telePDFLink) {
TelePDFLink = telePDFLink;
}
public Telesheet getRefList(String CompanyId,String BranchId,String UserId)
{
Telesheet TList=new Telesheet();
StringFunctions StrFunc=new StringFunctions(getErrCode());
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(216, Vals);
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(217, Vals); //Generating list of portfolios those reference sheet to be generated
if(DBF.isProcessFlag())
{
String [][] TvrListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<TvrListData.length;RecCount++)
{
DBF.setProcessFlag(true);
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(TvrListData[RecCount][0]);
CORec.setPortname(TvrListData[RecCount][1]);
CORec.setTotref(Integer.parseInt(TvrListData[RecCount][2]));
CORec.setIslocked(Integer.parseInt(TvrListData[RecCount][3]));
if(CORec.getIslocked() > 0)
{
CORec.setTv(false);
}
else
{
CORec.setTv(Integer.parseInt(TvrListData[RecCount][4])<=0 ? false:true);
}
CORec.setLockedby(TvrListData[RecCount][5]);
CORec.setRepformat(TvrListData[RecCount][6]);
CORec.setRepfunction(TvrListData[RecCount][7]);
//Collecting records for sublist
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+CORec.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(218, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> SubRecord=new ArrayList<CutOffRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
CutOffRecord SCORec=new CutOffRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotref(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setLockedby(SubListData[ListCount][6]);
SCORec.setTv(Integer.parseInt(SubListData[ListCount][7])<=0 ? false:true);
SCORec.setUuid(SubListData[ListCount][8]);
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
TList.setTvrlist(Record);
TList.setSessUUID(getSessUUID());
TList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
TList.setErrDesc(DBF.getErrDesc());
TList.setErrMsg(DBF.getErrMsg());
TList.setErrCode(getErrCode());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
TList.setErrDesc(DBF.getErrDesc());
TList.setErrMsg(DBF.getErrMsg());
TList.setErrCode(getErrCode());
}
return TList;
}
public void FinalizeRefList(String UserId,String CompanyId,String BranchId,String RootPath)
{
String TeleSheetLink="";
setTelePDFLink("");
setProcessFlag(true);
//---> Refsheet status
int TotRef=0;
int TotRefGen=0;
int TotRefFailed=0;
setTeleSheetTime(new StringFunctions(getErrCode()).FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
//<--- Refsheet status ends
DBFunctions DBF=new DBFunctions(getErrCode());
int PortList=getTvrlist().size();
String [][] TeleCutList=new String[PortList][6];
int CutListIndx=0;
for(int LIndx=0;LIndx<PortList;LIndx++)
{
CutOffRecord TvrRec=(CutOffRecord)getTvrlist().get(LIndx);
TeleCutList[LIndx][4]="empty";
if (TvrRec.getIslocked()==0 && TvrRec.isTv())
{
int SubList=TvrRec.getSublist().size();
// Filling list of portfolios and their respective tele format
TeleCutList[CutListIndx][0]=TvrRec.getPortfolioid();
TeleCutList[CutListIndx][1]=getTeleSheetTime();
TeleCutList[CutListIndx][2]=TvrRec.getRepformat();
TeleCutList[CutListIndx][3]=UserId;
TeleCutList[CutListIndx][5]=TvrRec.getRepfunction();
//<--- Ends
for(int SIndx=0;SIndx<SubList;SIndx++)
{
CutOffRecord SubRec=(CutOffRecord)TvrRec.getSublist().get(SIndx);
if(SubRec.isTv())
{
TeleCutList[CutListIndx][4]="notempty";
TotRef=TotRef+SubRec.getTotref();
}
DBF.setProcessFlag(true);
String Query="";
Query=Query+""+(SubRec.isTv() ? UserId:0)+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isTv() ? getTeleSheetTime():"NULL")+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isTv() ? UserId:"NULL")+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getUuid()+""+GlobalClass.ColDelim;
String Temp=DBF.FetchRunQuery(219, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
if(SubRec.isTv())
{
TotRefGen=TotRefGen+SubRec.getTotref();
}
}
else
{
if(SubRec.isTv())
{
TotRefFailed=TotRefFailed+SubRec.getTotref();;
}
}
}
CutListIndx=CutListIndx+1;
}
}
if (TotRefGen > 0)
{
ReportOutput TS=new ReportOutput();
TS.setProcessFlag(true);
TS.setErrCode(getErrCode());
TeleSheetLink=TS.GenerateCallingSheet(TeleCutList,GlobalClass.getStoragePath(),CompanyId,BranchId,"refsheet");
if(!TS.isProcessFlag())
{
setProcessFlag(false);
setErrMsg(TS.getErrMsg());
setErrDesc(TS.getErrDesc());
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"TSGEN:Info:Referencesheet generated successfully. Please use link in a page to open Tele Sheet.");
setTelePDFLink(GlobalClass.DocServer+TeleSheetLink);
DBF.FetchRunQuery(103, (getTeleSheetTime()+GlobalClass.ColDelim+"telesheet"+GlobalClass.ColDelim+TeleSheetLink+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"ETLST:Error:No records found to generate Tele Sheet.");
}
}
}

View File

@@ -0,0 +1,136 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class SMS {
private List<SMSRecord> smslist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(SMSRecord.class));
private String SmsTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public List<SMSRecord> getSmslist() {
return smslist;
}
public String getSmsTime() {
return SmsTime;
}
public void setSmsTime(String smsTime) {
SmsTime = smsTime;
}
public void setSmslist(List<SMSRecord> smslist) {
this.smslist = smslist;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public SMS getSmsMsgList(String CompanyId,String BranchId,String UserId,int Qid)
{
SMS sms=new SMS();
ModuleFunctions ModFunc=new ModuleFunctions(getErrCode());
StringFunctions StrFunc=new StringFunctions(getErrCode());
setSmsTime(StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
if(Qid==37)
{
DBF.FetchRunQuery(36, Vals);
}
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(Qid, Vals); //Generating list of records to be sent
if(DBF.isProcessFlag())
{
String [][] SMSListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<SMSRecord> Record=new ArrayList<SMSRecord>();
for(int RecCount=0;RecCount<SMSListData.length;RecCount++)
{
DBF.setProcessFlag(true);
SMSRecord SMSRec=new SMSRecord();
SMSRec.setUid(SMSListData[RecCount][0]);
SMSRec.setUuid(SMSListData[RecCount][1]);
SMSRec.setPortfolioid(SMSListData[RecCount][2]);
SMSRec.setPortname(SMSListData[RecCount][3]);
SMSRec.setVisittype(SMSListData[RecCount][4]);
SMSRec.setSmsmessage(SMSListData[RecCount][5]);
SMSRec.setVerifiercode(SMSListData[RecCount][6]);
SMSRec.setNoofsms(SMSListData[RecCount][7]);
SMSRec.setSmsstatus(SMSListData[RecCount][8]);
SMSRec.setIslocked(Integer.parseInt(SMSListData[RecCount][9]));
if(SMSRec.getIslocked()!=0)
{
SMSRec.setSms(false);
}
else
{
SMSRec.setSms(Integer.parseInt(SMSListData[RecCount][10])==1 ? true:false);
}
SMSRec.setLockedby(SMSListData[RecCount][11]);
/*try
{
//ResultData=ModFunc.encrypt(SMSListData[RecCount][12]);
}catch(Exception exce){}***commented on 01-04-2014*/
//SMSRec.setMobileno(ResultData); ***commented on 01-04-2014
SMSRec.setMobileno(SMSListData[RecCount][12]);
SMSRec.setSmsresponse(SMSListData[RecCount][13]);
Record.add(SMSRec);
}
sms.setSmsTime(getSmsTime());
sms.setSmslist(Record);
sms.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
sms.setErrCode(getErrCode());
sms.setErrDesc(DBF.getErrDesc());
sms.setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
sms.setErrCode(getErrCode());
sms.setErrDesc(DBF.getErrDesc());
sms.setErrMsg(DBF.getErrMsg());
}
return sms;
}
}

View File

@@ -0,0 +1,110 @@
package matrix.nimble.edp.cutoff.model;
public class SMSRecord {
private String uid;
private String uuid;
private String portfolioid;
private String portname;
private String visittype;
private String smsmessage;
private String verifiercode;
private String verifierid;
private String noofsms;
private String smsstatus;
private int islocked;
private String lockedby;
private String mobileno;
private boolean sms;
private String smsresponse;
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getPortname() {
return portname;
}
public void setPortname(String portname) {
this.portname = portname;
}
public String getVisittype() {
return visittype;
}
public void setVisittype(String visittype) {
this.visittype = visittype;
}
public String getSmsmessage() {
return smsmessage;
}
public void setSmsmessage(String smsmessage) {
this.smsmessage = smsmessage;
}
public String getVerifiercode() {
return verifiercode;
}
public void setVerifiercode(String verifiercode) {
this.verifiercode = verifiercode;
}
public String getVerifierid() {
return verifierid;
}
public void setVerifierid(String verifierid) {
this.verifierid = verifierid;
}
public String getNoofsms() {
return noofsms;
}
public void setNoofsms(String noofsms) {
this.noofsms = noofsms;
}
public String getSmsstatus() {
return smsstatus;
}
public void setSmsstatus(String smsstatus) {
this.smsstatus = smsstatus;
}
public int getIslocked() {
return islocked;
}
public void setIslocked(int islocked) {
this.islocked = islocked;
}
public String getLockedby() {
return lockedby;
}
public void setLockedby(String lockedby) {
this.lockedby = lockedby;
}
public String getMobileno() {
return mobileno;
}
public void setMobileno(String mobileno) {
this.mobileno = mobileno;
}
public String getSmsresponse() {
return smsresponse;
}
public void setSmsresponse(String smsresponse) {
this.smsresponse = smsresponse;
}
public boolean isSms() {
return sms;
}
public void setSms(boolean sms) {
this.sms = sms;
}
}

View File

@@ -0,0 +1,187 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class SendToOperation {
private List<CutOffRecord> caselist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String SendTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<CutOffRecord> getCaselist() {
return caselist;
}
public String getSendTime() {
return SendTime;
}
public void setSendTime(String sendTime) {
SendTime = sendTime;
}
public void setCaselist(List<CutOffRecord> caselist) {
this.caselist = caselist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public SendToOperation getRecordList(String CompanyId,String BranchId,String UserId)
{
SendToOperation Sopr=new SendToOperation();
StringFunctions StrFunc=new StringFunctions(getErrCode());
setSendTime(StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(44, Vals);
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(45, Vals); //Generating list of portfolios to be allocated
if(DBF.isProcessFlag())
{
String [][] SendListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<SendListData.length;RecCount++)
{
DBF.setProcessFlag(true);
//mvcode,applno,customername,rv,ov,pv,islocked,lockedby
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(SendListData[RecCount][0]);
CORec.setPortname(SendListData[RecCount][1]);
CORec.setTotrv(Integer.parseInt(SendListData[RecCount][2]));
CORec.setTotov(Integer.parseInt(SendListData[RecCount][3]));
CORec.setTotpv(Integer.parseInt(SendListData[RecCount][4]));
CORec.setTotrtv(Integer.parseInt(SendListData[RecCount][5]));
CORec.setTototv(Integer.parseInt(SendListData[RecCount][6]));
CORec.setTotref(Integer.parseInt(SendListData[RecCount][7]));
CORec.setIslocked(Integer.parseInt(SendListData[RecCount][8]));
if(CORec.getIslocked()>0)
{
CORec.setOprsend(false);
}
else
{
CORec.setOprsend(Integer.parseInt(SendListData[RecCount][9])<=0 ? false:true);
}
CORec.setLockedby(SendListData[RecCount][10]);
//Collecting records for sublist
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+CORec.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(46, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> SubRecord=new ArrayList<CutOffRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
CutOffRecord SCORec=new CutOffRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotrv(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setTotov(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setTotpv(Integer.parseInt(SubListData[ListCount][6]));
SCORec.setTotrtv(Integer.parseInt(SubListData[ListCount][7]));
SCORec.setTototv(Integer.parseInt(SubListData[ListCount][8]));
SCORec.setTotref(Integer.parseInt(SubListData[ListCount][9]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][10]));
SCORec.setLockedby(SubListData[ListCount][11]);
SCORec.setOprsend(Integer.parseInt(SubListData[ListCount][12])<=0 ? false:true);
SCORec.setUuid(SubListData[ListCount][13]);
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
Sopr.setSendTime(getSendTime());
Sopr.setCaselist(Record);
Sopr.setSessUUID(getSessUUID());
Sopr.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
Sopr.setErrDesc(DBF.getErrDesc());
Sopr.setErrMsg(DBF.getErrMsg());
Sopr.setErrCode(getErrCode());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
Sopr.setErrDesc(DBF.getErrDesc());
Sopr.setErrMsg(DBF.getErrMsg());
Sopr.setErrCode(getErrCode());
}
return Sopr;
}
public void SendToOpr(String UserId,String CompanyId,String BranchId)
{
setProcessFlag(true);
setSendTime(new StringFunctions(getErrCode()).FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
DBFunctions DBF=new DBFunctions(getErrCode());
int PortList=getCaselist().size();
for(int LIndx=0;LIndx<PortList;LIndx++)
{
CutOffRecord SendRec=(CutOffRecord)getCaselist().get(LIndx);
String Portfolioid=SendRec.getPortfolioid();
int SubList=SendRec.getSublist().size();
for(int SIndx=0;SIndx<SubList;SIndx++)
{
CutOffRecord SubRec=(CutOffRecord)SendRec.getSublist().get(SIndx);
DBF.setProcessFlag(true);
String Query="";
Query=Query+""+SubRec.getUuid()+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isOprsend() ? 1:0)+""+GlobalClass.ColDelim;
Query=Query+""+getSendTime()+""+GlobalClass.ColDelim;
Query=Query+""+UserId+""+GlobalClass.ColDelim;
Query=Query+""+CompanyId+""+GlobalClass.ColDelim;
Query=Query+""+BranchId+""+GlobalClass.ColDelim;
Query=Query+""+Portfolioid+""+GlobalClass.ColDelim;
String Temp=DBF.FetchRunQuery(47, Query.split(GlobalClass.ColDelim));
}
}
}
}

View File

@@ -0,0 +1,261 @@
package matrix.nimble.edp.cutoff.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.edp.output.model.ReportOutput;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class Telesheet {
private List<CutOffRecord> tvrlist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffRecord.class));
private String TeleSheetTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
private String TelePDFLink;
public List<CutOffRecord> getTvrlist() {
return tvrlist;
}
public String getTeleSheetTime() {
return TeleSheetTime;
}
public void setTeleSheetTime(String teleSheetTime) {
TeleSheetTime = teleSheetTime;
}
public void setTvrlist(List<CutOffRecord> tvrlist) {
this.tvrlist = tvrlist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getTelePDFLink() {
return TelePDFLink;
}
public void setTelePDFLink(String telePDFLink) {
TelePDFLink = telePDFLink;
}
public Telesheet getTeleList(String CompanyId,String BranchId,String UserId)
{
Telesheet TList=new Telesheet();
StringFunctions StrFunc=new StringFunctions(getErrCode());
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
DBF.FetchRunQuery(31, Vals);
if(DBF.isProcessFlag())
{
String ResultData=DBF.FetchRunQuery(32, Vals); //Generating list of portfolios those telesheet to be generated
if(DBF.isProcessFlag())
{
String [][] TvrListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> Record=new ArrayList<CutOffRecord>();
for(int RecCount=0;RecCount<TvrListData.length;RecCount++)
{
DBF.setProcessFlag(true);
CutOffRecord CORec=new CutOffRecord();
CORec.setPortfolioid(TvrListData[RecCount][0]);
CORec.setPortname(TvrListData[RecCount][1]);
CORec.setTotrv(Integer.parseInt(TvrListData[RecCount][2]));
CORec.setTotov(Integer.parseInt(TvrListData[RecCount][3]));
CORec.setTotref(Integer.parseInt(TvrListData[RecCount][4]));
CORec.setIslocked(Integer.parseInt(TvrListData[RecCount][5]));
if(CORec.getIslocked() > 0)
{
CORec.setTv(false);
}
else
{
CORec.setTv(Integer.parseInt(TvrListData[RecCount][6])<=0 ? false:true);
}
CORec.setLockedby(TvrListData[RecCount][7]);
CORec.setRepformat(TvrListData[RecCount][8]);
CORec.setRepfunction(TvrListData[RecCount][9]);
//Collecting records for sublist
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+CORec.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(33, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffRecord> SubRecord=new ArrayList<CutOffRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
CutOffRecord SCORec=new CutOffRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotrv(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setTotov(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setTotref(Integer.parseInt(SubListData[ListCount][6]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][7]));
SCORec.setLockedby(SubListData[ListCount][8]);
SCORec.setTv(Integer.parseInt(SubListData[ListCount][9])<=0 ? false:true);
SCORec.setUuid(SubListData[ListCount][10]);
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
TList.setTvrlist(Record);
TList.setSessUUID(getSessUUID());
TList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
TList.setErrDesc(DBF.getErrDesc());
TList.setErrMsg(DBF.getErrMsg());
TList.setErrCode(getErrCode());
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
TList.setErrDesc(DBF.getErrDesc());
TList.setErrMsg(DBF.getErrMsg());
TList.setErrCode(getErrCode());
}
return TList;
}
public void FinalizeTeleSheet(String UserId,String CompanyId,String BranchId,String RootPath)
{
String TeleSheetLink="";
setTelePDFLink("");
setProcessFlag(true);
//---> TeleSheet status
int TotRtv=0;
int TotOtv=0;
int TotRef=0;
int TotRtvGen=0;
int TotOtvGen=0;
int TotRefGen=0;
int TotRtvFailed=0;
int TotOtvFailed=0;
int TotRefFailed=0;
setTeleSheetTime(new StringFunctions(getErrCode()).FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date()));
//<--- TeleSheet status ends
DBFunctions DBF=new DBFunctions(getErrCode());
int PortList=getTvrlist().size();
String [][] TeleCutList=new String[PortList][6];
int CutListIndx=0;
for(int LIndx=0;LIndx<PortList;LIndx++)
{
CutOffRecord TvrRec=(CutOffRecord)getTvrlist().get(LIndx);
TeleCutList[LIndx][4]="empty";
if (TvrRec.getIslocked()==0 && TvrRec.isTv())
{
int SubList=TvrRec.getSublist().size();
// Filling list of portfolios and their respective tele format
TeleCutList[CutListIndx][0]=TvrRec.getPortfolioid();
TeleCutList[CutListIndx][1]=getTeleSheetTime();
TeleCutList[CutListIndx][2]=TvrRec.getRepformat();
TeleCutList[CutListIndx][3]=UserId;
TeleCutList[CutListIndx][5]=TvrRec.getRepfunction();
//<--- Ends
for(int SIndx=0;SIndx<SubList;SIndx++)
{
CutOffRecord SubRec=(CutOffRecord)TvrRec.getSublist().get(SIndx);
if(SubRec.isTv())
{
TeleCutList[CutListIndx][4]="notempty";
TotRtv=TotRtv+SubRec.getTotrv();
TotOtv=TotOtv+SubRec.getTotov();
TotRef=TotRef+SubRec.getTotref();
}
DBF.setProcessFlag(true);
String Query="";
Query=Query+""+(SubRec.isTv() ? UserId:0)+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isTv() ? getTeleSheetTime():"NULL")+""+GlobalClass.ColDelim;
Query=Query+""+(SubRec.isTv() ? UserId:"NULL")+""+GlobalClass.ColDelim;
Query=Query+""+SubRec.getUuid()+""+GlobalClass.ColDelim;
String Temp=DBF.FetchRunQuery(34, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
if(SubRec.isTv())
{
TotRtvGen=TotRtvGen+SubRec.getTotrv();
TotOtvGen=TotOtvGen+SubRec.getTotov();
TotRefGen=TotRefGen+SubRec.getTotref();
}
}
else
{
if(SubRec.isTv())
{
TotRtvFailed=TotRtvFailed+SubRec.getTotrv();;
TotOtvFailed=TotOtvFailed+SubRec.getTotov();;
TotRefFailed=TotRefFailed+SubRec.getTotref();;
}
}
}
CutListIndx=CutListIndx+1;
}
}
if (TotRtvGen > 0 || TotOtvGen>0 || TotRefGen > 0)
{
ReportOutput TS=new ReportOutput();
TS.setProcessFlag(true);
TS.setErrCode(getErrCode());
TeleSheetLink=TS.GenerateCallingSheet(TeleCutList,GlobalClass.getStoragePath(),CompanyId,BranchId,"telesheet");
if(!TS.isProcessFlag())
{
setProcessFlag(false);
setErrMsg(TS.getErrMsg());
setErrDesc(TS.getErrDesc());
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"TSGEN:Info:Telesheet generated successfully. Please use link in a page to open Tele Sheet.");
setTelePDFLink(GlobalClass.DocServer+TeleSheetLink);
DBF.FetchRunQuery(103, (getTeleSheetTime()+GlobalClass.ColDelim+"telesheet"+GlobalClass.ColDelim+TeleSheetLink+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"ETLST:Error:No records found to generate Tele Sheet.");
}
}
}

View File

@@ -0,0 +1,234 @@
package matrix.nimble.edp.dedupe.controller;
//servlet libraries
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.edp.dedupe.model.DedupeDetails;
import matrix.nimble.edp.dedupe.model.DedupeDo;
import matrix.nimble.edp.dedupe.model.DedupeHandler;
import matrix.nimble.edp.dedupe.model.DedupeRun;
import matrix.nimble.edp.dedupe.model.SendDedupe;
import matrix.nimble.edp.punching.model.CaseGrid;
import matrix.nimble.model.Session;
import matrix.nimble.operation.output.model.BankReportHandler;
import matrix.nimble.operation.output.model.ReportSettings;
import matrix.nimble.operation.reporting.model.ReportingHandler;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class Dedupe {
//---> Run Dedupe
@RequestMapping(value="rundedupe",method=RequestMethod.POST )
public String OpenCutOff(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
DedupeRun DRun=new DedupeRun();
DRun.setErrCode("1007");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
DRun.setSessUUID(UUID);
DRun.getDedList(Sessvals.getCompanyID(), Sessvals.getBranchID(), Sessvals.getUserID());
model.addAttribute("dedupeRun",DRun);
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/deduperun";
}
//<--- Run Dedupe Ends
//---> Do Dedupe
@RequestMapping(value="dodedupe",method=RequestMethod.POST )
public String Allocation(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
String [][]CaseList=null;
DedupeDo Ddo= new DedupeDo();
Ddo.setErrCode("1008");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
model.addAttribute("caseGrid",Ddo);
model.addAttribute("caseList",CaseList);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",FillDedupePortList(Sessvals.getBranchID()));
return "edp/dedupe/dedupedo";
}
//<--- Do Dedupe Ends
//---> Dedupe Do Case List
@RequestMapping(value="dedupecaselist",method=RequestMethod.POST )
public String ListCases(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="caseGrid") CaseGrid caseGrid)
{
DedupeDo Ddo=new DedupeDo();
Ddo.setErrCode("1008");
Ddo.setPortfolioId(caseGrid.getPortfolioId());
String [][]CaseList=Ddo.FillCaseList(caseGrid.getPortfolioId());
if(Ddo.isProcessFlag())
{
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",Ddo);
}
else
{
caseGrid.setErrMsg(Ddo.getErrMsg());
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",Ddo);
}
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",FillDedupePortList(Sessvals.getBranchID()));
return "edp/dedupe/dedupedo";
}
//<--- Dedupe Do Case List Ends
//---> Found Records
@RequestMapping(value="dedupefound",method=RequestMethod.GET )
public String DedupeFound(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@RequestParam String rand,@RequestParam String uuid,HttpSession session)
{
DedupeHandler dedupeHandler=new DedupeHandler();
String uid=GlobalClass.GenerateUUID();
session.setAttribute("UUID", uid);
dedupeHandler.setErrCode("1008");
model.addAttribute("dedupeDetails",dedupeHandler.GetMatchFound(uuid,uid));
model.addAttribute("msg",dedupeHandler.getErrMsg());
model.addAttribute("status",dedupeHandler.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/matchfound";
}
//<--- Dedupe Do Found Records
//---> Found Records
@RequestMapping(value="updatededupe",method=RequestMethod.POST )
public String UpdateMatch(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="dedupeDetails") DedupeDetails dedupeDetails,HttpSession session)
{
DedupeHandler dedupeHandler=new DedupeHandler();
dedupeHandler.setErrCode("1008");
session.getAttribute("UUID");
if(!session.getAttribute("UUID").toString().equals(dedupeDetails.getSessuuid()))
{
dedupeHandler.setProcessFlag(true);
dedupeHandler.setErrMsg("");
}
else
{
dedupeHandler.UpdateDedupe(dedupeDetails,Sessvals.getUserID());
}
if(dedupeHandler.isProcessFlag())
{
dedupeHandler.setErrMsg("1008DEDUPD:info:Details saved successfully");
}
model.addAttribute("dedupeDetails",dedupeDetails);
model.addAttribute("msg",dedupeHandler.getErrMsg());
model.addAttribute("status",dedupeHandler.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/matchfound";
}
//<--- Dedupe Do Found Records
//---> Send Dedupe
@RequestMapping(value="senddedupe",method=RequestMethod.POST )
public String SendDedupe(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
DedupeHandler dedupeHandler=new DedupeHandler();
dedupeHandler.setErrCode("1008");
model.addAttribute("senddedupe",new matrix.nimble.edp.dedupe.model.SendDedupe());
model.addAttribute("portlist",new ModuleFunctions("1008").GetResultArray(134,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg",dedupeHandler.getErrMsg());
model.addAttribute("status",dedupeHandler.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/dedupesend";
}
//<--- End Send Dedupe
//---> Send Dedupe Fetch Case List
@RequestMapping(value="dedupetosend",method=RequestMethod.POST )
public String DedupeToSend(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="senddedupe") SendDedupe senddedupe,HttpSession session)
{
DedupeHandler dedupeHandler=new DedupeHandler();
dedupeHandler.setErrCode("1008");
dedupeHandler.SendDedupe(senddedupe);
String suuid=GlobalClass.GenerateUUID();
session.setAttribute("UUID", suuid);
senddedupe.setSuuid(suuid);
model.addAttribute("senddedupe",senddedupe);
model.addAttribute("portlist",new ModuleFunctions("1008").GetResultArray(134,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg",dedupeHandler.getErrMsg());
model.addAttribute("status",dedupeHandler.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/dedupesend";
}
//<--- End Send Dedupe Fetch Case List
//---> Send Dedupe Fetch Case List
@RequestMapping(value="senddedreports",method=RequestMethod.POST )
public String SendDedupeReports(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="senddedupe") SendDedupe senddedupe,HttpSession session)
{
BankReportHandler BRH=new BankReportHandler();
BRH.setErrCode("1008");
String suuid=GlobalClass.GenerateUUID();
if(!session.getAttribute("UUID").toString().equals(senddedupe.getSuuid()))
{
BRH.setProcessFlag(true);
BRH.setErrMsg("");
}
else
{
ReportSettings RS=new ReportSettings();
RS.setArchivebatch(false);
RS.setAttachannexure(false);
RS.setAutoemail(true);
RS.setDdformat(senddedupe.getFid());
RS.setDdqid(senddedupe.getDqid());
RS.setOffsaqid(0);
RS.setOrformat("0");
RS.setOrsaformat("0");
RS.setOvqid(0);
RS.setPortfolioid(senddedupe.getPortfolioid());
RS.setPrformat("0");
RS.setPvqid(0);
RS.setRefvqid(0);
RS.setRrformat("0");
RS.setRtrformat("0");
RS.setRvqid(0);
RS.setTracker("0");
RS.setTrackqid(0);
RS.setTrformat("0");
RS.setTvqid(0);
RS.setUuids(senddedupe.getUuids());
RS.setReportby("0");
RS.setReporttype("0");
RS.setPortname(senddedupe.getPortname());
RS.setPortsupervisor(senddedupe.getSupervisor());
String Rootdir= GlobalClass.getStoragePath()+"output/dedupe/"+Sessvals.getCompanyID()+"/"+Sessvals.getBranchID()+"/";
BRH.setProcessFlag(true);
BRH.setErrCode("5001");
BRH.setRunningmode("dedupesend");
BRH.setSignPath(request.getServletContext().getRealPath("/"));
BRH.setRootPath(Rootdir);
BRH.GenerateReport(RS,Sessvals.getUserID(),Sessvals.getBranchID());
if(BRH.isProcessFlag())
{
senddedupe.setUuids("");
senddedupe.setCaselist(null);
}
}
session.setAttribute("UUID", suuid);
model.addAttribute("senddedupe",senddedupe);
model.addAttribute("portlist",new ModuleFunctions("1008").GetResultArray(134,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg",BRH.getErrMsg());
model.addAttribute("status",BRH.isProcessFlag());
model.addAttribute("Sessvals",Sessvals);
return "edp/dedupe/dedupesend";
}
//<--- End Send Dedupe Fetch Case List
public String [][] FillPortList(String BranchId)
{
return new ModuleFunctions("1008").GetResultArray(3,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
//<--- End Send Dedupe Fetch Case List
public String [][] FillDedupePortList(String BranchId)
{
return new ModuleFunctions("1008").GetResultArray(446,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}

View File

@@ -0,0 +1,123 @@
package matrix.nimble.edp.dedupe.model;
import java.util.List;
public class DedupeDetails {
private String sessuuid;
private String uuid;
private String mvcode;
private String customername;
private String dob;
private String mobile;
private String resiaddress;
private String offaddress;
private String resiphone;
private String offphone;
private String earremarks;
private String negremarks;
private String category;
public String getSessuuid() {
return sessuuid;
}
public void setSessuuid(String sessuuid) {
this.sessuuid = sessuuid;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getResiaddress() {
return resiaddress;
}
public void setResiaddress(String resiaddress) {
this.resiaddress = resiaddress;
}
public String getOffaddress() {
return offaddress;
}
public void setOffaddress(String offaddress) {
this.offaddress = offaddress;
}
public String getResiphone() {
return resiphone;
}
public void setResiphone(String resiphone) {
this.resiphone = resiphone;
}
public String getOffphone() {
return offphone;
}
public void setOffphone(String offphone) {
this.offphone = offphone;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getEarremarks() {
return earremarks;
}
public void setEarremarks(String earremarks) {
this.earremarks = earremarks;
}
public String getNegremarks() {
return negremarks;
}
public void setNegremarks(String negremarks) {
this.negremarks = negremarks;
}
}

View File

@@ -0,0 +1,70 @@
package matrix.nimble.edp.dedupe.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class DedupeDo {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String PortfolioId;
private String UUID;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getPortfolioId() {
return PortfolioId;
}
public void setPortfolioId(String portfolioId) {
PortfolioId = portfolioId;
}
public String getUUID() {
return UUID;
}
public void setUUID(String uUID) {
UUID = uUID;
}
public String[][] FillCaseList(String PortfolioID)
{
String [][]CaseList=null;
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String ResultData=DBF.FetchRunQuery(53, (PortfolioID+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
setProcessFlag(DBF.isProcessFlag());
CaseList=new StringFunctions(getErrCode()).ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
return CaseList;
}
}

View File

@@ -0,0 +1,111 @@
package matrix.nimble.edp.dedupe.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class DedupeHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public DedupeDetails GetMatchFound(String Uuid,String Sessuuid)
{
DedupeDetails dedupeDetails=new DedupeDetails();
dedupeDetails.setSessuuid(Sessuuid);
DBFunctions dbFunc=new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
String ResultData=dbFunc.FetchRunQuery(54, (Uuid+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbFunc.isProcessFlag())
{
String [] Details=ResultData.split(GlobalClass.ColDelim);
dedupeDetails.setUuid(Uuid);
dedupeDetails.setCustomername(Details[1]);
dedupeDetails.setMvcode(Details[2]);
dedupeDetails.setDob(Details[3]);
dedupeDetails.setMobile(Details[4]);
dedupeDetails.setResiaddress(Details[5]);
dedupeDetails.setOffaddress(Details[6]);
dedupeDetails.setResiphone(Details[7]);
dedupeDetails.setOffphone(Details[8]);
dedupeDetails.setCategory(Details[9]);
setProcessFlag(true);
}
else
{
setProcessFlag(false);
setErrDesc(dbFunc.getErrDesc());
setErrMsg(dbFunc.getErrMsg());
}
return dedupeDetails;
}
public void UpdateDedupe(DedupeDetails dedupeDetails,String UserId)
{
StringFunctions strFunc=new StringFunctions(getErrCode());
String Dedruntime=strFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new java.util.Date());
String [] QueryVals=new String[7];
QueryVals[0]=dedupeDetails.getUuid();
QueryVals[1]=dedupeDetails.getEarremarks().trim().replace("\n", "<br>");
QueryVals[2]=dedupeDetails.getNegremarks().trim().replace("\n", "<br>");
QueryVals[3]=dedupeDetails.getEarremarks().trim().replace("\n", "").length() > 10 ? "Y":"N";
QueryVals[4]=dedupeDetails.getNegremarks().trim().replace("\n", "").length() > 10 ? "Y":"N";
QueryVals[5]=Dedruntime;
QueryVals[6]=UserId;
DBFunctions dbFunc=new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
dbFunc.FetchRunQuery(58, QueryVals);
setProcessFlag(dbFunc.isProcessFlag());
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
}
public void SendDedupe(SendDedupe senddedupe)
{
senddedupe.setCaselist(null);
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(132, (senddedupe.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
senddedupe.setFid(dbf.getResultArray()[0][10]);
senddedupe.setDqid(Integer.parseInt(dbf.getResultArray()[0][11]));
senddedupe.setPortname(dbf.getResultArray()[0][12]);
senddedupe.setSupervisor(dbf.getResultArray()[0][13]);
senddedupe.setCaselist(dbf.getResultArray());
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}
public void GenerateSendDedupe(SendDedupe senddedupe)
{
}
}

View File

@@ -0,0 +1,123 @@
package matrix.nimble.edp.dedupe.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class DedupeRecord {
private List<DedupeRecord> sublist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(DedupeRecord.class));
private String cutoffon;
private int totaddr;
private int totcase;
private int islocked;
private String lockedby;
private String mvcode;
private String applno;
private String customername;
private String apptype;
private String uuid;
private int totrv;
private int totov;
private int totpv;
private String earlier;
private String negative;
public List<DedupeRecord> getSublist() {
return sublist;
}
public void setSublist(List<DedupeRecord> sublist) {
this.sublist = sublist;
}
public int getIslocked() {
return islocked;
}
public void setIslocked(int islocked) {
this.islocked = islocked;
}
public String getLockedby() {
return lockedby;
}
public void setLockedby(String lockedby) {
this.lockedby = lockedby;
}
public String getCutoffon() {
return cutoffon;
}
public void setCutoffon(String cutoffon) {
this.cutoffon = cutoffon;
}
public int getTotaddr() {
return totaddr;
}
public void setTotaddr(int totaddr) {
this.totaddr = totaddr;
}
public int getTotcase() {
return totcase;
}
public void setTotcase(int totcase) {
this.totcase = totcase;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getApplno() {
return applno;
}
public void setApplno(String applno) {
this.applno = applno;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getApptype() {
return apptype;
}
public void setApptype(String apptype) {
this.apptype = apptype;
}
public int getTotrv() {
return totrv;
}
public void setTotrv(int totrv) {
this.totrv = totrv;
}
public int getTotov() {
return totov;
}
public void setTotov(int totov) {
this.totov = totov;
}
public int getTotpv() {
return totpv;
}
public void setTotpv(int totpv) {
this.totpv = totpv;
}
public String getEarlier() {
return earlier;
}
public void setEarlier(String earlier) {
this.earlier = earlier;
}
public String getNegative() {
return negative;
}
public void setNegative(String negative) {
this.negative = negative;
}
}

View File

@@ -0,0 +1,133 @@
package matrix.nimble.edp.dedupe.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class DedupeRun {
private List<DedupeRecord> dedupelist = LazyList.decorate(new ArrayList(),
FactoryUtils.instantiateFactory(DedupeRecord.class));
private String DedcutTime;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<DedupeRecord> getDedupelist() {
return dedupelist;
}
public String getDedcutTime() {
return DedcutTime;
}
public void setDedcutTime(String dedcutTime) {
DedcutTime = dedcutTime;
}
public void setDedupelist(List<DedupeRecord> allocationlist) {
this.dedupelist = allocationlist;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public void getDedList(String CompanyId, String BranchId, String UserId) {
// DedupeRun DedList=new DedupeRun();
StringFunctions StrFunc = new StringFunctions(getErrCode());
setDedcutTime(StrFunc.FormatDate("yyyy/MM/dd HH:mm:ss",new java.util.Date()));
DBFunctions DBF = new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String[] Vals = (CompanyId + GlobalClass.ColDelim + BranchId + GlobalClass.ColDelim+ UserId + GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData = DBF.FetchRunQuery(41, Vals); // Generating list of cut-off batch
if (DBF.isProcessFlag()) {
String[][] DedListData = StrFunc.ConverTo2DArray(ResultData,GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<DedupeRecord> Record = new ArrayList<DedupeRecord>();
for (int RecCount = 0; RecCount < DedListData.length; RecCount++) {
DBF.setProcessFlag(true);
DedupeRecord CORec = new DedupeRecord();
CORec.setCutoffon(DedListData[RecCount][1]);
CORec.setTotaddr(Integer.parseInt(DedListData[RecCount][2]));
CORec.setTotcase(Integer.parseInt(DedListData[RecCount][3]));
CORec.setIslocked(Integer.parseInt(DedListData[RecCount][4]));
CORec.setLockedby(DedListData[RecCount][5]);
// Collecting records for sublist
String[] Vals1 = (CompanyId + GlobalClass.ColDelim + BranchId+ GlobalClass.ColDelim + CORec.getCutoffon() + GlobalClass.ColDelim+ UserId + GlobalClass.ColDelim+ DedListData[RecCount][1] + GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1 = DBF.FetchRunQuery(42, Vals1); // Generating sublist records
if (DBF.isProcessFlag()) {
String[][] SubListData = StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim,GlobalClass.ColDelim);
ArrayList<DedupeRecord> SubRecord = new ArrayList<DedupeRecord>();
for (int ListCount = 0; ListCount < SubListData.length; ListCount++) {
DedupeRecord SCORec = new DedupeRecord();
SCORec.setMvcode(SubListData[ListCount][0]);
SCORec.setApplno(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setApptype(SubListData[ListCount][3]);
SCORec.setTotrv(Integer.parseInt(SubListData[ListCount][4]));
SCORec.setTotov(Integer.parseInt(SubListData[ListCount][5]));
SCORec.setTotpv(Integer.parseInt(SubListData[ListCount][6]));
SCORec.setIslocked(Integer.parseInt(SubListData[ListCount][7]));
SCORec.setLockedby(SubListData[ListCount][8]);
SCORec.setUuid(SubListData[ListCount][9]);
SCORec.setNegative(SubListData[ListCount][10].equals("1") ? "Y":"N");
SCORec.setEarlier(SubListData[ListCount][11].equals("1") ? "Y":"N");
SubRecord.add(SCORec);
}
CORec.setSublist(SubRecord);
}
Record.add(CORec);
}
setDedcutTime(getDedcutTime());
setDedupelist(Record);
setSessUUID(getSessUUID());
} else {
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
}

View File

@@ -0,0 +1,61 @@
package matrix.nimble.edp.dedupe.model;
public class SendDedupe {
private String portfolioid;
private String portname;
private String supervisor;
private int dqid;
private String fid;
private String [][] caselist;
private String suuid;
private String uuids;
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public int getDqid() {
return dqid;
}
public void setDqid(int dqid) {
this.dqid = dqid;
}
public String getFid() {
return fid;
}
public void setFid(String fid) {
this.fid = fid;
}
public String[][] getCaselist() {
return caselist;
}
public void setCaselist(String[][] caselist) {
this.caselist = caselist;
}
public String getSuuid() {
return suuid;
}
public void setSuuid(String suuid) {
this.suuid = suuid;
}
public String getUuids() {
return uuids;
}
public void setUuids(String uuids) {
this.uuids = uuids;
}
public String getPortname() {
return portname;
}
public void setPortname(String portname) {
this.portname = portname;
}
public String getSupervisor() {
return supervisor;
}
public void setSupervisor(String supervisor) {
this.supervisor = supervisor;
}
}

View File

@@ -0,0 +1,47 @@
package matrix.nimble.edp.documents.controller;
import java.text.Format;
import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.edp.dedupe.model.DedupeDetails;
import matrix.nimble.edp.dedupe.model.DedupeDo;
import matrix.nimble.edp.dedupe.model.DedupeHandler;
import matrix.nimble.edp.dedupe.model.DedupeRun;
import matrix.nimble.edp.documents.model.EDPDocumentHandler;
import matrix.nimble.edp.punching.model.CaseGrid;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class EDPDocuments {
//--> Run Dedupe Ends
@RequestMapping(value="doctele",method=RequestMethod.POST )
public String TeleDocuments(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
EDPDocumentHandler EDH=new EDPDocumentHandler();
EDH.setErrCode("8001");
Format formatter = new SimpleDateFormat("yyyy/MM/dd");
String processtime=formatter.format(new java.util.Date())+" 00:00:00";
model.addAttribute("teledoc",EDH.GetTeleDocRecords(processtime, Sessvals.getBranchID()));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("stat",EDH.isProcessFlag());
model.addAttribute("msg",EDH.getErrMsg());
model.addAttribute("docserver",GlobalClass.DocServer);
return "edp/documents/teledocuments";
}
//<--- Run Dedupe Ends
}

View File

@@ -0,0 +1,26 @@
package matrix.nimble.edp.documents.model;
public class DocTelesheet {
private String processtime;
private String branchid;
private String [][] telesheets;
public String getProcesstime() {
return processtime;
}
public void setProcesstime(String processtime) {
this.processtime = processtime;
}
public String getBranchid() {
return branchid;
}
public void setBranchid(String branchid) {
this.branchid = branchid;
}
public String[][] getTelesheets() {
return telesheets;
}
public void setTelesheets(String[][] telesheets) {
this.telesheets = telesheets;
}
}

View File

@@ -0,0 +1,56 @@
package matrix.nimble.edp.documents.model;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
public class EDPDocumentHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public DocTelesheet GetTeleDocRecords(String processtime,String BranchId)
{
DocTelesheet DTS=new DocTelesheet();
ModuleFunctions modFunc=new ModuleFunctions(getErrCode());
modFunc.setProcessFlag(true);
String [][]ResultSet=modFunc.GetResultArray(104, (BranchId+GlobalClass.ColDelim+processtime+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(modFunc.isProcessFlag())
{
setProcessFlag(true);
DTS.setTelesheets(ResultSet);
}
else
{
setProcessFlag(false);
setErrMsg(modFunc.getErrMsg());
setErrDesc(modFunc.getErrDesc());
}
return DTS;
}
}

View File

@@ -0,0 +1,304 @@
package matrix.nimble.edp.output.model;
import java.util.Date;
import java.io.*;
import matrix.nimble.utilities.FileFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.PDFFormatter;
public class ReportOutput {
private String ErrCode;
private boolean ProcessFlag;
private String ErrDesc;
private String ErrMsg;
private String TeleSheetLink;
String [] RepData=null;
String [] fontStyle=null;
String [] colSpan=null;
String [] cellAlignment=null;
String [] cellBorder=null;
String [] cellPaddLeft=null;
String [] cellPaddTop=null;
String [] cellPaddBott=null;
String [] cellPaddRight=null;
private int TabCols;
private String RepFormat;
private PDFFormatter PDFFile;
private String RootPath;
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
private String getTeleSheetLink() {
return TeleSheetLink;
}
private void setTeleSheetLink(String teleSheetLink) {
TeleSheetLink = teleSheetLink;
}
public PDFFormatter getPDFFile() {
return PDFFile;
}
public void setPDFFile(PDFFormatter pDFFile) {
PDFFile = pDFFile;
}
public int getTabCols() {
return TabCols;
}
public void setTabCols(int tabCols) {
TabCols = tabCols;
}
public String getRepFormat() {
return RepFormat;
}
public void setRepFormat(String repFormat) {
RepFormat = repFormat;
}
public String getRootPath() {
return RootPath;
}
public void setRootPath(String rootPath) {
RootPath = rootPath;
}
public String GenerateCallingSheet(String [][] TeleCutList,String RootPath,String CompanyId,String BranchId,String reptype)
{
setRootPath(RootPath);
setTeleSheetLink(getErrCode()+"FNFND:Error:File Not Created");
CreatePDF(TeleCutList[0][3], TeleCutList[0][1],CompanyId,BranchId,reptype);
if(isProcessFlag())
{
for(int Indx=0;Indx<TeleCutList.length;Indx++)
{
if(TeleCutList[Indx][4].equals("notempty"))
{
if(!TeleCutList[Indx][2].equals(getRepFormat()))
{
setRepFormat(TeleCutList[Indx][2]);
InitReportArrays(getRepFormat());
if(!isProcessFlag())
{
setTeleSheetLink(getErrCode()+"FNFND:Error:File Not Created");
try
{
new FileFunctions(getErrCode()).DeleteFile(getTeleSheetLink());
}catch(Exception exce)
{
}
return getTeleSheetLink();
}
}
InvokeMethod(TeleCutList[Indx][5], TeleCutList[Indx][0], TeleCutList[Indx][3], TeleCutList[Indx][1]);
}
}
ClosePDF();
}
return getTeleSheetLink();
}
public void CreatePDF(String UserId,String TeleSheetOn,String CompanyId,String BranchId,String reptype)
{
StringFunctions strFunc=new StringFunctions(getErrCode());
PDFFormatter PDFF=new PDFFormatter();
PDFF.setErrCode(getErrCode());
PDFF.setProcessFlag(true);
String dt=strFunc.FormatDate("yyyy/MM/dd", new Date());
String timeStamp=(TeleSheetOn.replaceAll("/| |:", "_"));
String FileName=getRootPath()+"output/telesheet/"+CompanyId+"/"+BranchId+"/telesheet/"+dt;
File f=new File(FileName);
if(!f.isDirectory())
{
f.mkdirs();
}
if(f.isDirectory())
{
FileName=FileName+"/"+reptype+"_"+UserId+"_"+timeStamp+".pdf";
PDFF.CreateFile(FileName);
if(!PDFF.isProcessFlag())
{
setProcessFlag(false);
setErrDesc(PDFF.getErrDesc());
setErrMsg(PDFF.getErrMsg());
}
else
{
setTeleSheetLink("output/telesheet/"+CompanyId+"/"+BranchId+"/telesheet/"+dt+"/"+reptype+"_"+UserId+"_"+timeStamp+".pdf");
setPDFFile(PDFF);
}
}
else
{
setProcessFlag(false);
setErrDesc(getErrCode()+"CRDIR:Error:Directory creation failed. Please check you have permission to access the target location.");
setErrMsg(getErrDesc());
}
}
public void ClosePDF()
{
getPDFFile().closeDocument();
}
public void GenerateReport(String PortfolioId,String UserId,String TeleSheetOn)
{
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String ResultData=DBF.FetchRunQuery(35, (PortfolioId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+TeleSheetOn+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
StringFunctions StrFunc=new StringFunctions(getErrCode());
String [][] TeleSheetData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(TeleSheetData.length > 0)
{
getPDFFile().createTable(getTabCols());
int rtvStat=1;
int otvStat=1;
for(int rindx=0;rindx<TeleSheetData.length;rindx++)
{
getPDFFile().setFontBlack();
getPDFFile().SetFont("Times", 15);
rtvStat=1;
otvStat=1;
for(int cindx=0;cindx<TeleSheetData[rindx].length-2;cindx++)
{
if((cindx>=11 && cindx<=61) && TeleSheetData[rindx][138].equals("0"))
{
rtvStat=0;
cindx=61;
continue;
}
if(cindx>=62 && TeleSheetData[rindx][139].equals("0"))
{
otvStat=0;
break;
}
getPDFFile().createCell(TeleSheetData[rindx][cindx], Integer.parseInt(fontStyle[cindx]), Integer.parseInt(colSpan[cindx]), Integer.parseInt(cellPaddLeft[cindx]),cellAlignment[cindx],Integer.parseInt(cellBorder[cindx]),Integer.parseInt(cellPaddTop[cindx]),Integer.parseInt(cellPaddBott[cindx]),Integer.parseInt(cellPaddRight[cindx]),0);
getPDFFile().setFontSize(10);
}
if(rtvStat==1 || otvStat==1)
{
getPDFFile().addTable();
getPDFFile().addPageBreak();
getPDFFile().createTable(getTabCols());
}
}
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
public void GenerateRefReport(String PortfolioId,String UserId,String TeleSheetOn)
{
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String ResultData=DBF.FetchRunQuery(215, (PortfolioId+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+TeleSheetOn+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
StringFunctions StrFunc=new StringFunctions(getErrCode());
String [][] RefSheetData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(RefSheetData.length > 0)
{
getPDFFile().createTable(getTabCols());
for(int rindx=0;rindx<RefSheetData.length;rindx++)
{
getPDFFile().setFontBlack();
getPDFFile().SetFont("Arial", 16);
for(int cindx=0;cindx<RefSheetData[rindx].length-1;cindx++)
{
getPDFFile().createCell(RefSheetData[rindx][cindx], Integer.parseInt(fontStyle[cindx]), Integer.parseInt(colSpan[cindx]), Integer.parseInt(cellPaddLeft[cindx]),cellAlignment[cindx],Integer.parseInt(cellBorder[cindx]),Integer.parseInt(cellPaddTop[cindx]),Integer.parseInt(cellPaddBott[cindx]),Integer.parseInt(cellPaddRight[cindx]),0);
getPDFFile().setFontSize(12);
}
getPDFFile().addTable();
getPDFFile().addPageBreak();
getPDFFile().createTable(getTabCols());
}
}
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
}
private void InitReportArrays(String fileName)
{
try
{
FileFunctions FFunc=new FileFunctions(getErrCode());
setTabCols(Integer.parseInt(FFunc.GetKeyValue("cols","templates/"+fileName+".tmpl")));
//RepData=FFunc.GetKeyValue("repdata", fileName).split(GlobalClass.ColDelim);
fontStyle=FFunc.GetKeyValue("fontstyle", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellPaddLeft=FFunc.GetKeyValue("paddingleft", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellPaddRight=FFunc.GetKeyValue("paddingright", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellPaddTop=FFunc.GetKeyValue("paddingtop", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellPaddBott=FFunc.GetKeyValue("paddingbottom", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
colSpan=FFunc.GetKeyValue("colspan", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellBorder=FFunc.GetKeyValue("border", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
cellAlignment=FFunc.GetKeyValue("alignment", "templates/"+fileName+".tmpl").split(GlobalClass.ColDelim);
setProcessFlag(true);
}catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"RPFMT:Error:Error reading report template. Please check the existence of file.");
}
}
private void InvokeMethod(String methodName,String PortfolioId,String UserId,String TeleSheetOn)
{
try {
Class partypes[] = new Class[3];
partypes[0] = String.class;
partypes[1] = String.class;
partypes[2] = String.class;
java.lang.reflect.Method meth = this.getClass().getMethod(methodName, partypes);
Object arglist[] = new Object[3];
arglist[0] = new String(PortfolioId);
arglist[1] = new String(UserId);
arglist[2] = new String(TeleSheetOn);
meth.invoke(this, arglist);
}
catch (Throwable e) {
System.err.println(e);
}
}
}

View File

@@ -0,0 +1,161 @@
package matrix.nimble.edp.punching.controller;
//servlet libraries
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.edp.punching.model.CaseDetails;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.ModuleFunctions;
import matrix.nimble.utilities.GlobalClass;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class CasePucnhing {
@RequestMapping(value="caseadd1",method=RequestMethod.POST )
public String OpenAddCases(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
CaseDetails caseDetails=new CaseDetails();
caseDetails.setFormMode(1);
caseDetails.setErrMsg("");
model.addAttribute("visibleContents","");
model.addAttribute("caseDetails",caseDetails);
model.addAttribute("branchlist",FillBranchList("0"));
model.addAttribute("prodlist",FillProductList("0"));
model.addAttribute("citylist",FillCityList("0"));
model.addAttribute("typelist",FillApptypeList("0"));
model.addAttribute("doclist",FillDocList("0"));
model.addAttribute("catlist",FillCatList("0"));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID()));
return "edp/punching/addcases";
}
@RequestMapping(value="casesave",method=RequestMethod.POST )
public String SaveCase(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="caseDetails") CaseDetails caseDet,HttpSession session)
{
String DynamicNsessVals="";
CaseDetails caseDetails=new CaseDetails();
caseDet.setErrCode("1001");
if(caseDet.getDynamicFields()!="")
{
String [] DynamicFields=caseDet.getDynamicFields().split(GlobalClass.ColDelim);
for(int indx=0;indx<DynamicFields.length;indx++)
{
//DynamicNsessVals=DynamicNsessVals+request.getParameter(DynamicFields[indx])+Delimeter.ColDelim;
caseDet.InvokeSetter("set"+DynamicFields[indx], request.getParameter(DynamicFields[indx]));
}
}
if(caseDet.getFormMode()==1 || caseDet.getFormMode()==2)
{
DynamicNsessVals=DynamicNsessVals+""+Sessvals.getUserID()+GlobalClass.ColDelim;
DynamicNsessVals=DynamicNsessVals+""+Sessvals.getCompanyID()+GlobalClass.ColDelim;
DynamicNsessVals=DynamicNsessVals+""+Sessvals.getBranchID();
}
if(!session.getAttribute("UUID").toString().equals(caseDet.getUUID()))
{
caseDetails.setProcessFlag(true);
caseDetails.setErrMsg("");
}
else
{
caseDet.SaveDetails(DynamicNsessVals);
caseDetails.setProcessFlag(caseDet.isProcessFlag());
caseDetails.setErrMsg(caseDet.getErrMsg());
}
String VisibleContents=caseDet.getVisibleContents();
if(caseDetails.isProcessFlag())
{
String UUID=GlobalClass.GenerateUUID();
caseDetails.setUUID(UUID);
session.setAttribute("UUID", UUID);
caseDetails.setErrCode("1001");
caseDetails.setFormMode(caseDet.getFormMode());
caseDetails.setVisibleContents(VisibleContents);
caseDetails.setPortfolioId(caseDet.getPortfolioId());
caseDetails=caseDetails.DynamicHtml(caseDetails,caseDet.getPortfolioId());
caseDetails.setDynamicFields(caseDet.getDynamicFields());
VisibleContents=VisibleContents+""+caseDetails.getDynamicSection();
model.addAttribute("caseDetails",caseDetails);
}
else
{
caseDet=caseDet.DynamicHtml(caseDet,caseDet.getPortfolioId());
VisibleContents=VisibleContents+""+caseDet.getDynamicSection();
model.addAttribute("caseDetails",caseDet);
}
model.addAttribute("visibleContents",VisibleContents);
model.addAttribute("branchlist",FillBranchList(caseDet.getPortfolioId()));
model.addAttribute("prodlist",FillProductList(caseDet.getPortfolioId()));
model.addAttribute("citylist",FillCityList(Sessvals.getBranchID()));
model.addAttribute("typelist",FillApptypeList(Sessvals.getBranchID()));
model.addAttribute("doclist",FillDocList(caseDet.getPortfolioId()));
model.addAttribute("catlist",FillCatList(caseDet.getPortfolioId()));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID()));
return "edp/punching/addcases";
}
@RequestMapping(value="casedet",method=RequestMethod.POST )
public String GetRequiredData(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="caseDetails") CaseDetails caseDet,HttpSession session)
{
CaseDetails caseDetails = new CaseDetails();
caseDetails.setPortfolioId(caseDet.getPortfolioId());
caseDetails.setErrCode("1001");
String UUID=GlobalClass.GenerateUUID();
caseDetails.setUUID(UUID);
session.setAttribute("UUID", UUID);
caseDetails.setFormMode(caseDet.getFormMode());
caseDetails=caseDetails.DynamicHtml(caseDetails,caseDet.getPortfolioId());
String VisibleContents=(new ModuleFunctions("1001").GetDDHashString(10, ("10"+GlobalClass.ColDelim+caseDet.getPortfolioId()).split(GlobalClass.ColDelim))).replace(GlobalClass.RowDelim, "");
caseDetails.setVisibleContents(VisibleContents);
VisibleContents=(VisibleContents+""+caseDetails.getDynamicSection()).replace(GlobalClass.ColDelim+"null", "");
model.addAttribute("visibleContents",VisibleContents);
model.addAttribute("caseDetails",caseDetails);
model.addAttribute("portlist",Sessvals.getBranchID());
model.addAttribute("branchlist",FillBranchList(caseDet.getPortfolioId()));
model.addAttribute("prodlist",FillProductList(caseDet.getPortfolioId()));
model.addAttribute("citylist",FillCityList(Sessvals.getBranchID()));
model.addAttribute("typelist",FillApptypeList(Sessvals.getBranchID()));
model.addAttribute("doclist",FillDocList(caseDet.getPortfolioId()));
model.addAttribute("catlist",FillCatList(caseDet.getPortfolioId()));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID()));
return "edp/punching/addcases";
}
public String [][] FillPortList(String BranchId)
{
return new ModuleFunctions("1001").GetResultArray(3,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
public String [][] FillCityList(String BranchID)
{
return new ModuleFunctions("1001").GetResultArray(6,BranchID.split(GlobalClass.ColDelim));
}
public String [][] FillApptypeList(String BranchID)
{
return new ModuleFunctions("1001").GetResultArray(8,BranchID.split(GlobalClass.ColDelim));
}
public String [][] FillCatList(String PortfolioID)
{
return new ModuleFunctions("1001").GetResultArray(9,PortfolioID.split(GlobalClass.ColDelim));
}
public String [][] FillDocList(String PortfolioID)
{
return new ModuleFunctions("1001").GetResultArray(7,PortfolioID.split(GlobalClass.ColDelim));
}
public String [][] FillBranchList(String PortfolioID)
{
return new ModuleFunctions("1001").GetResultArray(4,PortfolioID.split(GlobalClass.ColDelim));
}
public String [][] FillProductList(String PortfolioID)
{
return new ModuleFunctions("1001").GetResultArray(5,PortfolioID.split(GlobalClass.ColDelim));
}
}

View File

@@ -0,0 +1,60 @@
package matrix.nimble.edp.punching.controller;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import matrix.nimble.edp.punching.model.CaseGrid;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class EditCasesGrid {
@RequestMapping(value="editgrid",method=RequestMethod.POST )
public String OpenEditGrid(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
String [][]CaseList=null;
CaseGrid CG=new CaseGrid();
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",CG);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(),Sessvals.getUserID()));
return "edp/punching/editcases";
}
@RequestMapping(value="caselist",method=RequestMethod.POST)
public String ListCases(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="caseGrid") CaseGrid caseGrid)
{
CaseGrid CG=new CaseGrid();
CG.setErrCode("1002");
CG.setPortfolioId(caseGrid.getPortfolioId());
String [][]CaseList=CG.FillCaseList(caseGrid.getPortfolioId(), Sessvals.getBranchID());
if(CG.isProcessFlag())
{
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",CG);
}
else
{
caseGrid.setErrMsg(CG.getErrMsg());
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",caseGrid);
}
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(),Sessvals.getUserID()));
return "edp/punching/editcases";
}
public String [][] FillPortList(String BranchId,String userId)
{
return new ModuleFunctions("1002").GetResultArray(249,(BranchId+GlobalClass.ColDelim+userId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}

View File

@@ -0,0 +1,278 @@
package matrix.nimble.edp.punching.controller;
//servlet libraries
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
//spring libraries
import matrix.nimble.edp.punching.model.PunchingHandler;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.CommonFunctions;
import matrix.nimble.utilities.GlobalClass;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class Punching {
@RequestMapping(value="initview",method=RequestMethod.POST )
public String InitializeScreen(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
PunchingHandler PH=new PunchingHandler();
PH.setErrCode("1001");
model.addAttribute("visiblecontents","");
model.addAttribute("branchlist",null);
model.addAttribute("prodlist",null);
model.addAttribute("citylist",null);
model.addAttribute("typelist",null);
model.addAttribute("doclist",null);
model.addAttribute("catlist",null);
model.addAttribute("portfolio_id","-1");
model.addAttribute("Sessvals",Sessvals);
PH.GetDDValues(3, Sessvals.getBranchID().split(GlobalClass.ColDelim));
model.addAttribute("portlist",PH.getOptionvals());
model.addAttribute("formmode",0);
model.addAttribute("stat",true);
model.addAttribute("duuid","xxx");
model.addAttribute("msg","");
return "edp/punching/initcase";
}
@RequestMapping(value="initdocview",method=RequestMethod.POST )
public String InitDocScreen(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
PunchingHandler PH=new PunchingHandler();
PH.setErrCode("1901");
model.addAttribute("branchlist",null);
model.addAttribute("prodlist",null);
model.addAttribute("typelist",null);
model.addAttribute("doclist",null);
model.addAttribute("catlist",null);
model.addAttribute("portfolio_id","-1");
model.addAttribute("Sessvals",Sessvals);
PH.GetDDValues(240, Sessvals.getBranchID().split(GlobalClass.ColDelim));
model.addAttribute("portlist",PH.getOptionvals());
model.addAttribute("formmode",0);
model.addAttribute("stat",true);
model.addAttribute("msg","");
return "edp/punching/initdocs";
}
@RequestMapping(value="docadd",method=RequestMethod.POST )
public String PunchDocs(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
String msg="";
PunchingHandler PH=new PunchingHandler();
CommonFunctions comFunc=new CommonFunctions();
PH.setErrCode("1901");
PH.setPortfolioid(request.getParameter("portfolio_id"));
PH.setProcessFlag(true);
PH.DocDynamicHtml();
if(PH.isProcessFlag())
{
model.addAttribute("dynamichtml",PH.getDynamicpanel());
model.addAttribute("dynamicfields",PH.getDynamicfields());
model.addAttribute("docdynamichtml",PH.getDocdynamicpanel());
model.addAttribute("docdynamicfields",PH.getDocdynamicfields());
}
else
{
msg=PH.getErrMsg();
}
PH.GetDDValues(240, Sessvals.getBranchID().split(GlobalClass.ColDelim));
model.addAttribute("portlist",PH.getOptionvals());
PH.GetDDValues(4, PH.getPortfolioid().split(GlobalClass.ColDelim));
model.addAttribute("branchlist",PH.getOptionvals());
PH.GetDDValues(5, (Sessvals.getBranchID()+GlobalClass.ColDelim+"op.description='DOCUMENT' or op.description='APPTYPE'"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(PH.getOptionvals()!=null)
{
model.addAttribute("typelist",comFunc.GetSubArray("APPTYPE", 2, PH.getOptionvals()));
}
else
{
model.addAttribute("typelist",null);
}
PH.GetDDValues(241, PH.getPortfolioid().split(GlobalClass.ColDelim));
model.addAttribute("doclist",PH.getOptionvals());
PH.GetDDValues(70, (PH.getPortfolioid()+GlobalClass.ColDelim+"op.description='CATEGORY' or op.description='PRODUCT'"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(PH.getOptionvals()!=null)
{
model.addAttribute("prodlist",comFunc.GetSubArray("PRODUCT", 2, PH.getOptionvals()));
model.addAttribute("catlist",comFunc.GetSubArray("CATEGORY", 2, PH.getOptionvals()));
}
else
{
model.addAttribute("prodlist",null);
model.addAttribute("catlist",null);
}
model.addAttribute("portfolio_id",PH.getPortfolioid());
model.addAttribute("usid",Sessvals.getUserID());
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("formmode",1);
model.addAttribute("stat",PH.isProcessFlag());
model.addAttribute("msg",msg);
return "edp/punching/initdocs";
}
@RequestMapping(value="addeditdoc",method=RequestMethod.POST )
public String AddEditDocs(@RequestParam String val0,@RequestParam String val1,@RequestParam String val2,@RequestParam String val3,@RequestParam String val4,@RequestParam String val5,@RequestParam String val6,@RequestParam String val7,@RequestParam String val8,@RequestParam String val9,@RequestParam String val10)
{
String retval="success";
try
{
//System.out.println(URLDecoder.decode(val0,"UTF-8"));
//System.out.println(URLDecoder.decode(val1,"UTF-8"));
//System.out.println(URLDecoder.decode(val2,"UTF-8"));
//System.out.println(URLDecoder.decode(val3,"UTF-8"));
//System.out.println(URLDecoder.decode(val4,"UTF-8"));
//System.out.println(URLDecoder.decode(val6,"UTF-8"));
//System.out.println(URLDecoder.decode(val7,"UTF-8"));
//System.out.println(URLDecoder.decode(val8,"UTF-8"));
//System.out.println(URLDecoder.decode(val9,"UTF-8"));
//System.out.println(URLDecoder.decode(val10,"UTF-8"));
PunchingHandler PH=new PunchingHandler();
PH.setErrCode("1902");
PH.setProcessFlag(true);
PH.AddEditDocs(val0, val1, val2, val3, val4, val6, val7, val8, val9, val10);
}catch(Exception exce)
{
retval=exce.getMessage();
}
return retval;
}
@RequestMapping(value="caseadd",method=RequestMethod.POST )
public String PunchCase(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
String msg="";
PunchingHandler PH=new PunchingHandler();
CommonFunctions comFunc=new CommonFunctions();
PH.setErrCode("1001");
PH.setPortfolioid(request.getParameter("portfolio_id"));
PH.setProcessFlag(true);
PH.DynamicHtml("10");
if(PH.isProcessFlag())
{
model.addAttribute("dynamicfields",PH.getDynamicfields());
if(PH.isProcessFlag())
{
model.addAttribute("visiblecontents",(PH.GetVisibleSections()+""+PH.getDynamicsection()).replace("null", ""));
model.addAttribute("dynamichtml",PH.getDynamicpanel());
}
else
{
msg=PH.getErrMsg();
}
}
else
{
msg=PH.getErrMsg();
}
PH.GetDDValues(3, Sessvals.getBranchID().split(GlobalClass.ColDelim));
model.addAttribute("portlist",PH.getOptionvals());
PH.GetDDValues(4, PH.getPortfolioid().split(GlobalClass.ColDelim));
model.addAttribute("branchlist",PH.getOptionvals());
PH.GetDDValues(5, (Sessvals.getBranchID()+GlobalClass.ColDelim+"op.description='CITY' or op.description='APPTYPE'"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(PH.getOptionvals()!=null)
{
model.addAttribute("citylist",comFunc.GetSubArray("CITY", 2, PH.getOptionvals()));
model.addAttribute("typelist",comFunc.GetSubArray("APPTYPE", 2, PH.getOptionvals()));
}
else
{
model.addAttribute("citylist",null);
model.addAttribute("typelist",null);
}
PH.GetDDValues(70, (PH.getPortfolioid()+GlobalClass.ColDelim+"op.description='CATEGORY' or op.description='PRODUCT'"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(PH.getOptionvals()!=null)
{
model.addAttribute("prodlist",comFunc.GetSubArray("PRODUCT", 2, PH.getOptionvals()));
model.addAttribute("catlist",comFunc.GetSubArray("CATEGORY", 2, PH.getOptionvals()));
}
else
{
model.addAttribute("prodlist",null);
model.addAttribute("catlist",null);
}
model.addAttribute("portfolio_id",PH.getPortfolioid());
model.addAttribute("doclist",null);
model.addAttribute("usid",Sessvals.getUserID());
model.addAttribute("duuid","xxx");
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("formmode",1);
model.addAttribute("stat",PH.isProcessFlag());
model.addAttribute("msg",msg);
return "edp/punching/initcase";
}
@RequestMapping(value="caseedit",method=RequestMethod.POST )
public String EditCase(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
String msg="";
PunchingHandler PH=new PunchingHandler();
CommonFunctions comFunc=new CommonFunctions();
PH.setErrCode("1001");
PH.setPortfolioid(request.getParameter("PortfolioId"));
PH.setProcessFlag(true);
PH.DynamicHtml("10");
if(PH.isProcessFlag())
{
model.addAttribute("dynamicfields",PH.getDynamicfields());
if(PH.isProcessFlag())
{
model.addAttribute("visiblecontents",(PH.GetVisibleSections()+""+PH.getDynamicsection()).replace("null", ""));
model.addAttribute("dynamichtml",PH.getDynamicpanel());
}
else
{
msg=PH.getErrMsg();
}
}
else
{
msg=PH.getErrMsg();
}
PH.GetDDValues(3, Sessvals.getBranchID().split(GlobalClass.ColDelim));
model.addAttribute("portlist",PH.getOptionvals());
PH.GetDDValues(4, PH.getPortfolioid().split(GlobalClass.ColDelim));
model.addAttribute("branchlist",PH.getOptionvals());
PH.GetDDValues(5, (Sessvals.getBranchID()+GlobalClass.ColDelim+"op.description='CITY' or op.description='APPTYPE'"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(PH.getOptionvals()!=null)
{
model.addAttribute("citylist",comFunc.GetSubArray("CITY", 2, PH.getOptionvals()));
model.addAttribute("typelist",comFunc.GetSubArray("APPTYPE", 2, PH.getOptionvals()));
}
else
{
model.addAttribute("citylist",null);
model.addAttribute("typelist",null);
}
PH.GetDDValues(70, (PH.getPortfolioid()+GlobalClass.ColDelim+"op.description='CATEGORY' or op.description='PRODUCT'"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(PH.getOptionvals()!=null)
{
model.addAttribute("prodlist",comFunc.GetSubArray("PRODUCT", 2, PH.getOptionvals()));
model.addAttribute("catlist",comFunc.GetSubArray("CATEGORY", 2, PH.getOptionvals()));
}
else
{
model.addAttribute("prodlist",null);
model.addAttribute("catlist",null);
}
model.addAttribute("portfolio_id",PH.getPortfolioid());
model.addAttribute("doclist",null);
model.addAttribute("usid",Sessvals.getUserID());
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("formmode",2);
model.addAttribute("duuid",request.getParameter("uuid"));
model.addAttribute("stat",PH.isProcessFlag());
model.addAttribute("msg",msg);
return "edp/punching/initcase";
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,70 @@
package matrix.nimble.edp.punching.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class CaseGrid {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String PortfolioId;
private String CaseID;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getPortfolioId() {
return PortfolioId;
}
public void setPortfolioId(String portfolioId) {
PortfolioId = portfolioId;
}
public String getCaseID() {
return CaseID;
}
public void setCaseID(String caseID) {
CaseID = caseID;
}
public String[][] FillCaseList(String PortfolioID,String CompBranchId)
{
String [][]CaseList=null;
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String ResultData=DBF.FetchRunQuery(23, (PortfolioID+GlobalClass.ColDelim+CompBranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
setProcessFlag(DBF.isProcessFlag());
CaseList=new StringFunctions(getErrCode()).ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
return CaseList;
}
}

View File

@@ -0,0 +1,88 @@
package matrix.nimble.edp.punching.model;
public class DocDetails {
private String portfolioid;
private String bankbranchid;
private String applno;
private String customername;
private String product;
private String apptype;
private String category;
private String loanamount;
private String dob;
private String caseid;
private String uuid;
private int formmode;
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getBankbranchid() {
return bankbranchid;
}
public void setBankbranchid(String bankbranchid) {
this.bankbranchid = bankbranchid;
}
public String getApplno() {
return applno;
}
public void setApplno(String applno) {
this.applno = applno;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getProduct() {
return product;
}
public void setProduct(String product) {
this.product = product;
}
public String getApptype() {
return apptype;
}
public void setApptype(String apptype) {
this.apptype = apptype;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getLoanamount() {
return loanamount;
}
public void setLoanamount(String loanamount) {
this.loanamount = loanamount;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getCaseid() {
return caseid;
}
public void setCaseid(String caseid) {
this.caseid = caseid;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public int getFormmode() {
return formmode;
}
public void setFormmode(int formmode) {
this.formmode = formmode;
}
}

View File

@@ -0,0 +1,270 @@
package matrix.nimble.edp.punching.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
import matrix.nimble.edp.cutoff.model.CutOffRecord;
import matrix.nimble.utilities.CommonFunctions;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class PunchingHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String visiblecontents;
private String dynamicpanel;
private String dynamicsection;
private String dynamicfields;
private String docdynamicfields;
private String docdynamicpanel;
private String portfolioid;
private String [][] optionvals;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getVisiblecontents() {
return visiblecontents;
}
public void setVisiblecontents(String visiblecontents) {
this.visiblecontents = visiblecontents;
}
public String getDynamicpanel() {
return dynamicpanel;
}
public void setDynamicpanel(String dynamicpanel) {
this.dynamicpanel = dynamicpanel;
}
public String getDocdynamicfields() {
return docdynamicfields;
}
public void setDocdynamicfields(String docdynamicfields) {
this.docdynamicfields = docdynamicfields;
}
public String getDocdynamicpanel() {
return docdynamicpanel;
}
public void setDocdynamicpanel(String docdynamicpanel) {
this.docdynamicpanel = docdynamicpanel;
}
public String getDynamicsection() {
return dynamicsection;
}
public void setDynamicsection(String dynamicsection) {
this.dynamicsection = dynamicsection;
}
public String getDynamicfields() {
return dynamicfields;
}
public void setDynamicfields(String dynamicfields) {
this.dynamicfields = dynamicfields;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String[][] getOptionvals() {
return optionvals;
}
public void setOptionvals(String[][] optionvals) {
this.optionvals = optionvals;
}
public String GetVisibleSections()
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
setVisiblecontents("");
return dbf.FetchRunQuery(10, ("10"+GlobalClass.ColDelim+getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)).replace(GlobalClass.RowDelim, "");
}
public void GetDDValues(int QueryId,String [] Qvals)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(QueryId, Qvals);
if(dbf.isProcessFlag())
{
setOptionvals(dbf.getResultArray());
}
else
{
setOptionvals(null);
}
}
public void DocDynamicHtml()
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
setDynamicfields("");
setDynamicpanel("");
setDocdynamicfields("");
setDocdynamicpanel("");
dbf.FetchRunQuery(74, (getPortfolioid()+GlobalClass.ColDelim+"75"+GlobalClass.ColDelim+"ADDDOC"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
CommonFunctions Cfunc=new CommonFunctions();
String [][] ResultSet=dbf.getResultArray();
if(ResultSet.length > 0)
{
Cfunc.setGeneratedHtml("");
Cfunc.setPrevControl("");
Cfunc.setDynamicCtrls("");
for(int indx=0;indx<ResultSet.length;indx++)
{
String ControlVal="";
String secContainer="";
String Temp="";
secContainer=Cfunc.DynamicControls(ResultSet[indx], ControlVal);
if(secContainer.equals("Generalsec"))
{
Temp=getDynamicpanel();
setDynamicfields(getDynamicfields()+ResultSet[indx][2]+GlobalClass.ColDelim);
if(Temp.endsWith("</select></div></div></div>") && Cfunc.getGeneratedHtml().endsWith("</select></div></div></div>"))
{
if(!Cfunc.getGeneratedHtml().startsWith("<div class='widget'>"))
{
Temp=Temp.substring(0,Temp.lastIndexOf("</select></div></div></div>"));
}
}
setDynamicpanel(Temp+""+Cfunc.getGeneratedHtml());
}
if(secContainer.equals("Docsec"))
{
Temp=getDocdynamicpanel();
setDocdynamicfields(getDocdynamicfields()+ResultSet[indx][2]+GlobalClass.ColDelim);
if(Temp.endsWith("</select></div></div></div>") && Cfunc.getGeneratedHtml().endsWith("</select></div></div></div>"))
{
if(!Cfunc.getGeneratedHtml().startsWith("<div class='widget'>"))
{
Temp=Temp.substring(0,Temp.lastIndexOf("</select></div></div></div>"));
}
}
setDocdynamicpanel(Temp+""+Cfunc.getGeneratedHtml());
}
}
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}
}
public void DynamicHtml(String pageId)
{
DBFunctions dbf=new DBFunctions(getErrCode());
StringFunctions StrFunc=new StringFunctions(getErrCode());
setDynamicpanel("");
setDynamicfields("");
dbf.setProcessFlag(true);
String ResultString=dbf.FetchRunQuery(74, (getPortfolioid()+GlobalClass.ColDelim+pageId+GlobalClass.ColDelim+"ADDCASE"+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
StrFunc=new StringFunctions(getErrCode());
CommonFunctions Cfunc=new CommonFunctions();
String [][] ResultSet=StrFunc.ConverTo2DArray(ResultString, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(StrFunc.isProcessFlag())
{
if(ResultSet.length > 0)
{
setDynamicsection("section6"+GlobalClass.ColDelim);
Cfunc.setGeneratedHtml("");
Cfunc.setPrevControl("");
Cfunc.setDynamicCtrls("");
for(int indx=0;indx<ResultSet.length;indx++)
{
String ControlVal="";
String secContainer="";
String Temp="";
secContainer=Cfunc.DynamicControls(ResultSet[indx], ControlVal);
if(secContainer.equals("Othersec"))
{
Temp=getDynamicpanel();
if(Temp.endsWith("</select></div></div></div>") && Cfunc.getGeneratedHtml().endsWith("</select></div></div></div>"))
{
if(!Cfunc.getGeneratedHtml().startsWith("<div class='widget'>"))
{
Temp=Temp.substring(0,Temp.lastIndexOf("</select></div></div></div>"));
}
}
setDynamicpanel(Temp+""+Cfunc.getGeneratedHtml());
}
}
setDynamicfields(Cfunc.getDynamicCtrls());
}
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}
else
{
setProcessFlag(dbf.getErrMsg().toLowerCase().contains("no records found") ? true:false);
setErrMsg(dbf.getErrMsg().toLowerCase().contains("no records found") ? "" : dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}
public void AddEditDocs(String docType,String docHolder,String serviceProvider,String uniqueNo,String bankId,String yearMonth,String city,String vendorId,String uuId,String userId)
{
}
public String[][] loadCasesForAddrCorrection() {
String [][]resultArray = null;
DBFunctions dbf=new DBFunctions(getErrCode());
StringFunctions StrFunc=new StringFunctions(getErrCode());
setDynamicpanel("");
setDynamicfields("");
dbf.setProcessFlag(true);
dbf.FetchRunQuery(474, (getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
resultArray = dbf.getResultArray();
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
return resultArray;
}
}

View File

@@ -0,0 +1,189 @@
package matrix.nimble.edp.tools.controller;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import matrix.nimble.edp.tools.model.DelCaseGrid;
import matrix.nimble.edp.tools.model.EdpToolsHandler;
import matrix.nimble.edp.tools.model.AddEditProduct;
import matrix.nimble.edp.tools.model.CutoffPending;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import matrix.nimble.utilities.DBFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class EDPTools
{
@RequestMapping(value="cutoffpending",method=RequestMethod.POST )
public String PendingProcess(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
CutoffPending PList=new CutoffPending();
PList.setErrCode("1010");
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
PList.setSessUUID(UUID);
model.addAttribute("cutoffpending", PList.getPList(Sessvals.getCompanyID(), Sessvals.getBranchID(), Sessvals.getUserID()));
model.addAttribute("Sessvals",Sessvals);
return "edp/tools/edpprocesspanel";
}
@RequestMapping(value="savecutoffpending",method=RequestMethod.POST )
public String SavePendingProcess(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="cutoffpending") CutoffPending CPend,HttpSession session)
{
CPend.setErrCode("1010");
if(session.getAttribute("UUID").toString().equals(CPend.getSessUUID()))
{
CPend.FinalizeCutoffPending(Sessvals.getUserID(),Sessvals.getCompanyID(), Sessvals.getBranchID(),CPend);
}
else
{
CPend.setProcessFlag(true);
CPend.setErrMsg("");
}
if(CPend.isProcessFlag())
{
CutoffPending PList=new CutoffPending();
String UUID=GlobalClass.GenerateUUID();
session.setAttribute("UUID", UUID);
PList.setSessUUID(UUID);
model.addAttribute("cutoffpending", PList.getPList(Sessvals.getCompanyID(), Sessvals.getBranchID(), Sessvals.getUserID()));
PList.setErrCode(CPend.getErrCode());
PList.setErrMsg(CPend.getErrMsg());
model.addAttribute("cutoffpending", PList);
model.addAttribute("Sessvals",Sessvals);
}
else
{
model.addAttribute("cutoffpending",CPend);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/tools/edpprocesspanel";
}
@RequestMapping(value="delcutoffgrid",method=RequestMethod.POST )
public String OpenEditGrid(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
String [][]CaseList=null;
DelCaseGrid CG=new DelCaseGrid();
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("caseList",CaseList);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID()));
model.addAttribute("caseGrid",CG);
return "edp/tools/delcutoffcases";
}
@RequestMapping(value="delcaselist",method=RequestMethod.POST )
public String ListCases(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="caseGrid") DelCaseGrid delcaseGrid)
{
DelCaseGrid DCG=new DelCaseGrid();
DCG.setErrCode("1011");
DCG.setPortfolioId(delcaseGrid.getPortfolioId());
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID()));
String [][]CaseList=DCG.FillCaseList(delcaseGrid.getPortfolioId(), Sessvals.getBranchID());
if(DCG.isProcessFlag())
{
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",DCG);
}
else
{
delcaseGrid.setErrMsg(DCG.getErrMsg());
model.addAttribute("caseList",CaseList);
model.addAttribute("caseGrid",delcaseGrid);
}
model.addAttribute("Sessvals",Sessvals);
return "edp/tools/delcutoffcases";
}
@RequestMapping(value="deletecases",method=RequestMethod.POST )
public String DelCases(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="caseGrid") DelCaseGrid delcaseGrid)
{
String Cond="",Temp="";
delcaseGrid.setErrCode("1011");
Cond=delcaseGrid.getDelStat();
String [][]CaseList=null;
DelCaseGrid CG=new DelCaseGrid();
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("caseList",CaseList);
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID()));
DBFunctions DBF=new DBFunctions(delcaseGrid.getErrCode());
DBF.setProcessFlag(true);
if(!Cond.equals(""))
{
Cond=Cond.substring(0,Cond.length()-1);
Cond=Cond.replace(",", " or uuid=");
Cond=" uuid="+Cond+GlobalClass.ColDelim;
Temp=DBF.FetchRunQuery(55, Cond.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
delcaseGrid.setErrMsg("Record Deleted Successfully...."+delcaseGrid.getErrMsg());
CG.setErrCode(delcaseGrid.getErrCode());
CG.setErrMsg(delcaseGrid.getErrMsg());
}
else
{
delcaseGrid.setErrMsg("Record Deleted Failed...."+delcaseGrid.getErrMsg());
CG.setErrCode(delcaseGrid.getErrCode());
CG.setErrMsg(delcaseGrid.getErrMsg());
}
}
model.addAttribute("caseGrid",CG);
return "edp/tools/delcutoffcases";
}
public HashMap<String,String> FillPortList(String BranchID)
{
return new ModuleFunctions("1011").GetDDHashMap(3,(BranchID+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
public String [][] FillBranchCityList(String CompanyID,String BranchID)
{
return new ModuleFunctions("1013").GetResultArray(78,(CompanyID+GlobalClass.ColDelim+BranchID+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
@RequestMapping(value="initaddproduct",method=RequestMethod.POST )
public String AddProduct(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
model.addAttribute("addproduct", new AddEditProduct());
model.addAttribute("portlist", new ModuleFunctions("1011").GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("Sessvals",Sessvals);
return "edp/tools/addproduct";
}
@RequestMapping(value="getproducts",method=RequestMethod.POST )
public String GetProduct(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@ModelAttribute(value="addproduct") AddEditProduct addEditProduct)
{
EdpToolsHandler etl = new EdpToolsHandler();
etl.setErrCode("0002");
etl.setProcessFlag(true);
etl.getMappedProducts(addEditProduct);
model.addAttribute("addproduct", addEditProduct);
model.addAttribute("portlist", new ModuleFunctions("1011").GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("Sessvals",Sessvals);
return "edp/tools/addproduct";
}
@RequestMapping(value="addremoveproduct",method=RequestMethod.POST )
public String addRemoveProduct(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@ModelAttribute(value="addproduct") AddEditProduct addEditProduct)
{
EdpToolsHandler etl = new EdpToolsHandler();
etl.setErrCode("0002");
etl.setProcessFlag(true);
addEditProduct.setUserid(Sessvals.getUserID());
etl.addRemoveProduct(addEditProduct);
model.addAttribute("addproduct", addEditProduct);
model.addAttribute("portlist", new ModuleFunctions("1011").GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("Sessvals",Sessvals);
return "edp/tools/addproduct";
}
}

View File

@@ -0,0 +1,141 @@
package matrix.nimble.edp.tools.model;
import java.util.Arrays;
public class AddEditProduct {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
private String [][] mappedproducts;
private String [][] alloptionvalues;
private String optionid;
private String portfolio_id;
private String data;
private String userid;
public AddEditProduct() {
setProcessFlag(true);
setErrCode(null);
setErrDesc(null);
setErrMsg("");
}
public AddEditProduct(String[][] mappedproducts, String[][] alloptionvalues, String optionid, String data, String userid) {
this.mappedproducts = mappedproducts;
this.alloptionvalues = alloptionvalues;
this.optionid = optionid;
this.data = data;
this.userid = userid;
}
@Override
public String toString() {
return "AddEditProduct [ErrMsg=" + ErrMsg + ", ErrDesc=" + ErrDesc + ", ErrCode=" + ErrCode + ", SessUUID="
+ SessUUID + ", ProcessFlag=" + ProcessFlag + ", mappedproducts=" + Arrays.toString(mappedproducts)
+ ", alloptionvalues=" + Arrays.toString(alloptionvalues) + ", optionid=" + optionid + ", portfolio_id="
+ portfolio_id + "]";
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public String getSessUUID() {
return SessUUID;
}
public void setSessUUID(String sessUUID) {
SessUUID = sessUUID;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String[][] getMappedproducts() {
return mappedproducts;
}
public void setMappedproducts(String[][] mappedproducts) {
this.mappedproducts = mappedproducts;
}
public String[][] getAlloptionvalues() {
return alloptionvalues;
}
public void setAlloptionvalues(String[][] alloptionvalues) {
this.alloptionvalues = alloptionvalues;
}
public String getOptionid() {
return optionid;
}
public void setOptionid(String optionid) {
this.optionid = optionid;
}
public String getPortfolio_id() {
return portfolio_id;
}
public void setPortfolio_id(String portfolio_id) {
this.portfolio_id = portfolio_id;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
}

View File

@@ -0,0 +1,124 @@
package matrix.nimble.edp.tools.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import matrix.nimble.utilities.ModuleFunctions;
public class ColonyFuncs {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getVerifiers(String BranchId)
{
DBFunctions DBF=new DBFunctions(getErrCode());
StringFunctions StrFunc=new StringFunctions(getErrCode());
ModuleFunctions ModFunc=new ModuleFunctions(getErrCode());
String ResultData="";
DBF.setProcessFlag(true);
ResultData=DBF.FetchRunQuery(69, (BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim)); //Generating list of portfolios those telesheet to be generated
if(DBF.isProcessFlag())
{
setProcessFlag(DBF.isProcessFlag());
String [][] PListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(StrFunc.isProcessFlag())
{
setProcessFlag(true);
ResultData = ModFunc.optionList(PListData);
}
else
{
setProcessFlag(false);
setErrMsg(StrFunc.getErrMsg());
setErrDesc(StrFunc.getErrDesc());
}
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
return ResultData;
}
public String getAllocColony(String val)
{
DBFunctions DBF=new DBFunctions(getErrCode());
StringFunctions StrFunc=new StringFunctions(getErrCode());
String ResultData="";
DBF.setProcessFlag(true);
ResultData=DBF.FetchRunQuery(80, (val+GlobalClass.ColDelim).split(GlobalClass.ColDelim)); //Generating list of portfolios those telesheet to be generated
if(DBF.isProcessFlag())
{
String [][] PListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(StrFunc.isProcessFlag())
{
setProcessFlag(true);
ResultData = StrFunc.generateTableRows(PListData);
}
else
{
setProcessFlag(false);
setErrMsg(StrFunc.getErrMsg());
setErrDesc(StrFunc.getErrDesc());
}
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
return ResultData;
}
public String runColonyShift(String val,String mode,String CurDateTime,String sesval)
{
DBFunctions DBF=new DBFunctions(getErrCode());
StringFunctions StrFunc=new StringFunctions(getErrCode());
String ResultData="";
DBF.setProcessFlag(true);
ResultData=DBF.FetchRunQuery(73, (val+GlobalClass.ColDelim+CurDateTime+GlobalClass.ColDelim+mode+GlobalClass.ColDelim+sesval+GlobalClass.ColDelim).split(GlobalClass.ColDelim)); //Generating list of portfolios those telesheet to be generated
ResultData=DBF.getProcResult();
if(DBF.isProcessFlag())
{
setProcessFlag(true);
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
return ResultData;
}
}

View File

@@ -0,0 +1,89 @@
package matrix.nimble.edp.tools.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class CutOffPRecord
{
private List<CutOffPRecord> pendingsublist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffPRecord.class));
private String portfolio;
private String customername;
private String cutofftime;
private int total;
private String uuid;
private boolean allocation;
private boolean telesheet;
private boolean earlier;
private boolean negative;
private boolean cutoff;
public String getPortfolio() {
return portfolio;
}
public void setPortfolio(String portfolio) {
this.portfolio = portfolio;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public List<CutOffPRecord> getPendingsublist() {
return pendingsublist;
}
public void setPendingsublist(List<CutOffPRecord> pendingsublist) {
this.pendingsublist = pendingsublist;
}
public String getCutofftime() {
return cutofftime;
}
public void setCutofftime(String cutofftime) {
this.cutofftime = cutofftime;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public boolean isAllocation() {
return allocation;
}
public void setAllocation(boolean allocation) {
this.allocation = allocation;
}
public boolean isTelesheet() {
return telesheet;
}
public void setTelesheet(boolean telesheet) {
this.telesheet = telesheet;
}
public boolean isEarlier() {
return earlier;
}
public void setEarlier(boolean earlier) {
this.earlier = earlier;
}
public boolean isNegative(){
return negative;
}
public void setNegative(boolean negative) {
this.negative = negative;
}
public boolean isCutoff(){
return cutoff;
}
public void setCutoff(boolean cutoff) {
this.cutoff = cutoff;
}
}

View File

@@ -0,0 +1,226 @@
package matrix.nimble.edp.tools.model;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.edp.cutoff.model.Allocation;
import matrix.nimble.edp.cutoff.model.CutOffRecord;
import matrix.nimble.edp.cutoff.model.Telesheet;
import matrix.nimble.edp.output.model.ReportOutput;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class CutoffPending
{
private List<CutOffPRecord> pendinglist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CutOffPRecord.class));
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private String SessUUID;
private boolean ProcessFlag;
public List<CutOffPRecord> getPendinglist()
{
return pendinglist;
}
public void setPendinglist(List<CutOffPRecord> pendinglist)
{
this.pendinglist = pendinglist;
}
public String getErrMsg()
{
return ErrMsg;
}
public void setErrMsg(String errMsg)
{
ErrMsg = errMsg;
}
public String getErrDesc()
{
return ErrDesc;
}
public void setErrDesc(String errDesc)
{
ErrDesc = errDesc;
}
public String getErrCode()
{
return ErrCode;
}
public void setErrCode(String errCode)
{
ErrCode = errCode;
}
public String getSessUUID()
{
return SessUUID;
}
public void setSessUUID(String sessUUID)
{
SessUUID = sessUUID;
}
public boolean isProcessFlag()
{
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag)
{
ProcessFlag = processFlag;
}
public CutoffPending getPList(String CompanyId,String BranchId,String UserId)
{
CutoffPending CPList=new CutoffPending();
StringFunctions StrFunc=new StringFunctions(getErrCode());
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String [] Vals=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData=DBF.FetchRunQuery(49, Vals); //Generating list of portfolios those telesheet to be generated
String [] Vals1=(CompanyId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData1=DBF.FetchRunQuery(50, Vals1); //Generating sublist records
if(DBF.isProcessFlag())
{
String [][] PListData=StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffPRecord> Record=new ArrayList<CutOffPRecord>();
for(int RecCount=0;RecCount<PListData.length;RecCount++)
{
DBF.setProcessFlag(true);
CutOffPRecord CORec=new CutOffPRecord();
CORec.setCutofftime(PListData[RecCount][0]);
CORec.setTotal(Integer.parseInt(PListData[RecCount][1]));
CORec.setAllocation(false);
CORec.setTelesheet(false);
CORec.setEarlier(false);
CORec.setNegative(false);
CORec.setCutoff(false);
if(DBF.isProcessFlag())
{
String [][] SubListData=StrFunc.ConverTo2DArray(ResultData1, GlobalClass.RowDelim, GlobalClass.ColDelim);
ArrayList<CutOffPRecord> SubRecord=new ArrayList<CutOffPRecord>();
for(int ListCount=0;ListCount<SubListData.length;ListCount++)
{
if(!SubListData[ListCount][3].equals(CORec.getCutofftime()))
{
continue;
}
CutOffPRecord SCORec=new CutOffPRecord();
SCORec.setUuid(SubListData[ListCount][0]);
SCORec.setPortfolio(SubListData[ListCount][1]);
SCORec.setCustomername(SubListData[ListCount][2]);
SCORec.setAllocation(false);
SCORec.setTelesheet(false);
SCORec.setEarlier(false);
SCORec.setNegative(false);
SCORec.setCutoff(false);
SubRecord.add(SCORec);
}
CORec.setPendingsublist(SubRecord);
}
Record.add(CORec);
}
CPList.setPendinglist(Record);
CPList.setSessUUID(getSessUUID());
CPList.setErrCode(getErrCode());
}
else
{
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
CPList.setErrDesc(DBF.getErrDesc());
CPList.setErrMsg(DBF.getErrMsg());
CPList.setErrCode(getErrCode());
}
return CPList;
}
public void FinalizeCutoffPending(String UserId,String CompanyId,String BranchId,CutoffPending CPend)
{
setProcessFlag(true);
int TotBatchSuccess=0;
int TotBatchFailed=0;
int TotEntitySuccess=0;
int TotEntityFailed=0;
String entityFailedMsg="";
String batchFailedMsg="Failed Batches: ";
String msg="";
String Query="";
String Temp="";
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
int PDList=CPend.getPendinglist().size();
for(int LIndx=0;LIndx<PDList;LIndx++)
{
CutOffPRecord MRec=CPend.getPendinglist().get(LIndx);
if(MRec.isCutoff())
{
DBF.setProcessFlag(true);
Query="";
Query=Query+""+GlobalClass.ColDelim;
Query=Query+""+MRec.getCutofftime()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isAllocation()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isTelesheet()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isEarlier()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isNegative()+""+GlobalClass.ColDelim;
Query=Query+""+MRec.isCutoff()+""+GlobalClass.ColDelim;
Query=Query+"1"+GlobalClass.ColDelim;
Temp=DBF.FetchRunQuery(51, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
TotBatchSuccess++;
}
else
{
TotBatchFailed++;
entityFailedMsg+="<br/>Type: Batch Cutoff Batch Time: "+MRec.getCutofftime()+" ("+MRec.getTotal()+")";
}
continue;
}
int SBList=MRec.getPendingsublist().size();
for(int SIndx=0;SIndx<SBList;SIndx++)
{
CutOffPRecord SRec=MRec.getPendingsublist().get(SIndx);
DBF.setProcessFlag(true);
Query="";
Query=Query+""+SRec.getUuid()+""+GlobalClass.ColDelim;
Query=Query+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isAllocation()+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isTelesheet()+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isEarlier()+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isNegative()+""+GlobalClass.ColDelim;
Query=Query+""+SRec.isCutoff()+""+GlobalClass.ColDelim;
Query=Query+"0"+GlobalClass.ColDelim;
Temp=DBF.FetchRunQuery(51, Query.split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
TotEntitySuccess++;
}
else
{
TotEntityFailed++;
entityFailedMsg+="<tr><td>Entity</td><td>"+SRec.getUuid()+"</td></tr>";
}
}
}
if(TotEntityFailed <= 0)
{
CPend.setErrMsg(CPend.getErrCode()+"CPFAIL:Info:Cutoff Pending Successfully...<br/><span align=center>Total Success Entities ("+TotEntitySuccess+") Total Success Batches ("+TotBatchSuccess+")</span>");
}
else
{
msg="<tr><td>Total Failed Entities ("+TotEntityFailed+")</td><td> Total Failed Batches ("+TotBatchFailed+")</td></tr><tr><td>Type</td><td>UUID</td></tr>"+entityFailedMsg;
CPend.setErrMsg(CPend.getErrCode()+"CPFAIL:Error:<table><tr><td>Cutoff Pending Failed </td></tr>"+msg+"</table>");
}
}
}

View File

@@ -0,0 +1,203 @@
package matrix.nimble.edp.tools.model;
public class DelCaseDetails {
private String Portfolio;
private String CaseId;
private String PortfolioId;
private String BankBranchId;
private String MvCode;
private String ApplNo;
private String BankCode;
private String CustomerName;
private String CustomerType;
private String Product;
private boolean Rvr;
private boolean Ovr;
private boolean Pvr;
private boolean Rtvr;
private boolean Otvr;
private boolean Refvr;
private boolean Docvr;
private String ReceiveDate;
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String UUID;
public String getUUID() {
return UUID;
}
public void setUUID(String uUID) {
UUID = uUID;
}
private String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
private void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getMvCode() {
return MvCode;
}
public void setMvCode(String mvCode) {
MvCode = mvCode;
}
public String getPortfolio() {
return Portfolio;
}
public void setPortfolio(String portfolio) {
Portfolio = portfolio;
}
public String getCaseId() {
return CaseId;
}
public void setCaseId(String caseId) {
CaseId = caseId;
}
public String getPortfolioId() {
return PortfolioId;
}
public void setPortfolioId(String portfolioId) {
PortfolioId = portfolioId;
}
public String getBankBranchId() {
return BankBranchId;
}
public void setBankBranchId(String bankBranchId) {
BankBranchId = bankBranchId;
}
public String getApplNo() {
return ApplNo;
}
public void setApplNo(String applNo) {
ApplNo = applNo;
}
public String getBankCode() {
return BankCode;
}
public void setBankCode(String bankCode) {
BankCode = bankCode;
}
public String getCustomerName() {
return CustomerName;
}
public void setCustomerName(String customerName) {
CustomerName = customerName;
}
public String getCustomerType() {
return CustomerType;
}
public void setCustomerType(String customerType) {
CustomerType = customerType;
}
public String getProduct() {
return Product;
}
public void setProduct(String product) {
Product = product;
}
public boolean isRvr() {
return Rvr;
}
public void setRvr(boolean rvr) {
Rvr = rvr;
}
public boolean isOvr() {
return Ovr;
}
public void setOvr(boolean ovr) {
Ovr = ovr;
}
public boolean isPvr() {
return Pvr;
}
public void setPvr(boolean pvr) {
Pvr = pvr;
}
public boolean isRtvr() {
return Rtvr;
}
public void setRtvr(boolean rtvr) {
Rtvr = rtvr;
}
public boolean isOtvr() {
return Otvr;
}
public void setOtvr(boolean otvr) {
Otvr = otvr;
}
public boolean isRefvr() {
return Refvr;
}
public void setRefvr(boolean refvr) {
Refvr = refvr;
}
public boolean isDocvr() {
return Docvr;
}
public void setDocvr(boolean docvr) {
Docvr = docvr;
}
public String getReceiveDate() {
return ReceiveDate;
}
public void setReceiveDate(String receiveDate) {
ReceiveDate = receiveDate;
}
}

View File

@@ -0,0 +1,78 @@
package matrix.nimble.edp.tools.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class DelCaseGrid {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String PortfolioId;
private String CaseID;
private String DelStat;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getPortfolioId() {
return PortfolioId;
}
public void setPortfolioId(String portfolioId) {
PortfolioId = portfolioId;
}
public String getCaseID() {
return CaseID;
}
public void setCaseID(String caseID) {
CaseID = caseID;
}
public String getDelStat() {
return DelStat;
}
public void setDelStat(String delStat) {
DelStat = delStat;
}
public String[][] FillCaseList(String PortfolioID,String CompBranchId)
{
String [][]CaseList=null;
DBFunctions DBF=new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String ResultData=DBF.FetchRunQuery(52, (PortfolioID+GlobalClass.ColDelim+CompBranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
setProcessFlag(DBF.isProcessFlag());
CaseList=new StringFunctions(getErrCode()).ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
}
else
{
setProcessFlag(false);
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
}
return CaseList;
}
}

View File

@@ -0,0 +1,121 @@
package matrix.nimble.edp.tools.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
public class EdpToolsHandler {
String ErrMsg;
String ErrCode;
String ErrDesc;
boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String[][] getAllOptionValues(AddEditProduct addEditProduct){
String [][] optionvalues=null;
addEditProduct.setErrCode(getErrCode());
DBFunctions dbFunc=new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
dbFunc.FetchRunQuery(480, new String[] {""});
if(dbFunc.isProcessFlag())
{
optionvalues = dbFunc.getResultArray();
addEditProduct.setAlloptionvalues(optionvalues);
}
else
{
setProcessFlag(dbFunc.isProcessFlag());
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
addEditProduct.setProcessFlag(dbFunc.isProcessFlag());
addEditProduct.setErrMsg(dbFunc.getErrMsg());
addEditProduct.setErrDesc(dbFunc.getErrDesc());
}
return optionvalues;
}
public String[][] getMappedProducts(AddEditProduct addEditProduct){
String [][] mappedproducts=null;
addEditProduct.setErrCode(getErrCode());
DBFunctions dbFunc=new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
dbFunc.FetchRunQuery(481, new String[] {addEditProduct.getPortfolio_id()});
if(dbFunc.isProcessFlag())
{
mappedproducts = dbFunc.getResultArray();
addEditProduct.setMappedproducts(mappedproducts);
getAllOptionValues(addEditProduct);
}
else
{
setProcessFlag(dbFunc.isProcessFlag());
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
addEditProduct.setProcessFlag(dbFunc.isProcessFlag());
addEditProduct.setErrMsg(dbFunc.getErrMsg());
addEditProduct.setErrDesc(dbFunc.getErrDesc());
}
return mappedproducts;
}
public void addRemoveProduct(AddEditProduct addEditProduct) {
String procResult = "";
addEditProduct.setErrCode(getErrCode());
DBFunctions dbFunc=new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
dbFunc.FetchRunQuery(482, new String[] {addEditProduct.getData(),addEditProduct.getPortfolio_id(),addEditProduct.getUserid()});
if(dbFunc.isProcessFlag())
{
procResult = dbFunc.getProcResult();
if(procResult.contains("success")){
addEditProduct.setData(null);
addEditProduct.setUserid(null);
addEditProduct.setErrMsg(getErrCode()+":info:All actions are saved successfully");
getMappedProducts(addEditProduct);
getAllOptionValues(addEditProduct);
}else {
addEditProduct.setProcessFlag(false);
addEditProduct.setErrMsg(getErrCode()+":error:"+dbFunc.getErrMsg()+". Unable to save details");
}
}
else
{
addEditProduct.setData(null);
addEditProduct.setUserid(null);
setProcessFlag(dbFunc.isProcessFlag());
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
addEditProduct.setProcessFlag(dbFunc.isProcessFlag());
addEditProduct.setErrMsg(dbFunc.getErrMsg());
addEditProduct.setErrDesc(dbFunc.getErrDesc());
}
}
}

View File

@@ -0,0 +1,39 @@
package matrix.nimble.hr.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import matrix.nimble.hr.model.EmployeeHandler;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class HR {
@RequestMapping(value="empdetform",method=RequestMethod.POST )
public String DateRangeFilter(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
EmployeeHandler EH=new EmployeeHandler();
EH.setProcessFlag(true);
EH.setErrCode("7701");
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("formmode",1);
model.addAttribute("citylist",FillCityList(Sessvals.getBranchID()));
model.addAttribute("desiglist",new ModuleFunctions("7701").GetResultArray(340, ("group_id > 2"+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",new ModuleFunctions("7701").GetResultArray(250, (Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","success");
return "hr/employee/empdetails";
}
public String [][] FillCityList(String BranchID)
{
return new ModuleFunctions("1001").GetResultArray(6,BranchID.split(GlobalClass.ColDelim));
}
}

View File

@@ -0,0 +1,47 @@
package matrix.nimble.hr.model;
import matrix.nimble.utilities.DBFunctions;
public class EmployeeHandler {
String ErrMsg;
String ErrCode;
String ErrDesc;
boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getEmployees(String[] Qvals)
{
return "";
}
public String updateEmployee(int Qid, String[] Qvals)
{
return "";
}
}

View File

@@ -0,0 +1,488 @@
package matrix.nimble.mis.controller;
import java.lang.reflect.Array;
import java.util.Arrays;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import matrix.nimble.mis.model.Filters;
import matrix.nimble.mis.model.MISHandler;
import matrix.nimble.model.Session;
import matrix.nimble.utilities.GlobalClass;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class MIS {
@RequestMapping(value="datetimerange",method=RequestMethod.POST )
public String DateRangeFilter(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5101");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMtype(request.getParameter("pageval").split("!SPLT!")[2]);
filter.setMis(request.getParameter("pageval").split("!SPLT!")[3]);
MH.DateTimeFilter(filter);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="dtimeuser",method=RequestMethod.POST )
public String DateTimeUser(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5101");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMtype(request.getParameter("pageval").split("!SPLT!")[2]);
filter.setMis(request.getParameter("pageval").split("!SPLT!")[3]);
MH.DateTimeUserFilter(filter,Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="usercases",method=RequestMethod.POST )
public String NewMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5101");
Filters filter=new Filters();
filter.setTitle("Userwise Case Tracker");
filter.setQid(444);
filter.setMtype("newmis");
filter.setMis("");
MH.NewMISFilter(filter,Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="newmis",method=RequestMethod.POST )
public String GenNewMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5101");
String [] Qvals=(filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getMtype()+GlobalClass.ColDelim+filter.getUserid()+GlobalClass.ColDelim+filter.getSearchby()+GlobalClass.ColDelim+filter.getVerifierid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="dtmis",method=RequestMethod.POST )
public String DateRangeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5101");
String [] Qvals=(filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getMtype()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="dtusermis",method=RequestMethod.POST )
public String DateRangeUserMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5101");
String [] Qvals=(filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getMtype()+GlobalClass.ColDelim+filter.getUserid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="portdtrange",method=RequestMethod.POST )
public String PortDateTimeRangeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5102");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.PortDateTimeFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="portdaterange",method=RequestMethod.POST )
public String PortDateRangeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5102");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.PortDateRangeFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="pdtmis",method=RequestMethod.POST )
public String PortDateRangeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5101");
String [] Qvals=(filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+filter.getPortfolioid()+GlobalClass.ColDelim+filter.getBkbranchid()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getMtype()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="portdtoptrange",method=RequestMethod.POST )
public String PortDateOptRangeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5109");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.PortDateOptTimeFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="pdtomis",method=RequestMethod.POST )
public String PortDateOptRangeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5109");
String [] Qvals=(filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+filter.getPortfolioid()+GlobalClass.ColDelim+filter.getBkbranchid()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getSearchby()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="portver",method=RequestMethod.POST )
public String PortVerifierMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5103");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.PortVerifierFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="portverdtrange",method=RequestMethod.POST )
public String PortWiseVisitFilter(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5103");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.PortVerifierDTFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="pvfdttdtrange",method=RequestMethod.POST )
public String PVFdtTdtFilter(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5103");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.PortVerDTRangeFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="pvdtvismis",method=RequestMethod.POST )
public String PortwiseVisitMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5103");
String [] Qvals=(filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+filter.getPortfolioid()+GlobalClass.ColDelim+filter.getVerifierid()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getMtype()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="pvermis",method=RequestMethod.POST )
public String PortVerifierMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5103");
String [] Qvals=(filter.getPortfolioid()+GlobalClass.ColDelim+filter.getVerifierid()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getMtype()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="portbranch",method=RequestMethod.POST )
public String PortBranchMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5104");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.PortBranchFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="portbmis",method=RequestMethod.POST )
public String PortBranchMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5105");
String [] Qvals=(filter.getPortfolioid()+GlobalClass.ColDelim+filter.getBkbranchid()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getMtype()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="basicpudtrange",method=RequestMethod.POST )
public String BasicPortUsrDTMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5106");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.BasicPortUsrDTFilter(filter, Sessvals.getBranchID(),Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[3]));
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="basicpvdtrange",method=RequestMethod.POST )
public String BasicPortVerDTMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5107");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.BasicPortVerDTFilter(filter, Sessvals.getBranchID(),Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[3]));
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
/*@RequestMapping(value="basicpdtrange",method=RequestMethod.POST )
public String BasicPortDTMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5108");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
filter.setUserid(Sessvals.getUserID());
MH.BasicPortDTFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}*/
@RequestMapping(value="bpdtmis",method=RequestMethod.POST )
public String BasicPortDTMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5109");
String [] Qvals=(filter.getPortfolioid()+GlobalClass.ColDelim+filter.getUserid()+GlobalClass.ColDelim+filter.getMvcode()+GlobalClass.ColDelim+filter.getApplno()+GlobalClass.ColDelim+filter.getName()+GlobalClass.ColDelim+filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="bpvtovdtmis",method=RequestMethod.POST )
public String BasicVtoVDTMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5110");
String [] Qvals=(filter.getPortfolioid()+GlobalClass.ColDelim+filter.getUserid()+GlobalClass.ColDelim+filter.getVerifierid()+GlobalClass.ColDelim+filter.getMvcode()+GlobalClass.ColDelim+filter.getApplno()+GlobalClass.ColDelim+filter.getName()+GlobalClass.ColDelim+filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="posvdtrange",method=RequestMethod.POST )
public String POVSDTRange(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5119");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
filter.setUserid(Sessvals.getUserID());
MH.POSVDTFilter(filter, Sessvals.getBranchID(),Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[3]));
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="posvdtmis",method=RequestMethod.POST )
public String POSVDTMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5119");
String [] Qvals=(filter.getPortfolioid()+GlobalClass.ColDelim+filter.getUserid()+GlobalClass.ColDelim+filter.getVerifierid()+GlobalClass.ColDelim+filter.getMvcode()+GlobalClass.ColDelim+filter.getApplno()+GlobalClass.ColDelim+filter.getName()+GlobalClass.ColDelim+filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="verdtrange",method=RequestMethod.POST )
public String VerDateTime(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5111");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
filter.setUserid(Sessvals.getUserID());
MH.VerDateNTime(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="vdtmis",method=RequestMethod.POST )
public String VerDateTimeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5113");
String [] Qvals=(filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim+filter.getMtype()+GlobalClass.ColDelim+filter.getVerifierid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="verddtrange",method=RequestMethod.POST )
public String VerDateDateTime(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5111");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
filter.setUserid(Sessvals.getUserID());
MH.VerifierDDTFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="vddtmis",method=RequestMethod.POST )
public String VerDateDateTimeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5113");
String delim = GlobalClass.ColDelim;
String [] Qvals=(filter.getFromdate()+delim+filter.getTodate()+delim+filter.getTime()+delim+Sessvals.getBranchID()+delim+filter.getTitle()+delim+Sessvals.getBranchName()+delim+Sessvals.getCompanyName().toUpperCase()+delim+filter.getVerifierid()+delim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="oprdtrange",method=RequestMethod.POST )
public String OprDateTime(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5112");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
filter.setUserid(Sessvals.getUserID());
MH.OprDateNTime(filter, Sessvals.getBranchID(),request.getParameter("pageval").split("!SPLT!")[3], Sessvals.getUserID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="opdtmis",method=RequestMethod.POST )
public String OprDateTimeMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="filter") Filters filter,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5114");
String [] Qvals=(filter.getFromdate()+GlobalClass.ColDelim+filter.getTodate()+GlobalClass.ColDelim+filter.getUserid()+GlobalClass.ColDelim+Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
@RequestMapping(value="pvervisdtrange",method=RequestMethod.POST )
public String PortVerVisitDTRange(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5115");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
filter.setMis(request.getParameter("pageval").split("!SPLT!")[2]);
MH.PortVerVisitDTFilter(filter, Sessvals.getBranchID());
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/filter";
}
@RequestMapping(value="nofiltermis",method=RequestMethod.POST )
public String NoFilterMIS(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
MISHandler MH=new MISHandler();
MH.setProcessFlag(true);
MH.setErrCode("5101");
Filters filter=new Filters();
filter.setTitle(request.getParameter("pageval").split("!SPLT!")[0]);
filter.setQid(Integer.parseInt(request.getParameter("pageval").split("!SPLT!")[1]));
String [] Qvals=(Sessvals.getBranchID()+GlobalClass.ColDelim+filter.getTitle()+GlobalClass.ColDelim+Sessvals.getBranchName()+GlobalClass.ColDelim+Sessvals.getCompanyName().toUpperCase()+GlobalClass.ColDelim).split(GlobalClass.ColDelim);
MH.SimpleMIS(filter,filter.getQid(), Qvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("filter",filter);
model.addAttribute("Sessvals",Sessvals);
return "mis/misreport";
}
}

View File

@@ -0,0 +1,28 @@
package matrix.nimble.mis.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import matrix.nimble.mis.model.MonitoringHandler;
import matrix.nimble.model.Session;
@Controller
@SessionAttributes({"Sessvals"})
public class Monitoring {
@RequestMapping(value="wfhmonitor",method=RequestMethod.POST )
public String WFHMonitor(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
MonitoringHandler mh = new MonitoringHandler();
model.addAttribute("detailshtml",mh.WFHMonitor(new String[] {Sessvals.getUserID(),Sessvals.getUserGroupName()}));
model.addAttribute("Sessvals",Sessvals);
return "mis/wfh";
}
}

View File

@@ -0,0 +1,27 @@
package matrix.nimble.mis.model;
public class Employee {
private String employeename;
private String fathername;
private String dob;
public String getEmployeename() {
return employeename;
}
public void setEmployeename(String employeename) {
this.employeename = employeename;
}
public String getFathername() {
return fathername;
}
public void setFathername(String fathername) {
this.fathername = fathername;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
}

View File

@@ -0,0 +1,121 @@
package matrix.nimble.mis.model;
public class Filters {
private String title;
private int qid;
private String fromdate;
private String todate;
private String time;
private String html;
private String mtype;
private String portfolioid;
private String bkbranchid;
private String mis;
private String verifierid;
private String name;
private String mvcode;
private String applno;
private String userid;
private String searchby;
public Filters()
{
setUserid("0");
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getQid() {
return qid;
}
public void setQid(int qid) {
this.qid = qid;
}
public String getFromdate() {
return fromdate;
}
public void setFromdate(String fromdate) {
this.fromdate = fromdate;
}
public String getTodate() {
return todate;
}
public void setTodate(String todate) {
this.todate = todate;
}
public String getHtml() {
return html;
}
public void setHtml(String html) {
this.html = html;
}
public String getMtype() {
return mtype;
}
public void setMtype(String mtype) {
this.mtype = mtype;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getBkbranchid() {
return bkbranchid;
}
public void setBkbranchid(String bkbranchid) {
this.bkbranchid = bkbranchid;
}
public String getMis() {
return mis;
}
public void setMis(String mis) {
this.mis = mis;
}
public String getVerifierid() {
return verifierid;
}
public void setVerifierid(String verifierid) {
this.verifierid = verifierid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getApplno() {
return applno;
}
public void setApplno(String applno) {
this.applno = applno;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getSearchby() {
return searchby;
}
public void setSearchby(String searchby) {
this.searchby = searchby;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}

View File

@@ -0,0 +1,750 @@
package matrix.nimble.mis.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
public class MISHandler {
String ErrMsg;
String ErrCode;
String ErrDesc;
boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public void SimpleMIS(Filters filter,int Qid,String [] Qvals)
{
DBFunctions dbf=new DBFunctions(getErrCode());
setProcessFlag(true);
dbf.setProcessFlag(true);
dbf.FetchRunQuery(Qid, Qvals);
if(dbf.isProcessFlag())
{
filter.setHtml(dbf.getProcResult());
}
else
{
filter.setHtml(dbf.getErrMsg());
setProcessFlag(dbf.isProcessFlag());
setErrDesc(dbf.getErrDesc());
setErrMsg(dbf.getErrMsg());
}
}
public void DateTimeFilter(Filters filter)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=DateTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"DateRangeMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void PortDateTimeFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3,BranchId,true);
html+=PortBranchControl();
html+=DateTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"PortDateTimeRangeMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void PortDateRangeFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3,BranchId,true);
html+=DateRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"PortFromToDateRangeMIS('"+filter.getMis()+"');\" /><input type=\"hidden\" id=\"bkbranch_id\" value=\"0\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void PortDateOptTimeFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3,BranchId,true);
html+=PortBranchControl();
html+=DateTimeRangeControl();
html+=DateFieldsControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"PortDateOptRangeMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void PortVerifierFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3,BranchId,false);
html+=VerifierControl(95,BranchId);
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"PortVerifierMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void PortVerifierDTFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3, BranchId, false);
html+=VerifierControl(95, BranchId);
html+=FromDateToTimeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"PortwiseVisitMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void PortVerDTRangeFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3, BranchId, false);
html+=VerifierControl(95, BranchId);
html+=MonthTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"MonthlyDetVisitMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void PortVerVisitDTFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3, BranchId, false);
html+=VerifierControl(95, BranchId);
html+=VisitControl();
html+=MonthTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"MonthlyDetVisitMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void PortBranchFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3, BranchId, true);
html+=PortBranchControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"PortBranchMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void BasicPortDTFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3, BranchId, false);
html+=MVCodeControl();
html+=ApplnoControl();
html+=CustomerNameControl();
html+=DateTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"BasicPortDTMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void BasicPortUsrDTFilter(Filters filter,String BranchId,int UQid)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3, BranchId, false);
html+=OperatorControl(UQid, BranchId,"");
html+=MVCodeControl();
html+=ApplnoControl();
html+=CustomerNameControl();
html+=DateTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"BasicPortUsrDTMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void BasicPortVerDTFilter(Filters filter,String BranchId,int vQid)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3, BranchId, false);
html+="<div class=\"widget\">";
html+="<div class=\"lblcontainer\" style=\"width:85px\">From</div>";
html+="<div class=\"inputcontainer\">";
html+="<div class=\"divselect\" id=\"divportfolio\" style=\"width:167px\">";
html+="<select id=\"user_id\" name=\"user_id\" style=\"width:185px\">";
html+="<option value=\"-1\" selected >SELECT</option>";
html+="<option value=\"0\" selected >ALL</option>";
DBFunctions dbf=new DBFunctions(getErrCode());
String [][] ResultArr=null;
dbf.setResultArray(null);
dbf.setProcessFlag(true);
dbf.FetchRunQuery(vQid,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
ResultArr =dbf.getResultArray();
for(int i=0;i<ResultArr.length;i++)
{
html+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
html+="</select></div>";
html+="</div>";
html+="</div>";
html+="<div class=\"widget\">";
html+="<div class=\"lblcontainer\" style=\"width:85px\">To</div>";
html+="<div class=\"inputcontainer\">";
html+="<div class=\"divselect\" id=\"divportfolio\" style=\"width:167px\">";
html+="<select id=\"verifier_id\" name=\"verifier_id\" style=\"width:185px\">";
html+="<option value=\"-1\" selected >SELECT</option>";
html+="<option value=\"0\" selected >ALL</option>";
if(dbf.isProcessFlag())
{
for(int i=0;i<ResultArr.length;i++)
{
html+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
html+="</select></div>";
html+="</div>";
html+="</div>";
html+=MVCodeControl();
html+=ApplnoControl();
html+=CustomerNameControl();
html+=DateTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"BasicPortVerDTMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void VerDateNTime(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=VerifierControl(89, BranchId);
html+=FromDateToTimeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"VerDateNTime('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void VerifierDDTFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=VerifierControl(89, BranchId);
html+=FromToDateNTimeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"VerDDTFilter('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void POSVDTFilter(Filters filter,String BranchId,int UQid)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=PortfolioControl(3, BranchId, false);
html+=VerifierControl(95, BranchId);
html+=OperatorControl(UQid, BranchId, "");
html+=MVCodeControl();
html+=ApplnoControl();
html+=CustomerNameControl();
html+=DateTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"PSOVDTMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
public void OprDateNTime(Filters filter,String BranchId,String userType,String UserId)
{
String html="";
html+=MISTitle(filter.getTitle());
if (userType.equals("opr"))
{
html+="<input type=\"hidden\" id=\"user_id\" name=\"user_id\" value=\""+UserId+"\" >";
}
else
{
filter.setUserid("-1");
html+=OperatorControl(57, BranchId, "onchange=\"$('#userid').val(this.value)\"");
html+="<input type=\"hidden\" id=\"verifier_id\" name=\"verifier_id\" value=\"-1\" >";
}
html+=FromDateToTimeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"VerDateNTime('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
private String VerifierControl(int Qid,String BranchId)
{
String CtrlVerifier="";
CtrlVerifier+="<div class=\"widget\">";
CtrlVerifier+="<div class=\"lblcontainer\" style=\"width:85px\">Verifier</div>";
CtrlVerifier+="<div class=\"inputcontainer\">";
CtrlVerifier+="<div class=\"divselect\" id=\"divbranch\" style=\"width:167px\">";
CtrlVerifier+="<select id=\"verifier_id\" name=\"verifier_id\" style=\"width:185px\" >";
CtrlVerifier+="<option value=\"-1\" selected >SELECT</option>";
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.setResultArray(null);
dbf.FetchRunQuery(Qid,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String [][] ResultArr =dbf.getResultArray();
for(int i=0;i<ResultArr.length;i++)
{
CtrlVerifier+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
CtrlVerifier+="</select></div>";
CtrlVerifier+="</div>";
CtrlVerifier+="</div>";
return CtrlVerifier;
}
private String MISTitle(String Title)
{
String HTMLMISTitle="";
HTMLMISTitle="<div id=\"title\" class=\"title\">";
HTMLMISTitle+="<img id=\"icon\" src=\"/matrix/images/mis.png\" align=\"absmiddle\" />";
HTMLMISTitle+="<span id=\"title\" align=\"absmiddle\">"+Title+"</span>";
HTMLMISTitle+="</div>";
HTMLMISTitle+="<div id=\"FormPanel1\" class=\"FormPanel\">";
HTMLMISTitle+="<table align=\"center\" id=\"FormControls\" width=\"99%\">";
HTMLMISTitle+="<tr><td>";
return HTMLMISTitle;
}
private String OperatorControl(int Qid,String BranchId,String onchange)
{
String CtrlOperator="";
CtrlOperator+="<div class=\"widget\">";
CtrlOperator+="<div class=\"lblcontainer\" style=\"width:85px\">Operator</div>";
CtrlOperator+="<div class=\"inputcontainer\">";
CtrlOperator+="<div class=\"divselect\" id=\"divportfolio\" style=\"width:167px\">";
CtrlOperator+="<select id=\"user_id\" name=\"user_id\" style=\"width:185px\" "+onchange+" >";
CtrlOperator+="<option value=\"-1\" selected >SELECT</option>";
CtrlOperator+="<option value=\"0\" selected >ALL</option>";
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setResultArray(null);
dbf.setProcessFlag(true);
dbf.FetchRunQuery(Qid,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String [][] ResultArr =dbf.getResultArray();
for(int i=0;i<ResultArr.length;i++)
{
CtrlOperator+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
CtrlOperator+="</select></div>";
CtrlOperator+="</div>";
CtrlOperator+="</div>";
return CtrlOperator;
}
private String VisitControl()
{
String CtrlVisit="";
CtrlVisit+="<div class=\"widget\">";
CtrlVisit+="<div class=\"lblcontainer\" style=\"width:85px\">Visit</div>";
CtrlVisit+="<div class=\"inputcontainer\">";
CtrlVisit+="<div class=\"divselect\" id=\"divvisit\" style=\"width:167px\">";
CtrlVisit+="<select id=\"visit\" name=\"visit\" style=\"width:185px\" >";
CtrlVisit+="<option value=\"-1\" selected >ALL</option>";
CtrlVisit+="<option value=\"0\" >RESI-OFFICE</option>";
CtrlVisit+="<option value=\"1\" >RESI-PROPERTY</option>";
CtrlVisit+="<option value=\"2\" >OFFICE-PROPERTY</option>";
CtrlVisit+="</select></div>";
CtrlVisit+="</div>";
CtrlVisit+="</div>";
return CtrlVisit;
}
private String PortfolioControl(int Qid,String BranchId,boolean LoadBranch)
{
String CtrlPortfolio="";
CtrlPortfolio+="<div class=\"widget\">";
CtrlPortfolio+="<div class=\"lblcontainer\" style=\"width:85px\">Portfolio</div>";
CtrlPortfolio+="<div class=\"inputcontainer\">";
CtrlPortfolio+="<div class=\"divselect\" id=\"divportfolio\" style=\"width:167px\">";
CtrlPortfolio+="<select id=\"portfolio_id\" name=\"portfolio_id\" style=\"width:185px\" ";
if (LoadBranch)
{
CtrlPortfolio+="onchange=\"loadbranch(this.value)\">";
}
else
{
CtrlPortfolio+=">";
}
CtrlPortfolio+="<option value=\"-1\" selected >ALL</option>";
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(Qid,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String [][] ResultArr =dbf.getResultArray();
for(int i=0;i<ResultArr.length;i++)
{
CtrlPortfolio+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
CtrlPortfolio+="</select></div>";
CtrlPortfolio+="</div>";
CtrlPortfolio+="</div>";
return CtrlPortfolio;
}
private String PortBranchControl()
{
String CtrlPortBranch="";
CtrlPortBranch+="<div class=\"widget\">";
CtrlPortBranch+="<div class=\"lblcontainer\" style=\"width:85px\">Branch</div>";
CtrlPortBranch+="<div class=\"inputcontainer\">";
CtrlPortBranch+="<div class=\"divselect\" id=\"divbranch\" style=\"width:167px\">";
CtrlPortBranch+="<select id=\"bkbranch_id\" name=\"bkbranch_id\" style=\"width:185px\" >";
CtrlPortBranch+="<option value=\"-1\" selected >SELECT</option>";
CtrlPortBranch+="<option value=\"0\" >ALL</option>";
CtrlPortBranch+="</select></div>";
CtrlPortBranch+="</div>";
CtrlPortBranch+="</div>";
return CtrlPortBranch;
}
private String DateFieldsControl()
{
String CtrlPortBranch="";
CtrlPortBranch+="<div class=\"widget\">";
CtrlPortBranch+="<div class=\"lblcontainer\" style=\"width:85px\">Search By</div>";
CtrlPortBranch+="<div class=\"inputcontainer\">";
CtrlPortBranch+="<div class=\"divselect\" id=\"divbranch\" style=\"width:167px\">";
CtrlPortBranch+="<select id=\"optfields\" name=\"optfields\" style=\"width:185px\" >";
CtrlPortBranch+="<option value=\"addedon\" selected >Received Date</option>";
CtrlPortBranch+="<option value=\"sdoneon\" >Done Date</option>";
CtrlPortBranch+="</select></div>";
CtrlPortBranch+="</div>";
CtrlPortBranch+="</div>";
return CtrlPortBranch;
}
private String MonthTimeRangeControl()
{
String CtrlMTimeRange="";
String frmdate=GlobalClass.ModifiedDateTime("01/MMM/yyyy", new java.util.Date(),0,-1);
java.util.Date dt=GlobalClass.StrToDate(frmdate);
String todate=GlobalClass.ModifiedDateTime("dd/MM/yyyy", dt,-1,1);
frmdate=GlobalClass.DateTime("dd/MM/yyyy", dt);
CtrlMTimeRange+="<div class=\"widget\">";
CtrlMTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>";
CtrlMTimeRange+="<div class=\"inputcontainer\">";
CtrlMTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','DateTime')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Fromdate\" name=\"Fromdate\" value=\""+frmdate+" 00:00:00\" />";
CtrlMTimeRange+="</div>";
CtrlMTimeRange+="</div>";
CtrlMTimeRange+="<div class=\"widget\">";
CtrlMTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>";
CtrlMTimeRange+="<div class=\"inputcontainer\">";
CtrlMTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','DateTime')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Todate\" name=\"Todate\" value=\""+todate+" 23:59:59\" />";
CtrlMTimeRange+="</div>";
CtrlMTimeRange+="</div>";
return CtrlMTimeRange;
}
private String DateTimeRangeControl()
{
String frmdate=GlobalClass.DateTime("dd/MM/yyyy", new java.util.Date());
String CtrlDateTimeRange="";
CtrlDateTimeRange+="<div class=\"widget\">";
CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>";
CtrlDateTimeRange+="<div class=\"inputcontainer\">";
CtrlDateTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','DateTime')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Fromdate\" name=\"Fromdate\" value=\""+(frmdate+" 00:00:00")+"\" />";
CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="<div class=\"widget\">";
CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>";
CtrlDateTimeRange+="<div class=\"inputcontainer\">";
CtrlDateTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','DateTime')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Todate\" name=\"Todate\" value=\""+(frmdate+" 23:59:59")+"\" />";
CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="</div>";
return CtrlDateTimeRange;
}
private String DateRangeControl()
{
String frmdate=GlobalClass.DateTime("dd/MM/yyyy", new java.util.Date());
String CtrlDateTimeRange="";
CtrlDateTimeRange+="<div class=\"widget\">";
CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>";
CtrlDateTimeRange+="<div class=\"inputcontainer\">";
CtrlDateTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','Date')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Fromdate\" name=\"Fromdate\" value=\""+(frmdate)+"\" />";
CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="<div class=\"widget\">";
CtrlDateTimeRange+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>";
CtrlDateTimeRange+="<div class=\"inputcontainer\">";
CtrlDateTimeRange+="<input type=\"text\" onblur=\"validate(this,'t','Date')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Todate\" name=\"Todate\" value=\""+(frmdate)+"\" />";
CtrlDateTimeRange+="</div>";
CtrlDateTimeRange+="</div>";
return CtrlDateTimeRange;
}
private String FromDateToTimeControl()
{
String frmdate=GlobalClass.DateTime("dd/MM/yyyy", new java.util.Date());
String CtrlFrmDtToTime="";
CtrlFrmDtToTime+="<div class=\"widget\">";
CtrlFrmDtToTime+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>";
CtrlFrmDtToTime+="<div class=\"inputcontainer\">";
CtrlFrmDtToTime+="<input type=\"text\" onblur=\"validate(this,'t','Date')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Fromdate\" name=\"Fromdate\" value=\""+frmdate+"\" />";
CtrlFrmDtToTime+="</div>";
CtrlFrmDtToTime+="</div>";
CtrlFrmDtToTime+="<div class=\"widget\">";
CtrlFrmDtToTime+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> To Date</div>";
CtrlFrmDtToTime+="<div class=\"inputcontainer\">";
CtrlFrmDtToTime+="<input type=\"text\" onblur=\"validate(this,'t','TimeMS')\" maxlength=\"8\" id=\"Todate\" name=\"Todate\" value=\"23:59:59\" />";
CtrlFrmDtToTime+="</div>";
CtrlFrmDtToTime+="</div>";
return CtrlFrmDtToTime;
}
private String FromToDateNTimeControl()
{
String frmdate=GlobalClass.DateTime("01/MMM/yyyy", new java.util.Date());
frmdate=GlobalClass.DateTime("dd/MM/yyyy",GlobalClass.StrToDate(frmdate));
String todate=GlobalClass.DateTime("dd/MM/yyyy", new java.util.Date());
String CtrlFrmDtToTime="";
CtrlFrmDtToTime+="<div class=\"widget\">";
CtrlFrmDtToTime+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font> From Date</div>";
CtrlFrmDtToTime+="<div class=\"inputcontainer\">";
CtrlFrmDtToTime+="<input type=\"text\" onblur=\"validate(this,'t','Date')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Fromdate\" name=\"Fromdate\" value=\""+frmdate+"\" />";
CtrlFrmDtToTime+="</div>";
CtrlFrmDtToTime+="</div>";
CtrlFrmDtToTime+="<div class=\"widget\">";
CtrlFrmDtToTime+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font>To Date</div>";
CtrlFrmDtToTime+="<div class=\"inputcontainer\">";
CtrlFrmDtToTime+="<input type=\"text\" onblur=\"validate(this,'t','Date')\" onkeydown=\"return addSlashes(this,event)\" maxlength=\"19\" id=\"Todate\" name=\"Todate\" value=\""+todate+"\" />";
CtrlFrmDtToTime+="</div>";
CtrlFrmDtToTime+="</div>";
CtrlFrmDtToTime+="<div class=\"widget\">";
CtrlFrmDtToTime+="<div class=\"lblcontainer\" style=\"width:85px\"><font color=\"red\">*</font>Time</div>";
CtrlFrmDtToTime+="<div class=\"inputcontainer\">";
CtrlFrmDtToTime+="<input type=\"text\" onblur=\"validate(this,'t','TimeMS')\" maxlength=\"8\" id=\"Time\" name=\"Time\" value=\"23:59:59\" />";
CtrlFrmDtToTime+="</div>";
CtrlFrmDtToTime+="</div>";
return CtrlFrmDtToTime;
}
private String MVCodeControl()
{
String CtrlMVCode="";
CtrlMVCode+="<div class=\"widget\">";
CtrlMVCode+="<div class=\"lblcontainer\" style=\"width:85px\">MV Code</div>";
CtrlMVCode+="<div class=\"inputcontainer\">";
CtrlMVCode+="<input type=\"text\" class=\"textbox\" name=\"mv_code\" id=\"mv_code\" value=\"\" style=\"width:65px;\" onblur=\"validate(this,'f','AlphaNumeric')\" />";
CtrlMVCode+="</div>";
CtrlMVCode+="</div>";
return CtrlMVCode;
}
private String ApplnoControl()
{
String CtrlApplno="";
CtrlApplno="<div class=\"widget\">";
CtrlApplno+="<div class=\"lblcontainer\" style=\"width:85px\">Appl No.</div>";
CtrlApplno+="<div class=\"inputcontainer\">";
CtrlApplno+="<input type=\"text\" class=\"textbox\" name=\"appl_no\" id=\"appl_no\" value=\"\" onblur=\"validate(this,'f','AlphaNumeric')\" />";
CtrlApplno+="</div>";
CtrlApplno+="</div>";
return CtrlApplno;
}
private String CustomerNameControl()
{
String CtrlCustomer="";
CtrlCustomer+="<div class=\"widget\">";
CtrlCustomer+="<div class=\"lblcontainer\" style=\"width:85px\">Name</div>";
CtrlCustomer+="<div class=\"inputcontainer\">";
CtrlCustomer+="<input type=\"text\" class=\"textbox\" name=\"customername\" id=\"customername\" value=\"\" onblur=\"validate(this,'f','AlphaSpace');\" />";
CtrlCustomer+="</div>";
CtrlCustomer+="</div>";
return CtrlCustomer;
}
public void DateTimeUserFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=filter.getMtype().equals("scan") ? UserControl("(group_id=11 or group_id=12)", BranchId, "onchange=\"$('#userid').val(this.value)\"", "Scanner"):"";
html+=DateTimeRangeControl();
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"DateRangeMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
private String UserControl(String cond, String BranchId,String onchange, String title)
{
String CtrlUser="";
CtrlUser+="<div class=\"widget\">";
CtrlUser+="<div class=\"lblcontainer\" style=\"width:85px\">"+title+"</div>";
CtrlUser+="<div class=\"inputcontainer\">";
CtrlUser+="<div class=\"divselect\" id=\"divportfolio\" style=\"width:167px\">";
CtrlUser+="<select id=\"user_id\" name=\"user_id\" style=\"width:185px\" "+onchange+" >";
CtrlUser+="<option value=\"-1\" selected >SELECT</option>";
CtrlUser+="<option value=\"0\" selected >ALL</option>";
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setResultArray(null);
dbf.setProcessFlag(true);
dbf.FetchRunQuery(442,(cond+" and branch_id="+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String [][] ResultArr =dbf.getResultArray();
for(int i=0;i<ResultArr.length;i++)
{
CtrlUser+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
CtrlUser+="</select></div>";
CtrlUser+="</div>";
CtrlUser+="</div>";
return CtrlUser;
}
public void NewMISFilter(Filters filter,String BranchId)
{
String html="";
html+=MISTitle(filter.getTitle());
html+=DateRangeControl();
html+="<div class=\"widget\">";
html+="<div class=\"lblcontainer\" style=\"width:85px\">Operator</div>";
html+="<div class=\"inputcontainer\">";
html+="<div class=\"divselect\" id=\"divportfolio\" style=\"width:167px\">";
html+="<select id=\"user_id\" name=\"user_id\" style=\"width:185px\" onchange=\"$('#scanner').val('-1');$('#verifier_id').val('-1');\" >";
html+="<option value=\"-1\" selected >SELECT</option>";
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setResultArray(null);
dbf.setProcessFlag(true);
dbf.FetchRunQuery(442,("group_id=9 and branch_id="+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String [][] ResultArr =dbf.getResultArray();
for(int i=0;i<ResultArr.length;i++)
{
html+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
html+="</select></div>";
html+="</div>";
html+="</div>";
html+="<div class=\"widget\">";
html+="<div class=\"lblcontainer\" style=\"width:85px\">Scanner</div>";
html+="<div class=\"inputcontainer\">";
html+="<div class=\"divselect\" id=\"divportfolio\" style=\"width:167px\">";
html+="<select id=\"scanner\" name=\"scanner\" style=\"width:185px\" onchange=\"$('#user_id').val('-1');$('#verifier_id').val('-1');\" >";
html+="<option value=\"-1\" selected >SELECT</option>";
dbf=new DBFunctions(getErrCode());
dbf.setResultArray(null);
dbf.setProcessFlag(true);
dbf.FetchRunQuery(442,("(group_id=11 or group_id=12) and branch_id="+BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String [][] ResultArr =dbf.getResultArray();
for(int i=0;i<ResultArr.length;i++)
{
html+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
html+="</select></div>";
html+="</div>";
html+="</div>";
html+="<div class=\"widget\">";
html+="<div class=\"lblcontainer\" style=\"width:85px\">Verifier</div>";
html+="<div class=\"inputcontainer\">";
html+="<div class=\"divselect\" id=\"divportfolio\" style=\"width:167px\">";
html+="<select id=\"verifier_id\" name=\"verifier_id\" style=\"width:185px\" onchange=\"$('#scanner').val('-1');$('#user_id').val('-1');\" >";
html+="<option value=\"-1\" selected >SELECT</option>";
html+="<option value=\"0\" selected >ALL</option>";
dbf=new DBFunctions(getErrCode());
dbf.setResultArray(null);
dbf.setProcessFlag(true);
dbf.FetchRunQuery(250,(BranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String [][] ResultArr =dbf.getResultArray();
for(int i=0;i<ResultArr.length;i++)
{
html+="<option value=\""+ResultArr[i][0]+"\" >"+ResultArr[i][1]+"</option>";
}
}
html+="</select></div>";
html+="</div>";
html+="</div>";
html+="</td></tr>";
html+="<tr><td>";
html+="<input type=\"button\" class=\"button\" name=\"btnok\" style=\"margin-top:5px;float:right\" value=\"OK\" id=\"btnok\" accesskey=\"O\" onclick=\"NewMIS('"+filter.getMis()+"');\" />";
html+="</td></tr>";
html+="</table>";
html+="</div>";
filter.setHtml(html);
}
}

View File

@@ -0,0 +1,50 @@
package matrix.nimble.mis.model;
import matrix.nimble.utilities.DBFunctions;
public class MonitoringHandler {
String ErrMsg;
String ErrCode;
String ErrDesc;
boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String WFHMonitor(String[] qvals)
{
DBFunctions dbf=new DBFunctions(getErrCode());
setProcessFlag(true);
dbf.setProcessFlag(true);
dbf.FetchRunQuery(490, qvals);
if(dbf.isProcessFlag())
{
return dbf.getProcResult();
}
else
{
return dbf.getErrMsg();
}
}
}

View File

@@ -0,0 +1,118 @@
package matrix.nimble.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.FileFunctions;
import matrix.nimble.utilities.StringFunctions;
import matrix.nimble.utilities.GlobalClass;
public class Authenticate {
Session SessVals;
String ErrMsg;
String ErrCode;
boolean ProcessFlag;
DBFunctions DBFunc;
private String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getErrMsg() {
return ErrMsg;
}
private void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public Session AuthenticateLogin(String Loginid,String Password,String realPath)
{
SessVals=new Session();
DBFunc= new DBFunctions(getErrCode());
String RowData=DBFunc.ValidateLogin(Loginid, Password);
if(DBFunc.isProcessFlag())
{
setProcessFlag(true);
setErrMsg(RowData);
SessVals.setUsername(Loginid);
SessVals.setLoginTime(RowData.split(GlobalClass.ColDelim)[0]);
SessVals.setUserID(RowData.split(GlobalClass.ColDelim)[1]);
SessVals.setUserGroupID(RowData.split(GlobalClass.ColDelim)[2]);
SessVals.setUserGroupName(RowData.split(GlobalClass.ColDelim)[3]);
SessVals.setBranchID(RowData.split(GlobalClass.ColDelim)[4]);
SessVals.setBranchName(RowData.split(GlobalClass.ColDelim)[5]);
SessVals.setBranchCode(RowData.split(GlobalClass.ColDelim)[6]);
SessVals.setBranchLocation(RowData.split(GlobalClass.ColDelim)[7]);
SessVals.setCompanyID(RowData.split(GlobalClass.ColDelim)[8]);
SessVals.setCompanyName(RowData.split(GlobalClass.ColDelim)[9]);
SessVals.setCompanyCode(RowData.split(GlobalClass.ColDelim)[10]);
SessVals.setUserDisplayName(RowData.split(GlobalClass.ColDelim)[11]);
RowData=DBFunc.GatherMenuContent(Integer.parseInt(SessVals.getUserGroupID()),Integer.parseInt(SessVals.getUserID()));
if(!DBFunc.isProcessFlag())
{
DBFunc.CreateLogEntry(SessVals.getUserID(), DBFunc.getErrMsg(),DBFunc.getErrDesc(),SessVals.getBranchID());
setProcessFlag(false);
setErrMsg(DBFunc.getErrMsg());
}
else
{
StringFunctions StrFunc=new StringFunctions(getErrCode());
String MenuItems[][]=StrFunc.ConverTo2DArray(RowData, GlobalClass.RowDelim, GlobalClass.ColDelim);
if(StrFunc.isProcessFlag())
{
CreateUserMenu(MenuItems,SessVals.getUserID(),realPath);
}
else
{
setProcessFlag(false);
setErrMsg(StrFunc.getErrMsg());
}
}
}
else
{
DBFunc.setProcessFlag(true);
DBFunc.CreateLogEntry("0", DBFunc.getErrMsg(),DBFunc.getErrDesc(),"0");
setProcessFlag(false);
setErrMsg(RowData);
}
return SessVals;
}
private void CreateUserMenu(String [][] menuContent,String UserID,String MenuFilePath)
{
String MenuHTML="<div style='overflow:visible' id='MenuBar'><form method='post' name='MenuForm' id='MenuForm'><input type='hidden' id='pageval' name='pageval' value='' /><ul id='master_0'><li><a rel='nofollow' style='cursor:pointer' onclick=\"SubmitForm('logout','_parent','MenuForm')\">Logout</a></li><li><a rel='nofollow' style='cursor:pointer' onclick=\"SubmitForm('dashboard','_parent','MenuForm')\">Dashboard</a></li></ul></form></div>";
for(int RowIndx=0;RowIndx<menuContent.length;RowIndx++)
{
MenuHTML=GenerateMenuItem(MenuHTML, menuContent[RowIndx][3], menuContent[RowIndx][2], menuContent[RowIndx][1], menuContent[RowIndx][0],menuContent[RowIndx][6].trim(),menuContent[RowIndx][7].trim());
}
CreateUserMenuFile(MenuHTML, MenuFilePath,"menu_"+UserID+".html");
}
private String GenerateMenuItem(String MenuHTML,String ParentID,String PageURL,String MenuItemName,String MenuItemID,String TargetWindow,String RequestVal)
{
MenuHTML=MenuHTML.replace("<ul id='master_"+ParentID+"'>","<ul id='master_"+ParentID+"'><li><a rel='nofollow' style='cursor:pointer' onclick=\"SubmitMenuCommand('"+PageURL+"','"+TargetWindow+"','MenuForm','"+RequestVal+"')\">"+MenuItemName+"</a><ul id='master_"+MenuItemID+"'></ul></li>");
return MenuHTML;
}
private void CreateUserMenuFile(String MenuHTML,String filePath,String fileName)
{
FileFunctions Ffunc=new FileFunctions(getErrCode());
try
{
Ffunc.WriteFile(MenuHTML,filePath,fileName);
}catch(Exception e)
{
setErrMsg(getErrCode()+"CRMNU:Error:User menu file creation failed. Please check you have permission to access the target location.");
setProcessFlag(false);
}
}
}

View File

@@ -0,0 +1,131 @@
package matrix.nimble.model;
import org.springframework.web.multipart.MultipartFile;
public class DownloadUploadSettings {
private String [][] filelist;
private String portfolioid;
private String url;
private String updateurl;
private String urltype;
private String queryid;
private String domainname;
private String serverip;
private String downloadkey;
private String key;
private String key1;
private String urlkey;
private String method;
private String tpquery;
private MultipartFile file;
private int limit;
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUpdateurl() {
return updateurl;
}
public void setUpdateurl(String updateurl) {
this.updateurl = updateurl;
}
public String getUrltype() {
return urltype;
}
public void setUrltype(String urltype) {
this.urltype = urltype;
}
public String getQueryid() {
return queryid;
}
public void setQueryid(String queryid) {
this.queryid = queryid;
}
public String getDomainname() {
return domainname;
}
public void setDomainname(String domainname) {
this.domainname = domainname;
}
public String getServerip() {
return serverip;
}
public void setServerip(String serverip) {
this.serverip = serverip;
}
public String getDownloadkey() {
return downloadkey;
}
public void setDownloadkey(String downloadkey) {
this.downloadkey = downloadkey;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
public String[][] getFilelist() {
return filelist;
}
public void setFilelist(String[][] filelist) {
this.filelist = filelist;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getKey1() {
return key1;
}
public void setKey1(String key1) {
this.key1 = key1;
}
public String getUrlkey() {
return urlkey;
}
public void setUrlkey(String urlkey) {
this.urlkey = urlkey;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getTpquery() {
return tpquery;
}
public void setTpquery(String tpquery) {
this.tpquery = tpquery;
}
public MultipartFile getFile() {
return file;
}
public void setFile(MultipartFile file) {
this.file = file;
}
}

View File

@@ -0,0 +1,78 @@
package matrix.nimble.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
public class GeneralHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public void ChangePassword(LoginKey logkey,String UserId)
{
DBFunctions dbf=new DBFunctions(getErrCode());
ModuleFunctions modf=new ModuleFunctions(getErrCode());
dbf.setProcessFlag(true);
setProcessFlag(true);
modf.setProcessFlag(true);
try
{
logkey.setCurpass(modf.encrypt(logkey.getCurpass()));
logkey.setNewpass(modf.encrypt(logkey.getNewpass()));
dbf.FetchRunQuery(164, (logkey.getCurpass()+GlobalClass.ColDelim+logkey.getNewpass()+GlobalClass.ColDelim+GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date())+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
if(dbf.getProcResult().equals("success"))
{
setProcessFlag(true);
setErrMsg(getErrCode()+"CPASS:info:Your password has been changed successfully.");
logkey.setCurpass("");
logkey.setNewpass("");
setErrDesc("");
}
else
{
setProcessFlag(false);
setErrMsg(getErrCode()+"CPASS:Error:"+dbf.getProcResult());
setErrDesc("");
}
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}catch(Exception exce)
{
setProcessFlag(false);
setErrMsg(getErrCode()+"CPASS:Error:Key conversion failed. Please renter your current password.");
setErrDesc(exce.getMessage());
}
}
}

View File

@@ -0,0 +1,35 @@
package matrix.nimble.model;
public class Login {
private String Loginid;
private String Password;
private String ErrMsg;
public Login()
{
setErrMsg("");
}
public Login(String message)
{
setErrMsg(message);
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getLoginid() {
return Loginid;
}
public void setLoginid(String loginid) {
Loginid = loginid;
}
public String getPassword() {
return Password;
}
public void setPassword(String password) {
Password = password;
}
}

View File

@@ -0,0 +1,19 @@
package matrix.nimble.model;
public class LoginKey {
private String curpass;
private String newpass;
public String getCurpass() {
return curpass;
}
public void setCurpass(String curpass) {
this.curpass = curpass;
}
public String getNewpass() {
return newpass;
}
public void setNewpass(String newpass) {
this.newpass = newpass;
}
}

View File

@@ -0,0 +1,84 @@
package matrix.nimble.model;
import java.util.ArrayList;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.EmailFunctions;
import matrix.nimble.utilities.GlobalClass;
public class MailboxHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String GetMails(int qid, String [] Qvals,String docserver)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
String Result=dbf.FetchRunQuery(qid, Qvals);
if(!dbf.isProcessFlag())
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
return getErrMsg()+" Generating mail list failed.";
}
else
{
String [][] ResultArr=dbf.getResultArray();
for(int indx=0;indx<ResultArr.length;indx++)
{
String Temp="";
if(!ResultArr[indx][16].equals("1"))
{
EmailFunctions EF=new EmailFunctions();
EF.setFileList(new ArrayList<String>());
EF.generateFileList(new java.io.File(ResultArr[indx][10]));
java.util.List <String> Filelist=EF.getFileList();
for(int findx=0;findx<Filelist.size();findx++)
{
if(Filelist.get(findx).endsWith(".zip"))
{
continue;
}
Temp=Temp+GlobalClass.ChangeToDocserverPath(Filelist.get(findx),docserver)+"!SPLT!";
}
if(Temp.length()>0)
{
Temp=Temp.substring(0,Temp.length()-6);
}
}
else
{
Temp=GlobalClass.ChangeToDocserverPath(ResultArr[indx][10]+""+(ResultArr[indx][17].replaceAll("/| |:", "_")+".zip"),docserver);
}
Result=Result.replace(ResultArr[indx][10], Temp);
}
return Result;
}
}
}

View File

@@ -0,0 +1,128 @@
package matrix.nimble.model;
public class Session {
private String CompanyID;
private String CompanyName;
private String CompanyCode;
private String BranchID;
private String BranchName;
private String BranchCode;
private String BranchLocation;
private String Username;
private String UserDisplayName;
private String UserID;
private String UserGroupID;
private String UserGroupName;
private String LoginTime;
public String getCompanyID() {
return CompanyID;
}
public void setCompanyID(String companyID) {
CompanyID = companyID;
}
public String getCompanyName() {
return CompanyName;
}
public void setCompanyName(String companyName) {
CompanyName = companyName;
}
public String getCompanyCode() {
return CompanyCode;
}
public void setCompanyCode(String companyCode) {
CompanyCode = companyCode;
}
public String getBranchID() {
return BranchID;
}
public void setBranchID(String branchID) {
BranchID = branchID;
}
public String getBranchName() {
return BranchName;
}
public void setBranchName(String branchName) {
BranchName = branchName;
}
public String getBranchCode() {
return BranchCode;
}
public void setBranchCode(String branchCode) {
BranchCode = branchCode;
}
public String getBranchLocation() {
return BranchLocation;
}
public void setBranchLocation(String branchLocation) {
BranchLocation = branchLocation;
}
public String getUsername() {
return Username;
}
public void setUsername(String username) {
Username = username;
}
public String getUserDisplayName() {
return UserDisplayName;
}
public void setUserDisplayName(String userDisplayName) {
UserDisplayName = userDisplayName;
}
public String getUserID() {
return UserID;
}
public void setUserID(String userID) {
UserID = userID;
}
public String getUserGroupID() {
return UserGroupID;
}
public void setUserGroupID(String userGroupID) {
UserGroupID = userGroupID;
}
public String getUserGroupName() {
return UserGroupName;
}
public void setUserGroupName(String userGroupName) {
UserGroupName = userGroupName;
}
public String getLoginTime() {
return LoginTime;
}
public void setLoginTime(String loginTime) {
LoginTime = loginTime;
}
}

View File

@@ -0,0 +1,710 @@
package matrix.nimble.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.FileFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.MSSQLFunctions;
import matrix.nimble.utilities.ModuleFunctions;
import matrix.nimble.utilities.StringFunctions;
import matrix.nimble.utilities.FTPFunctions;
import matrix.nimble.utilities.TPDBFunctions;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.Date;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class UploadHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public void FetchSettings(DownloadUploadSettings us,int Qid)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(Qid, us.getPortfolioid().split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
ModuleFunctions modF=new ModuleFunctions(getErrCode());
modF.setProcessFlag(true);
String [][] ResultSet=dbf.getResultArray();
us.setUrl(ResultSet[0][1]);
us.setUpdateurl(ResultSet[0][2]);
us.setUrltype(ResultSet[0][3]);
us.setQueryid(ResultSet[0][4]);
us.setDomainname(ResultSet[0][5]);
us.setServerip(ResultSet[0][6]);
try
{
us.setKey(modF.encrypt(ResultSet[0][8]));
us.setKey1(modF.encrypt(ResultSet[0][9]));
us.setUrlkey(us.getUpdateurl().replace("&",GlobalClass.ColDelim));
}catch(Exception exce)
{
setProcessFlag(false);
setErrMsg(getErrCode()+"ENCKEY:Error:Key generation failed. Please refresh the page");
}
us.setMethod(ResultSet[0][10]);
us.setTpquery(ResultSet[0][11]);
}
else
{
setProcessFlag(false);
setErrDesc(dbf.getErrDesc());
setErrMsg(dbf.getErrMsg());
}
}
public void FetchFilesToUpload(DownloadUploadSettings us)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(160, us.getPortfolioid().split(GlobalClass.ColDelim));
us.setFilelist(null);
if(dbf.isProcessFlag())
{
String Result[][]=dbf.getResultArray();
for(int rindx=0;rindx<Result.length;rindx++)
{
Result[rindx][8]=GlobalClass.ChangeToDocserverPath(Result[rindx][8]);
}
us.setFilelist(Result);
}
else
{
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
}
public void StartXLXUpload(DownloadUploadSettings us,String UserId,String CompanyId,String BranchId,XSSFWorkbook excelx)
{
String addedon=GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date());
String recdate=GlobalClass.DateTime("yyyy/MM/dd", new java.util.Date());
String [] Qvals = (us.getUpdateurl()+","+CompanyId+","+BranchId+","+addedon+","+recdate).split(",");
XSSFSheet worksheet = excelx.getSheetAt(0);
XSSFRow row=worksheet.getRow(0);
String query="";
int totcase=0;
int failed=0;
for(int tcindx=0;tcindx<Qvals.length-4;tcindx++)
{
if(!Qvals[tcindx].toUpperCase().equals(row.getCell(tcindx).toString().toUpperCase()))
{
setErrMsg(getErrCode()+"INVFL:Error:Invalid file format. Please check the format of excel file you are uploading.");
setProcessFlag(false);
break;
}
setProcessFlag(true);
}
if(isProcessFlag())
{
try
{
FileFunctions FF=new FileFunctions(getErrCode());
FF.setProcessFlag(true);
query=FF.GetQuery(Integer.parseInt(us.getQueryid()));
}catch(Exception exce)
{
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"UPSTA:error:Uploading failed."+getErrDesc());
setProcessFlag(false);
}
DBFunctions DBF=new DBFunctions(getErrCode());
for(int rindx=1;rindx<=worksheet.getLastRowNum();rindx++)
{
String query1=query.split(GlobalClass.ColDelim)[1];
DBF.setProcessFlag(true);
totcase=totcase+1;
row=worksheet.getRow(rindx);
for(int cindx=0;cindx<Qvals.length-4;cindx++)
{
XSSFCell cell=row.getCell(cindx,row.CREATE_NULL_AS_BLANK);
if(DateUtil.isCellDateFormatted(cell))
{
Date date = cell.getDateCellValue();
cell.setCellType(Cell.CELL_TYPE_STRING);
cell.setCellValue(GlobalClass.DateTime("dd/MM/yyyy", date));
}
else
{
cell.setCellType(Cell.CELL_TYPE_STRING);
}
Qvals[cindx]=cell.getStringCellValue().trim();
Qvals[cindx]=Qvals[cindx].replace(","," ");
Qvals[cindx]=Qvals[cindx].replace("\\","/");
Qvals[cindx]=Qvals[cindx].replace("'","''''");
}
if(Qvals[0].length() > 0)
{
String uuid=GlobalClass.GenerateUUID();
query1=DBF.QueryBuilder(query1, Qvals);
query1=query1.replace("<p0rtf0li0_id>", us.getPortfolioid());
query1=query1.replace("<XUuIDX>", uuid);
query1=SplitAddress(query1);
query1=query1+GlobalClass.ColDelim+"X";
query1=query1+GlobalClass.ColDelim+us.getPortfolioid();
query1=query1+GlobalClass.ColDelim+uuid;
query1=query1+GlobalClass.ColDelim+UserId;
query1=query1+GlobalClass.ColDelim+"0";
DBF.FetchRunQuery(16, query1.split(GlobalClass.ColDelim));
if(!DBF.isProcessFlag())
{
failed=failed+1;
}
}
}
if(failed > 0)
{
setErrMsg(getErrCode()+"UPLFL:Error:Upload for one or more records failed. "+(totcase-failed)+"/"+totcase+" uploaded successfully.");
setProcessFlag(false);
}
else
{
setErrMsg(getErrCode()+"UPLFL:Info: "+totcase+" cases uploaded successfully.");
setProcessFlag(true);
}
}
}
public void StartXLUpload(DownloadUploadSettings us,String UserId,String CompanyId,String BranchId,HSSFWorkbook excel)
{
String addedon=GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date());
String recdate=GlobalClass.DateTime("yyyy/MM/dd", new java.util.Date());
String [] Qvals = (us.getUpdateurl()+","+CompanyId+","+BranchId+","+addedon+","+recdate).split(",");
HSSFSheet worksheet = excel.getSheetAt(0);
HSSFRow row=worksheet.getRow(0);
String query="";
int totcase=0;
int failed=0;
for(int tcindx=0;tcindx<Qvals.length-4;tcindx++)
{
if(!Qvals[tcindx].toUpperCase().equals(row.getCell(tcindx).toString().toUpperCase()))
{
setErrMsg(getErrCode()+"INVFL:Error:Invalid file format. Please check the format of excel file you are uploading.");
setProcessFlag(false);
break;
}
setProcessFlag(true);
}
if(isProcessFlag())
{
try
{
FileFunctions FF=new FileFunctions(getErrCode());
FF.setProcessFlag(true);
query=FF.GetQuery(Integer.parseInt(us.getQueryid()));
}catch(Exception exce)
{
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"UPSTA:error:Uploading failed."+getErrDesc());
setProcessFlag(false);
}
DBFunctions DBF=new DBFunctions(getErrCode());
for(int rindx=1;rindx<=worksheet.getLastRowNum();rindx++)
{
String query1=query.split(GlobalClass.ColDelim)[1];
DBF.setProcessFlag(true);
totcase=totcase+1;
row=worksheet.getRow(rindx);
for(int cindx=0;cindx<Qvals.length-4;cindx++)
{
HSSFCell cell=row.getCell(cindx,row.CREATE_NULL_AS_BLANK);
if(cell.getCellType()==Cell.CELL_TYPE_NUMERIC && DateUtil.isCellDateFormatted(cell))
{
Date date = cell.getDateCellValue();
cell.setCellType(Cell.CELL_TYPE_STRING);
cell.setCellValue(GlobalClass.DateTime("dd/MM/yyyy", date));
}
else
{
cell.setCellType(Cell.CELL_TYPE_STRING);
}
Qvals[cindx]=cell.getStringCellValue().trim();
Qvals[cindx]=Qvals[cindx].replace(","," ");
Qvals[cindx]=Qvals[cindx].replace("\\","/");
Qvals[cindx]=Qvals[cindx].replace("'","''''");
}
if(Qvals[0].length() > 0)
{
String uuid=GlobalClass.GenerateUUID();
query1=DBF.QueryBuilder(query1, Qvals);
query1=query1.replace("<p0rtf0li0_id>", us.getPortfolioid());
query1=query1.replace("<XUuIDX>", uuid);
query1=SplitAddress(query1);
query1=query1+GlobalClass.ColDelim+"X";
query1=query1+GlobalClass.ColDelim+us.getPortfolioid();
query1=query1+GlobalClass.ColDelim+uuid;
query1=query1+GlobalClass.ColDelim+UserId;
query1=query1+GlobalClass.ColDelim+"0";
DBF.FetchRunQuery(16, query1.split(GlobalClass.ColDelim));
if(!DBF.isProcessFlag())
{
failed=failed+1;
}
}
}
if(failed > 0)
{
setErrMsg(getErrCode()+"UPLFL:Error:Upload for one or more records failed. "+(totcase-failed)+"/"+totcase+" uploaded successfully.");
setProcessFlag(false);
}
else
{
setErrMsg(getErrCode()+"UPLFL:Info: "+totcase+" cases uploaded successfully.");
setProcessFlag(true);
}
}
}
private String SplitAddress(String record)
{
int charindx=20;
String tempaddr="";
String raddress="";
String oaddress="";
if(record.contains("RadDrXS-"))
{
raddress=record.substring(record.indexOf("RadDrXS-")+8,record.indexOf("-ERadDrX"));
}
if(record.contains("OadDrXS-"))
{
oaddress=record.substring(record.indexOf("OadDrXS-")+8,record.indexOf("-EOadDrX"));
}
if(raddress.length() > 0)
{
if(raddress.length()<=20)
{
}
else
{
while(!(raddress.charAt(charindx)+"").equals(" "))
{
charindx=charindx-1;
}
tempaddr=raddress.substring(0,charindx);
record=record.replace(raddress, tempaddr.trim());
raddress=raddress.replace(tempaddr, "").trim();
if(raddress.length()<=70)
{
record=record.replace("RadDrX1", raddress.trim());
}
else
{
charindx = 70;
while(!(raddress.charAt(charindx)+"").equals(" "))
{
charindx=charindx-1;
}
tempaddr=raddress.substring(0,charindx);
record=record.replace("RadDrX1", tempaddr.trim());
raddress=raddress.replace(tempaddr, "").trim();
record=record.replace("RadDrX2", raddress.trim());
}
}
}
charindx=20;
if(oaddress.length()>0)
{
if(oaddress.length()<=20)
{
}
else
{
while(!(oaddress.charAt(charindx)+"").equals(" "))
{
charindx=charindx-1;
}
tempaddr=oaddress.substring(0,charindx);
record=record.replace(oaddress, tempaddr.trim());
oaddress=oaddress.replace(tempaddr, "").trim();
if(oaddress.length()<=70)
{
record=record.replace("OadDrX1", oaddress.trim());
}
else
{
charindx = 70;
while(!(oaddress.charAt(charindx)+"").equals(" "))
{
charindx=charindx-1;
}
tempaddr=oaddress.substring(0,charindx);
record=record.replace("OadDrX1", tempaddr.trim());
oaddress=oaddress.replace(tempaddr, "").trim();
record=record.replace("OadDrX2", oaddress.trim());
}
}
}
record=record.replace("RadDrXS-", "");
record=record.replace("-ERadDrX", "");
record=record.replace("RadDrX1", "");
record=record.replace("RadDrX2", "");
record=record.replace("OadDrXS-", "");
record=record.replace("-EOadDrX", "");
record=record.replace("OadDrX1", "");
record=record.replace("OadDrX2", "");
return record;
}
public void StartUpload(DownloadUploadSettings us,String UserId,String CompanyId,String BranchId)
{
int totcase=0;
int totfailed=0;
DBFunctions dbf=new DBFunctions(getErrCode());
StringFunctions strfunc=new StringFunctions(getErrCode());
strfunc.setProcessFlag(true);
dbf.setProcessFlag(true);
String cases=DownloadCases("http://www."+us.getDomainname()+(dbf.QueryBuilder(us.getUrl(), (us.getDownloadkey()+GlobalClass.ColDelim+us.getPortfolioid()+GlobalClass.ColDelim+us.getLimit()+GlobalClass.ColDelim).split(GlobalClass.ColDelim))));
if(cases.contains("<col>") && isProcessFlag())
{
cases=cases.replace("'", "''");
cases=cases.replace("\\", "/");
cases=cases.replace("\"", "''");
String [][] Records=strfunc.ConverTo2DArray(cases, "<row>", "<col>");
totcase=totcase+Records.length;
for(int indx=0;indx<Records.length;indx++)
{
String UUID=GlobalClass.GenerateUUID();
String Values="insert into main(portfolio_id,mvcode,bank_branch_id,applno,product,loanamount,";
Values=Values+"customername,apptype,category,dob,contactperson,mobileno,raddr1,";
Values=Values+"raddr2,raddr3,rlandmark,Rcolony,rcity,rpincode,rphone,companyname,";
Values=Values+"oaddr1,oaddr2,oaddr3,olandmark,Ocolony,ocity,opincode,department,";
Values=Values+"designation,ophone,extension,paddr1,paddr2,paddr3,plandmark,Pcolony,";
Values=Values+"pcity,ppincode,refname1,refaddress1,refcontactno1,refname2,";
Values=Values+"refaddress2,refcontactno2,rv,rtv,ov,otv,pv,refv,docv,rco,rcp,ocp,";
Values=Values+"specialinst,sradd,soadd,spadd,fathername,field1,field2,field3,field4,field5,field6,onlinecaseid,dtfield1,";
Values=Values+"bankcode,company_id,branch_id,addedby,addedon,receivedate,uuid) values (";
Values=Values+""+us.getPortfolioid()+",''xmvcodex'',"+Records[indx][2];
Values=Values+",''"+Records[indx][3]+"''";
Values=Values+",''"+(Records[indx][4].equals("0") ? "-1" : Records[indx][4]) +"''";
Values=Values+",''"+Records[indx][5]+"''";
Values=Values+",''"+Records[indx][6]+"''";
Values=Values+",''"+(Records[indx][7].equals("0") ? "-1" : strfunc.ToTitleCase(Records[indx][7])) +"''";
Values=Values+",''"+(Records[indx][8].equals("0") ? "-1" : strfunc.ToTitleCase(Records[indx][8])) +"''";
Values=Values+",''"+Records[indx][9]+"''";
Values=Values+",''"+Records[indx][10]+"''";
Values=Values+",''"+Records[indx][11]+"''";
Values=Values+",''"+Records[indx][12]+"''";
Values=Values+",''"+Records[indx][13]+"''";
Values=Values+",''"+Records[indx][14]+"''";
Values=Values+",''"+Records[indx][15]+"''";
Values=Values+","+Records[indx][16];
Values=Values+",''"+(Records[indx][17].equals("0") ? "-1" : strfunc.ToTitleCase(Records[indx][17])) +"''";
Values=Values+",''"+Records[indx][18]+"''";
Values=Values+",''"+Records[indx][19]+(Records[indx][20].length() > 5 ? ("/"+Records[indx][20]+"''") : "''");
Values=Values+",''"+Records[indx][21]+"''";
Values=Values+",''"+Records[indx][22]+"''";
Values=Values+",''"+Records[indx][23]+"''";
Values=Values+",''"+Records[indx][24]+"''";
Values=Values+",''"+Records[indx][25]+"''";
Values=Values+","+Records[indx][26];
Values=Values+",''"+(Records[indx][27].equals("0") ? "-1" : strfunc.ToTitleCase(Records[indx][27])) +"''";
Values=Values+",''"+Records[indx][28]+"''";
Values=Values+",''"+Records[indx][29]+"''";
Values=Values+",''"+Records[indx][30]+"''";
Values=Values+",''"+Records[indx][31]+"''";
Values=Values+",''"+Records[indx][32]+"''";
Values=Values+",''"+Records[indx][33]+"''";
Values=Values+",''"+Records[indx][34]+"''";
Values=Values+",''"+Records[indx][35]+"''";
Values=Values+",''"+Records[indx][36]+"''";
Values=Values+","+Records[indx][37];
Values=Values+",''"+(Records[indx][38].equals("0") ? "-1" : strfunc.ToTitleCase(Records[indx][38])) +"''";
Values=Values+",''"+Records[indx][39]+"''";
Values=Values+",''"+Records[indx][40]+"''";
Values=Values+",''"+Records[indx][41]+"''";
Values=Values+",''"+Records[indx][42]+"''";
Values=Values+",''"+Records[indx][43]+"''";
Values=Values+",''"+Records[indx][44]+"''";
Values=Values+",''"+Records[indx][45]+"''";
Values=Values+","+Records[indx][46];
Values=Values+","+Records[indx][47];
Values=Values+","+Records[indx][48];
Values=Values+","+Records[indx][49];
Values=Values+","+Records[indx][50];
Values=Values+","+Records[indx][51];
Values=Values+","+Records[indx][52];
Values=Values+","+Records[indx][53];
Values=Values+","+Records[indx][54];
Values=Values+","+Records[indx][55];
Values=Values+",''"+Records[indx][56]+"''";
Values=Values+","+Records[indx][57];
Values=Values+","+Records[indx][58];
Values=Values+","+Records[indx][59];
Values=Values+",''"+Records[indx][62]+"''";
Values=Values+",''"+Records[indx][66]+"''";
Values=Values+",''"+Records[indx][67]+"''";
Values=Values+",''"+Records[indx][69]+"''";
Values=Values+",''"+Records[indx][70]+"''";
Values=Values+",''"+Records[indx][71]+"''";
Values=Values+",''"+Records[indx][73]+"''";
Values=Values+",''"+Records[indx][0]+"''";
Values=Values+",''"+Records[indx][68]+"''";
Values=Values+",''"+Records[indx][63]+"''";
Values=Values+","+CompanyId;
Values=Values+","+BranchId;
Values=Values+",0";
Values=Values+",''"+GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date())+"''";
Values=Values+",''"+GlobalClass.DateTime("yyyy/MM/dd", new java.util.Date())+"''";
Values=Values+",''"+UUID+"'')";
Values=Values+GlobalClass.ColDelim+"X";
Values=Values+GlobalClass.ColDelim+us.getPortfolioid();
Values=Values+GlobalClass.ColDelim+UUID;
Values=Values+GlobalClass.ColDelim+UserId;
Values=Values+GlobalClass.ColDelim+"0";
dbf.setProcessFlag(true);
Values=dbf.FetchRunQuery(Integer.parseInt(us.getQueryid()), Values.split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String status=UpdateStatus("http://www."+us.getDomainname()+(dbf.QueryBuilder(us.getUpdateurl(), (Records[indx][0]+GlobalClass.ColDelim).split(GlobalClass.ColDelim))));
if(status.toUpperCase().contains("UPDATION FAILED"))
{
dbf.setProcessFlag(true);
String Qval="uuid='"+dbf.getProcResult().split(GlobalClass.ColDelim)[2]+"'";
dbf.FetchRunQuery(55, Qval.split(GlobalClass.ColDelim));
totfailed=totfailed+1;
}
setProcessFlag(true);
}
else
{
totfailed=totfailed+1;
}
}
if(Records.length > 0 && totfailed > 0)
{
setProcessFlag(false);
setErrDesc("Downloading failed for one or more cases. Please try again later");
setErrMsg("DWFLD:Error:Case uploading failed for one or more cases. "+(totcase-totfailed)+"/"+totcase+" uploaded successfully");
}
else
{
setProcessFlag(false);
setErrDesc("Process completed successfully");
setErrMsg("DWSCC:info:Process completed successfully."+(totcase-totfailed)+"/"+totcase+" uploaded successfully");
}
}
}
public String UpdateStatus(String StatusURL)
{
String APIResponse="";
try
{
URL url = new URL (StatusURL);
URLConnection conn = url.openConnection();
conn.setDoOutput (true);
OutputStreamWriter wr = new OutputStreamWriter (conn.getOutputStream());
wr.flush();
BufferedReader rd = new BufferedReader (new InputStreamReader (conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null)
{
if(APIResponse.toUpperCase().contains("UPDATION FAILED"))
{
APIResponse = "Updation failed";
break;
}
else
{
APIResponse=APIResponse+line;
}
}
wr.close();
rd.close();
} catch (Exception e)
{
APIResponse = "Updation failed";
setErrDesc(e.getMessage());
setErrMsg(getErrCode()+"UPSTA:error:Updation failed."+getErrDesc());
}
return APIResponse;
}
public String DownloadCases(String DownloadURL)
{
String APIResponse="";
try
{
URL url = new URL (DownloadURL);
URLConnection conn = url.openConnection();
conn.setDoOutput (true);
OutputStreamWriter wr = new OutputStreamWriter (conn.getOutputStream());
wr.flush();
BufferedReader rd = new BufferedReader (new InputStreamReader (conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null)
{
APIResponse = APIResponse +""+line.trim();
}
wr.close();
rd.close();
} catch (Exception e)
{
APIResponse = "Downloading failed";
setProcessFlag(false);
setErrDesc(e.getMessage());
setErrMsg(getErrCode()+"DWSTA:error:Downloading failed."+getErrDesc());
}
return APIResponse.replace("'", "").replace("\\", "/").replace("\"", "");
}
public String UpdateTPReports(String Host,String TargetServer,String Username, String Password, String uuid, String DBName, String Tpquery,String timeStamp,String ocid,String qid,String uid) //Update Reports on Third Party Server
{
setProcessFlag(true);
DBFunctions DBF=new DBFunctions(getErrCode());
ModuleFunctions ModF=new ModuleFunctions(getErrCode());
ModF.setProcessFlag(true);
TPDBFunctions TPDB=null;
String Qval="";
FileFunctions FF=new FileFunctions(getErrCode());
try
{
if (TargetServer.equals("MSSQL"))
{
Username=ModF.decrypt(Username);
Password=ModF.decrypt(Password);
TPDB=new MSSQLFunctions(Host, DBName, Username, Password);
TPDB.setErrCode(getErrCode());
}
if(Integer.parseInt(Tpquery) > 0)
{
String Query=FF.GetQuery(Integer.parseInt(Tpquery));
Query=DBF.QueryBuilder(Query.split(GlobalClass.ColDelim)[1], ocid.split(GlobalClass.ColDelim));
TPDB.ExecuteQuery(Query);
if(!TPDB.isProcessFlag())
{
setErrMsg(TPDB.getErrMsg());
setErrDesc(TPDB.getErrDesc());
setProcessFlag(false);
}
else
{
Qval=TPDB.getResultStr()+GlobalClass.ColDelim;
}
}
}catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"DWSTA:error:Error fetching third party query."+getErrDesc());
}
if(isProcessFlag())
{
Qval= uuid+GlobalClass.ColDelim+timeStamp+GlobalClass.ColDelim+Qval;
DBF.setProcessFlag(true);
DBF.FetchRunQuery(Integer.parseInt(qid), (Qval).split(GlobalClass.ColDelim));
if(DBF.isProcessFlag())
{
TPDB.ExecuteNonQuery(DBF.getProcResult());
if(!TPDB.isProcessFlag())
{
DBF.FetchRunQuery(199, uuid.split(GlobalClass.ColDelim));
setErrMsg(TPDB.getErrMsg());
setErrDesc(TPDB.getErrDesc());
setProcessFlag(TPDB.isProcessFlag());
}
else
{
return "success";
}
}
}
else
{
setErrMsg(DBF.getErrMsg());
setErrDesc(DBF.getErrDesc());
setProcessFlag(DBF.isProcessFlag());
}
return getErrMsg();
}
public String UploadReports(String DomainName,String TargetFullPath,String Username, String Password, String uuid, String SourceFile, String caseid,String timeStamp,String urlKey,String qid,String uid,String Tpquery,String serverip)
{
ModuleFunctions ModF=new ModuleFunctions(getErrCode());
ModF.setProcessFlag(true);
FTPFunctions FTF=new FTPFunctions();
SourceFile = GlobalClass.ChangeToActualPath(SourceFile);
FTF.setErrCode(getErrCode());
FTF.setProcessFlag(true);
FTF.setServer(serverip);
FTF.setUploadpath(TargetFullPath);
urlKey="http://"+DomainName+""+(urlKey.replace(GlobalClass.ColDelim, "&"));
try
{
FTF.setUsername(ModF.decrypt(Username));
FTF.setPassword(ModF.decrypt(Password));
}catch(Exception exce)
{
setErrMsg(getErrCode()+"ERKEY:Error:Error converting key values");
setErrDesc(exce.getMessage());
setProcessFlag(false);
return getErrMsg();
}
FTF.setFilename(SourceFile);
FTF.UploadFile();
if(FTF.isProcessFlag())
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
urlKey=dbf.QueryBuilder(urlKey, (caseid+GlobalClass.ColDelim+timeStamp+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
urlKey=UpdateStatus(urlKey);
if(!urlKey.toUpperCase().contains("UPDATION FAILED"))
{
dbf.FetchRunQuery(Integer.parseInt(qid), (uuid+GlobalClass.ColDelim+timeStamp+GlobalClass.ColDelim+uid+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
setErrMsg("success");
}
else
{
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
setProcessFlag(dbf.isProcessFlag());
}
}
}
else
{
setErrMsg(FTF.getErrMsg());
setErrDesc(FTF.getErrDesc());
setProcessFlag(FTF.isProcessFlag());
}
return getErrMsg();
}
}

View File

@@ -0,0 +1,86 @@
package matrix.nimble.operation.documents.controller;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.model.Session;
import matrix.nimble.operation.documents.model.BankDoc;
import matrix.nimble.operation.documents.model.OprDocumentHandler;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class OprDocuments {
//--> Bank Documents
@RequestMapping(value="bankdoc",method=RequestMethod.POST )
public String BankDocuments(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
model.addAttribute("bdoc",new BankDoc());
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(), "8002"));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("stat",true);
model.addAttribute("msg",null);
model.addAttribute("cid",0);
session.setAttribute("UUID", GlobalClass.GenerateUUID());
return "operation/documents/searchreports";
}
//<--- Bank Documents
//--> Open Report
@RequestMapping(value="openrep",method=RequestMethod.GET )
public String OpenReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@RequestParam String rand,@RequestParam String uuid,@RequestParam String cid)
{
model.addAttribute("bdoc",new BankDoc());
session.setAttribute("UUID", uuid);
model.addAttribute("uuid",uuid);
model.addAttribute("cid",cid);
return "operation/documents/redirect";
}
//<--- Open Report
//--> Search Bank Documents
@RequestMapping(value="searchbrep",method=RequestMethod.POST )
public String SearchReports(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@ModelAttribute(value="dboc") BankDoc bdoc,@RequestHeader Map<String, String> headers)
{
OprDocumentHandler ODH=new OprDocumentHandler();
ODH.setErrCode("8002");
String caseid=request.getParameter("cid");
String uuid=request.getParameter("suuid");
String asub=request.getParameter("asub");
if(!session.getAttribute("UUID").toString().equals(uuid))
{
return "error";
}
String docserver = GlobalClass.DocServer;
for (Map.Entry<String,String> entry : headers.entrySet()) {
System.out.printf("Header '%s' = -%s-", entry.getKey(), entry.getValue());
}
if(!headers.get("host").toString().equals("192.168.10.205:8585")) {
docserver = "http://"+headers.get("host").toString().split(":")[0]+":6543/";
}
model.addAttribute("bdoc",ODH.GetBankDocRecords(bdoc,caseid,docserver));
model.addAttribute("portlist",FillPortList(Sessvals.getBranchID(), "8002"));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("stat",ODH.isProcessFlag());
model.addAttribute("msg",ODH.getErrMsg());
model.addAttribute("cid",Integer.parseInt(caseid));
return "operation/documents/searchreports";
}
//<--- Search Bank Documents
public String[][] FillPortList(String BranchID,String ErrCode)
{
return new ModuleFunctions(ErrCode).GetResultArray(3,(BranchID+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
}

View File

@@ -0,0 +1,47 @@
package matrix.nimble.operation.documents.model;
public class BankDoc {
private String portfolioid;
private String bkbranchid;
private String applno;
private String mvcode;
private String name;
private String [][] bankreports;
public String[][] getBankreports() {
return bankreports;
}
public void setBankreports(String[][] bankreports) {
this.bankreports = bankreports;
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getBkbranchid() {
return bkbranchid;
}
public void setBkbranchid(String bkbranchid) {
this.bkbranchid = bkbranchid;
}
public String getApplno() {
return applno;
}
public void setApplno(String applno) {
this.applno = applno;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,115 @@
package matrix.nimble.operation.documents.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.EmailFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.StringFunctions;
import java.util.ArrayList;
import java.util.List;
public class OprDocumentHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public BankDoc GetBankDocRecords(BankDoc bdoc,String caseid,String docserver)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
StringFunctions strf=new StringFunctions(getErrCode());
String val0="";
if(caseid!=null && !caseid.equals("0"))
{
val0="case_id="+caseid+" and ";
}
else
{
if(bdoc.getMvcode()!=null && bdoc.getMvcode().length() > 0)
{
val0="mvcode='"+strf.RemoveJunkChars(bdoc.getMvcode())+"' and ";
}
else
{
if(bdoc.getApplno()!=null && bdoc.getApplno().length() > 0)
{
val0="applno='"+strf.RemoveJunkChars(bdoc.getApplno())+"' and ";
}
if(bdoc.getPortfolioid()!=null && !bdoc.getPortfolioid().equals("-1"))
{
val0="portfolio_id="+bdoc.getPortfolioid()+" and ";
}
if(bdoc.getBkbranchid()!=null && !bdoc.getBkbranchid().equals("-1"))
{
val0="branch_id="+bdoc.getBkbranchid()+" and ";
}
if(bdoc.getName()!=null && bdoc.getName().length()>0)
{
val0="customername like '%"+strf.RemoveJunkChars(bdoc.getName())+"%' and ";
}
}
}
dbf.FetchRunQuery(126, (val0+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(dbf.isProcessFlag())
{
String [][]ResultSet=dbf.getResultArray();
EmailFunctions efunc=new EmailFunctions();
String documents="";
for(int indx=0;indx<ResultSet.length;indx++)
{
efunc.setFileList(new ArrayList<String>());
efunc.generateFileList(new java.io.File(ResultSet[indx][1]));
List <String> flist=efunc.getFileList();
if(flist.size() > 0)
{
String tempStr="";
String img="";
for(int findx=0;findx<flist.size();findx++)
{
tempStr=flist.get(findx);
img=tempStr.substring(tempStr.length()-3)+"_small.png";
tempStr=tempStr.substring(ResultSet[indx][1].length(),tempStr.length());
tempStr=tempStr+GlobalClass.ColDelim+(GlobalClass.ChangeToDocserverPath(flist.get(findx),docserver))+GlobalClass.ColDelim+ResultSet[indx][2]+GlobalClass.ColDelim+img+GlobalClass.ColDelim+GlobalClass.RowDelim;
documents=documents+tempStr;
}
}
}
ResultSet=strf.ConverTo2DArray(documents, GlobalClass.RowDelim, GlobalClass.ColDelim);
setProcessFlag(true);
bdoc.setBankreports(ResultSet);
}
else
{
//System.out.println("Gello"+dbf.getErrMsg());
setProcessFlag(false);
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
}
return bdoc;
}
}

View File

@@ -0,0 +1,75 @@
package matrix.nimble.operation.output.controller;
//servlet libraries
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.model.Session;
import matrix.nimble.operation.output.model.BankReportHandler;
import matrix.nimble.operation.output.model.ReportSettings;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes("Sessvals")
public class BankReports {
@RequestMapping(value="bankreport",method=RequestMethod.POST )
public String BankReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
ModuleFunctions modFunc=new ModuleFunctions("5001");
ReportSettings RS=new ReportSettings();
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("repsettings",RS);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("stat",true);
model.addAttribute("msg","");
return "operation/bankreports/reports";
}
@RequestMapping(value="listsolved",method=RequestMethod.POST )
public String ListSolvedCases(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="repsettings") ReportSettings RS,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("5001");
BankReportHandler RPH=new BankReportHandler();
RPH.setProcessFlag(true);
RPH.setErrCode("5001");
RS.setCaselist(null);
RPH.GetReportSettings(RS);
if(RPH.isProcessFlag())
{
RPH.GetCaseList(RS);
}
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("repsettings",RS);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("stat",RPH.isProcessFlag());
model.addAttribute("msg",RPH.getErrMsg());
return "operation/bankreports/reports";
}
@RequestMapping(value="generatereport",method=RequestMethod.POST )
public String RunReportGeneration(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="repsettings") ReportSettings RS,HttpSession session)
{
String Rootdir= GlobalClass.getStoragePath()+"output/bankreports/"+Sessvals.getCompanyID()+"/"+Sessvals.getBranchID()+"/";
ModuleFunctions modFunc=new ModuleFunctions("5001");
BankReportHandler RPH=new BankReportHandler();
RPH.setProcessFlag(true);
RPH.setErrCode("5001");
RPH.setRunningmode("bankreports");
RPH.setSignPath(request.getServletContext().getRealPath("/"));
RPH.setRootPath(Rootdir);
RPH.GenerateReport(RS,Sessvals.getUserID(),Sessvals.getBranchID());
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("repsettings",RS);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("stat",RPH.isProcessFlag());
model.addAttribute("msg",RPH.getErrMsg());
return "operation/bankreports/reports";
}
}

View File

@@ -0,0 +1,70 @@
package matrix.nimble.operation.output.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;
import com.fasterxml.jackson.databind.ObjectMapper;
import matrix.nimble.model.Session;
import matrix.nimble.operation.output.model.ReportSettings;
import matrix.nimble.operation.output.model.TrackerGeneratorHelper;
import matrix.nimble.operation.output.model.TrackerSetting;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.ModuleFunctions;
@Controller
@SessionAttributes("Sessvals")
public class TrackerGenerator {
@RequestMapping(value="trackergenerator",method=RequestMethod.POST )
public String BankReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals)
{
ModuleFunctions modFunc=new ModuleFunctions("9111");
ReportSettings RS=new ReportSettings();
model.addAttribute("Sessvals",Sessvals);
return "operation/trackers/trackergenerator";
}
@RequestMapping(value="get-tracker-configs",method=RequestMethod.POST )
public @ResponseBody String getTrackerConfigs(@RequestParam String usid)
{
DBFunctions DBF=new DBFunctions("1001");
DBF.setProcessFlag(true);
String response= DBF.FetchRunQuery(495, new String[] {usid});
if(!DBF.isProcessFlag())
{
response=DBF.getErrMsg();
}else {
response = DBF.getProcResult();
}
return response;
}
@RequestMapping(value="generate-tracker-format",method=RequestMethod.POST)
public @ResponseBody String generateTrackerFormat(HttpServletRequest request,@RequestParam String jsonString)
{
String responseJson = "";
TrackerSetting trackerSetting = null;
TrackerGeneratorHelper helper = new TrackerGeneratorHelper();
try {
trackerSetting = new ObjectMapper().readValue(jsonString, TrackerSetting.class);
String templatePath = request.getServletContext().getRealPath("/templates/excel/tracker/"+trackerSetting.templatefile);
responseJson = helper.generateTrackerFormat(trackerSetting,templatePath);
}catch(Exception exce) {
responseJson = "{\"status\"=\"failed\",\"message\"=\""+exce.getMessage()+"\"}";
}
return responseJson;
}
}

View File

@@ -0,0 +1,734 @@
package matrix.nimble.operation.output.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.Hashtable;
import matrix.nimble.utilities.CommonFunctions;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import matrix.nimble.utilities.StringFunctions;
public class BankReportHandler {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private Hashtable<String, String> residence;
private Hashtable<String, String> office;
private Hashtable<String, String> officesa;
private Hashtable<String, String> telecalling;
private Hashtable<String, String> property;
private Hashtable<String, String> refrence;
private Hashtable<String, String> dedupe;
private Hashtable<String, String> extra;
private String[][] resilayout;
private String[][] offlayout;
private String[][] offsalayout;
private String[][] tvrlayout;
private String[][] proplayout;
private String[][] reflayout;
private String[][] dedlayout;
private String[][] extralayout;
private String[][] rreport;
private String[][] oreport;
private String[][] osareport;
private String[][] treport;
private String[][] preport;
private String[][] rtreport;
private String[][] ddreport;
private String[][] tracker;
private String[][] extrareport;
private String[][] templatefiles;
private String runningmode;
private String RootPath;
private String CurDate;
private String ProcessedOn;
private String SignPath;
private boolean ProcessFlag;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public Hashtable<String, String> getResidence() {
return residence;
}
public void setResidence(Hashtable<String, String> residence) {
this.residence = residence;
}
public Hashtable<String, String> getOffice() {
return office;
}
public void setOffice(Hashtable<String, String> office) {
this.office = office;
}
public Hashtable<String, String> getTelecalling() {
return telecalling;
}
public void setTelecalling(Hashtable<String, String> telecalling) {
this.telecalling = telecalling;
}
public Hashtable<String, String> getProperty() {
return property;
}
public void setProperty(Hashtable<String, String> property) {
this.property = property;
}
public Hashtable<String, String> getRefrence() {
return refrence;
}
public void setRefrence(Hashtable<String, String> refrence) {
this.refrence = refrence;
}
public Hashtable<String, String> getDedupe() {
return dedupe;
}
public void setDedupe(Hashtable<String, String> dedupe) {
this.dedupe = dedupe;
}
public String[][] getResilayout() {
return resilayout;
}
public void setResilayout(String[][] resilayout) {
this.resilayout = resilayout;
}
public String[][] getOfflayout() {
return offlayout;
}
public void setOfflayout(String[][] offlayout) {
this.offlayout = offlayout;
}
public String[][] getTvrlayout() {
return tvrlayout;
}
public void setTvrlayout(String[][] tvrlayout) {
this.tvrlayout = tvrlayout;
}
public String[][] getProplayout() {
return proplayout;
}
public void setProplayout(String[][] proplayout) {
this.proplayout = proplayout;
}
public String[][] getReflayout() {
return reflayout;
}
public void setReflayout(String[][] reflayout) {
this.reflayout = reflayout;
}
public String[][] getDedlayout() {
return dedlayout;
}
public void setDedlayout(String[][] dedlayout) {
this.dedlayout = dedlayout;
}
public String[][] getRreport() {
return rreport;
}
public void setRreport(String[][] rreport) {
this.rreport = rreport;
}
public String[][] getOreport() {
return oreport;
}
public void setOreport(String[][] oreport) {
this.oreport = oreport;
}
public String[][] getTreport() {
return treport;
}
public void setTreport(String[][] treport) {
this.treport = treport;
}
public String[][] getPreport() {
return preport;
}
public void setPreport(String[][] preport) {
this.preport = preport;
}
public String[][] getRtreport() {
return rtreport;
}
public void setRtreport(String[][] rtreport) {
this.rtreport = rtreport;
}
public String[][] getDdreport() {
return ddreport;
}
public void setDdreport(String[][] ddreport) {
this.ddreport = ddreport;
}
public String[][] getTemplatefiles() {
return templatefiles;
}
public void setTemplatefiles(String[][] templatefiles) {
this.templatefiles = templatefiles;
}
public String getRootPath() {
return RootPath;
}
public void setRootPath(String rootPath) {
RootPath = rootPath;
}
public String getCurDate() {
return CurDate;
}
public void setCurDate(String curDate) {
CurDate = curDate;
}
public String getProcessedOn() {
return ProcessedOn;
}
public void setProcessedOn(String processedOn) {
ProcessedOn = processedOn;
}
public String getSignPath() {
return SignPath;
}
public void setSignPath(String signPath) {
SignPath = signPath;
}
public String[][] getTracker() {
return tracker;
}
public void setTracker(String[][] tracker) {
this.tracker = tracker;
}
public Hashtable<String, String> getOfficesa() {
return officesa;
}
public void setOfficesa(Hashtable<String, String> officesa) {
this.officesa = officesa;
}
public String[][] getOffsalayout() {
return offsalayout;
}
public void setOffsalayout(String[][] offsalayout) {
this.offsalayout = offsalayout;
}
public String[][] getOsareport() {
return osareport;
}
public void setOsareport(String[][] osareport) {
this.osareport = osareport;
}
public String getRunningmode() {
return runningmode;
}
public void setRunningmode(String runningmode) {
this.runningmode = runningmode;
}
public Hashtable<String, String> getExtra() {
return extra;
}
public void setExtra(Hashtable<String, String> extra) {
this.extra = extra;
}
public String[][] getExtralayout() {
return extralayout;
}
public void setExtralayout(String[][] extralayout) {
this.extralayout = extralayout;
}
public String[][] getExtrareport() {
return extrareport;
}
public void setExtrareport(String[][] extrareport) {
this.extrareport = extrareport;
}
public void GetReportSettings(ReportSettings RS) {
ModuleFunctions modFunc = new ModuleFunctions(getErrCode());
modFunc.setProcessFlag(true);
String[][] ResultData = modFunc.GetResultArray(109,
(RS.getPortfolioid() + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (modFunc.isProcessFlag()) {
if (ResultData.length > 0) {
RS.setRrformat(ResultData[0][1]);
RS.setOrformat(ResultData[0][2]);
RS.setTrformat(ResultData[0][3]);
RS.setPrformat(ResultData[0][4]);
RS.setRtrformat(ResultData[0][5]);
RS.setDdformat(ResultData[0][6]);
RS.setTracker(ResultData[0][7]);
RS.setOrsaformat(ResultData[0][8]);
RS.setRvqid(Integer.parseInt(ResultData[0][9]));
RS.setOvqid(Integer.parseInt(ResultData[0][10]));
RS.setTvqid(Integer.parseInt(ResultData[0][11]));
RS.setPvqid(Integer.parseInt(ResultData[0][12]));
RS.setRefvqid(Integer.parseInt(ResultData[0][13]));
RS.setDdqid(Integer.parseInt(ResultData[0][14]));
RS.setTrackqid(Integer.parseInt(ResultData[0][15]));
RS.setOffsaqid(Integer.parseInt(ResultData[0][16]));
RS.setReportby(ResultData[0][17]);
RS.setAutoemail(ResultData[0][18].equals("1") ? true : false);
RS.setReporttype(ResultData[0][19]);
RS.setArchivebatch(ResultData[0][20].equals("1") ? true : false);
RS.setAttachannexure(ResultData[0][21].equals("1") ? true : false);
RS.setBsuid(ResultData[0][22]);
RS.setPortsupervisor(ResultData[0][23]);
RS.setTemplatefile(ResultData[0][24]);
RS.setUpload(ResultData[0][25].equals("1") ? true : false);
RS.setExtrareport(ResultData[0][26]);
RS.setExtraqid(Integer.parseInt(ResultData[0][27]));
RS.setSupname(ResultData[0][28]);
}
} else {
setProcessFlag(false);
setErrDesc(modFunc.getErrDesc());
setErrMsg(modFunc.getErrMsg());
}
}
public void GetCaseList(ReportSettings RS) {
ArrayList<CaseList> Record = new ArrayList<CaseList>();
StringFunctions StrFunc = new StringFunctions(getErrCode());
DBFunctions DBF = new DBFunctions(getErrCode());
DBF.setProcessFlag(true);
String[] Vals = (RS.getPortfolioid() + GlobalClass.ColDelim).split(GlobalClass.ColDelim);
String ResultData = DBF.FetchRunQuery(108, Vals);
if (DBF.isProcessFlag()) {
String[][] BankListData = StrFunc.ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
for (int RecCount = 0; RecCount < BankListData.length; RecCount++) {
CaseList CList = new CaseList();
CList.setUuid(BankListData[RecCount][0]);
CList.setMvcode(BankListData[RecCount][1]);
CList.setApplno(BankListData[RecCount][2]);
CList.setCustomername(BankListData[RecCount][3]);
CList.setApptype(BankListData[RecCount][4]);
CList.setRv(BankListData[RecCount][5]);
CList.setOv(BankListData[RecCount][6]);
CList.setPv(BankListData[RecCount][7]);
CList.setRtv(BankListData[RecCount][8]);
CList.setOtv(BankListData[RecCount][9]);
CList.setRefv(BankListData[RecCount][10]);
CList.setStatus(BankListData[RecCount][11]);
CList.setReceivedate(BankListData[RecCount][12]);
CList.setBranch(BankListData[RecCount][13]);
CList.setProduct(BankListData[RecCount][14]);
CList.setBankbranchid(BankListData[RecCount][15]);
CList.setOnlinecaseid(BankListData[RecCount][16]);
CList.setGenreport(true);
Record.add(CList);
}
} else {
setProcessFlag(false);
setErrDesc(DBF.getErrDesc());
setErrMsg(DBF.getErrMsg());
}
RS.setCaselist(Record);
}
public void GenerateReport(ReportSettings RS, String UserId, String BranchId) {
StringFunctions strFunc = new StringFunctions(getErrCode());
setCurDate(strFunc.FormatDate("yyyy/MM/dd", new Date()));
setProcessedOn(strFunc.FormatDate("yyyy/MM/dd HH:mm:ss", new Date()));
DBFunctions dbFunc = new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
String uuids = RS.getUuids();
uuids = uuids.substring(0, uuids.length() - 1);
uuids = uuids.replace(",", " or uuid=");
uuids = "uuid=" + uuids;
String orderBy = "order by bkbranchname,product,applno,apptype";
if (isProcessFlag() && RS.getRvqid() > 0) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.createHashTable(true, 1);
dbFunc.FetchRunQuery(RS.getRvqid(),
(uuids + GlobalClass.ColDelim + orderBy + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setResidence(dbFunc.getResultHash());
setRreport(dbFunc.getResultArray());
}
}
if (isProcessFlag() && RS.getOvqid() > 0) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.setProcessFlag(true);
dbFunc.createHashTable(true, 1);
dbFunc.FetchRunQuery(RS.getOvqid(), (uuids + GlobalClass.ColDelim + " and upper(category)!='SALARIED' "
+ orderBy + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setOffice(dbFunc.getResultHash());
setOreport(dbFunc.getResultArray());
}
}
if (isProcessFlag() && RS.getOffsaqid() > 0) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.setProcessFlag(true);
dbFunc.createHashTable(true, 1);
dbFunc.FetchRunQuery(RS.getOffsaqid(),
(uuids + GlobalClass.ColDelim + " and upper(category)='SALARIED' " + orderBy + GlobalClass.ColDelim)
.split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setOfficesa(dbFunc.getResultHash());
setOsareport(dbFunc.getResultArray());
}
}
if (isProcessFlag() && RS.getTvqid() > 0) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.setProcessFlag(true);
dbFunc.createHashTable(true, 1);
String uuids1 = RS.getUuids();
uuids1 = uuids1.substring(0, uuids1.length() - 1);
uuids1 = uuids1.replace(",", " or t.uuid=");
uuids1 = "t.uuid=" + uuids1;
String orderBy1 = "order by t.bkbranchname,t.product,t.applno,t.apptype";
dbFunc.FetchRunQuery(RS.getTvqid(),
(uuids1 + GlobalClass.ColDelim + orderBy1 + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setTelecalling(dbFunc.getResultHash());
setTreport(dbFunc.getResultArray());
}
}
if (isProcessFlag() && RS.getRefvqid() > 0) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.setProcessFlag(true);
dbFunc.createHashTable(true, 1);
dbFunc.FetchRunQuery(RS.getRefvqid(),
(uuids + GlobalClass.ColDelim + orderBy + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setRefrence(dbFunc.getResultHash());
setRtreport(dbFunc.getResultArray());
}
}
if (isProcessFlag() && RS.getPvqid() > 0) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.setProcessFlag(true);
dbFunc.createHashTable(true, 1);
dbFunc.FetchRunQuery(RS.getPvqid(),
(uuids + GlobalClass.ColDelim + orderBy + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setProperty(dbFunc.getResultHash());
setPreport(dbFunc.getResultArray());
}
}
if (isProcessFlag() && RS.getDdqid() > 0) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.setProcessFlag(true);
dbFunc.createHashTable(true, 1);
dbFunc.FetchRunQuery(RS.getDdqid(),
(uuids + GlobalClass.ColDelim + orderBy + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setDedupe(dbFunc.getResultHash());
setDdreport(dbFunc.getResultArray());
}
}
if (isProcessFlag() && RS.getExtraqid() > 0) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.setProcessFlag(true);
dbFunc.createHashTable(true, 1);
dbFunc.FetchRunQuery(RS.getExtraqid(),
(uuids + GlobalClass.ColDelim + orderBy + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setExtra(dbFunc.getResultHash());
setExtrareport(dbFunc.getResultArray());
}
}
if (isProcessFlag() && RS.getTrackqid() > 0 && RS.isAttachannexure()) {
dbFunc.setResultArray(null);
dbFunc.setResultHash(null);
dbFunc.setProcessFlag(true);
dbFunc.createHashTable(false, 0);
dbFunc.FetchRunQuery(RS.getTrackqid(),
(uuids + GlobalClass.ColDelim + orderBy + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (!dbFunc.getErrMsg().contains("No records found") && !dbFunc.isProcessFlag()) {
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
setProcessFlag(false);
} else {
setProcessFlag(true);
setTracker(dbFunc.getResultArray());
String msg = "REPGEN:info:Bank reports generated successfully.";
if (RS.isAttachannexure()) {
ExcelTrackers Exl = new ExcelTrackers();
Exl.setErrCode(getErrCode());
Exl.setProcessFlag(true);
Exl.setCreateborder(true);
Exl.BanklistTracker(RS, this);
if (!isProcessFlag()) {
msg = "Tracker generation failed.";
} else {
msg = "Tracker generated successfully.";
}
}
setErrMsg(msg);
}
}
if (isProcessFlag()) {
FetchReportLayouts(RS);
if (RS.getReporttype().equals("1") || RS.getReporttype().equals("0")) {
PartWiseReporting PWR = new PartWiseReporting();
PWR.setErrCode(getErrCode());
PWR.setProcessFlag(true);
PWR.GenerateBankReports(RS, this, UserId, BranchId);
if (!PWR.isProcessFlag()) {
setProcessFlag(false);
} else {
RS.setCaselist(null);
}
setErrMsg(PWR.getErrMsg() + "\n" + getErrMsg());
setErrDesc(PWR.getErrDesc());
} else if (RS.getReporttype().equals("2") || RS.getReporttype().equals("3")) {
CombinedReporting CBR = new CombinedReporting();
CBR.setErrCode(getErrCode());
CBR.setProcessFlag(true);
// System.out.println("Calling combine Reporting");
CBR.GenerateBankReports(RS, this, UserId, BranchId);
if (!CBR.isProcessFlag()) {
setProcessFlag(false);
} else {
RS.setCaselist(null);
}
setErrMsg(CBR.getErrMsg() + "\n" + getErrMsg());
setErrDesc(CBR.getErrDesc());
} else if (RS.getReporttype().equals("4")) {
dbFunc.FetchRunQuery(452, new String[] { RS.getPortfolioid() });
if (dbFunc.isProcessFlag()) {
if (RS.getExtraqid() > 0) {
setTemplatefiles(dbFunc.getResultArray());
CombinedExcelReporting CBR = new CombinedExcelReporting();
CBR.setErrCode(getErrCode());
CBR.GenerateBankReports(RS, this, UserId, BranchId);
if (!CBR.isProcessFlag()) {
setProcessFlag(false);
} else {
RS.setCaselist(null);
}
setErrMsg(CBR.getErrMsg() + "\n" + getErrMsg());
setErrDesc(CBR.getErrDesc());
} else {
PartwiseExcelReporting PWR = new PartwiseExcelReporting();
PWR.setErrCode(getErrCode());
}
} else {
setErrMsg("error:Template files not found");
}
} else if (RS.getReporttype().equals("5")) {
dbFunc.FetchRunQuery(452, new String[] { RS.getPortfolioid() });
if (dbFunc.isProcessFlag()) {
if (RS.getExtraqid() > 0) {
setTemplatefiles(dbFunc.getResultArray());
CombinedWordlReportingTabular CBR = new CombinedWordlReportingTabular();
CBR.setErrCode(getErrCode());
CBR.GenerateBankReports(RS, this, UserId, BranchId);
if (!CBR.isProcessFlag()) {
setProcessFlag(false);
} else {
RS.setCaselist(null);
}
setErrMsg(CBR.getErrMsg() + "\n" + getErrMsg());
setErrDesc(CBR.getErrDesc());
} else {
setProcessFlag(false);
setErrMsg("error:Template files not found");
}
} else {
setErrMsg("error:Template files not found");
}
} else if (RS.getReporttype().equals("6")) {
dbFunc.FetchRunQuery(452, new String[] { RS.getPortfolioid() });
if (dbFunc.isProcessFlag()) {
if (RS.getExtraqid() > 0) {
setTemplatefiles(dbFunc.getResultArray());
CombinedWordlReporting CBR = new CombinedWordlReporting();
CBR.setErrCode(getErrCode());
CBR.GenerateBankReports(RS, this, UserId, BranchId);
if (!CBR.isProcessFlag()) {
setProcessFlag(false);
} else {
RS.setCaselist(null);
}
setErrMsg(CBR.getErrMsg() + "\n" + getErrMsg());
setErrDesc(CBR.getErrDesc());
} else {
setProcessFlag(false);
setErrMsg("error:Template files not found");
}
} else {
setErrMsg("error:Template files not found");
}
}
setErrMsg((getErrMsg() != null) ? getErrMsg().replace("\n", "<br>").replace("null", "") : getErrMsg());
System.out.println(getErrMsg());
}
}
private void FetchReportLayouts(ReportSettings RS) {
DBFunctions dbFunc = new DBFunctions(getErrCode());
dbFunc.setProcessFlag(true);
String formats = "format_id=" + RS.getRrformat() + " or ";
formats += "format_id=" + RS.getOrformat() + " or ";
formats += "format_id=" + RS.getOrsaformat() + " or ";
formats += "format_id=" + RS.getTrformat() + " or ";
formats += "format_id=" + RS.getPrformat() + " or ";
formats += "format_id=" + RS.getRtrformat() + " or ";
formats += "format_id=" + RS.getExtrareport() + " or ";
formats += "format_id=" + RS.getDdformat();
dbFunc.FetchRunQuery(116, (formats + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if (dbFunc.isProcessFlag()) {
CommonFunctions comFunc = new CommonFunctions();
resilayout = comFunc.GetSubArray(RS.getRrformat(), 0, dbFunc.getResultArray());
offlayout = comFunc.GetSubArray(RS.getOrformat(), 0, dbFunc.getResultArray());
offsalayout = comFunc.GetSubArray(RS.getOrsaformat(), 0, dbFunc.getResultArray());
tvrlayout = comFunc.GetSubArray(RS.getTrformat(), 0, dbFunc.getResultArray());
proplayout = comFunc.GetSubArray(RS.getPrformat(), 0, dbFunc.getResultArray());
reflayout = comFunc.GetSubArray(RS.getRtrformat(), 0, dbFunc.getResultArray());
dedlayout = comFunc.GetSubArray(RS.getDdformat(), 0, dbFunc.getResultArray());
extralayout = comFunc.GetSubArray(RS.getExtrareport(), 0, dbFunc.getResultArray());
// System.out.println("After Format ID");
} else if (!dbFunc.isProcessFlag() && dbFunc.getErrMsg().contains("No records found")) {
setProcessFlag(false);
setErrMsg(dbFunc.getErrMsg().replace("No records found",
"No report layout found for selected portfolio. Please contact your administrator"));
setErrDesc(dbFunc.getErrDesc());
} else {
setProcessFlag(false);
setErrMsg(dbFunc.getErrMsg());
setErrDesc(dbFunc.getErrDesc());
}
}
}

View File

@@ -0,0 +1,159 @@
package matrix.nimble.operation.output.model;
public class CaseList {
private String uuid;
private String mvcode;
private String applno;
private String customername;
private String apptype;
private String rv;
private String ov;
private String pv;
private String rtv;
private String otv;
private String refv;
private String status;
private String branch;
private String product;
private String receivedate;
private boolean genreport;
private boolean repgenerated;
private String repstatus;
private boolean emailsent;
private String mailstatus;
private String bankbranchid;
private String onlinecaseid;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getMvcode() {
return mvcode;
}
public void setMvcode(String mvcode) {
this.mvcode = mvcode;
}
public String getApplno() {
return applno;
}
public void setApplno(String applno) {
this.applno = applno;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getApptype() {
return apptype;
}
public void setApptype(String apptype) {
this.apptype = apptype;
}
public String getRv() {
return rv;
}
public void setRv(String rv) {
this.rv = rv;
}
public String getOv() {
return ov;
}
public void setOv(String ov) {
this.ov = ov;
}
public String getPv() {
return pv;
}
public void setPv(String pv) {
this.pv = pv;
}
public String getRtv() {
return rtv;
}
public void setRtv(String rtv) {
this.rtv = rtv;
}
public String getOtv() {
return otv;
}
public void setOtv(String otv) {
this.otv = otv;
}
public String getRefv() {
return refv;
}
public void setRefv(String refv) {
this.refv = refv;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getBranch() {
return branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public String getProduct() {
return product;
}
public void setProduct(String product) {
this.product = product;
}
public String getReceivedate() {
return receivedate;
}
public void setReceivedate(String receivedate) {
this.receivedate = receivedate;
}
public boolean isGenreport() {
return genreport;
}
public void setGenreport(boolean genreport) {
this.genreport = genreport;
}
public boolean isRepgenerated() {
return repgenerated;
}
public void setRepgenerated(boolean repgenerated) {
this.repgenerated = repgenerated;
}
public String getRepstatus() {
return repstatus;
}
public void setRepstatus(String repstatus) {
this.repstatus = repstatus;
}
public boolean isEmailsent() {
return emailsent;
}
public void setEmailsent(boolean emailsent) {
this.emailsent = emailsent;
}
public String getMailstatus() {
return mailstatus;
}
public void setMailstatus(String mailstatus) {
this.mailstatus = mailstatus;
}
public String getBankbranchid() {
return bankbranchid;
}
public void setBankbranchid(String bankbranchid) {
this.bankbranchid = bankbranchid;
}
public String getOnlinecaseid() {
return onlinecaseid;
}
public void setOnlinecaseid(String onlinecaseid) {
this.onlinecaseid = onlinecaseid;
}
}

View File

@@ -0,0 +1,544 @@
package matrix.nimble.operation.output.model;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
import org.apache.poi.hslf.model.Picture;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFCreationHelper;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.util.IOUtils;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Image;
import com.itextpdf.text.pdf.codec.Base64.InputStream;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.PDFFormatter;
/**
* @author mswami
*
*/
public class CombinedExcelReporting {
private String errMsg;
private String errDesc;
private String errCode;
private boolean processFlag;
private String userId;
private String prevBranch;
private String curBranch;
private boolean filegenerated;
private POIFSFileSystem reportFile;
private HSSFWorkbook reportWorkbook;
private HSSFSheet reportSheet;
private String templatePath;
private String fileName;
private String filePath;
private String signPath;
private String oCid;
private String puuid;
public CombinedExcelReporting() {
setProcessFlag(true);
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public String getErrDesc() {
return errDesc;
}
public void setErrDesc(String errDesc) {
this.errDesc = errDesc;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public boolean isProcessFlag() {
return processFlag;
}
public void setProcessFlag(boolean processFlag) {
this.processFlag = processFlag;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPrevBranch() {
return prevBranch;
}
public void setPrevBranch(String prevBranch) {
this.prevBranch = prevBranch;
}
public String getCurBranch() {
return curBranch;
}
public void setCurBranch(String curBranch) {
this.curBranch = curBranch;
}
public POIFSFileSystem getReportFile() {
return reportFile;
}
public void setReportFile(POIFSFileSystem reportFile) {
this.reportFile = reportFile;
}
public HSSFSheet getReportSheet() {
return reportSheet;
}
public void setReportSheet(HSSFSheet reportSheet) {
this.reportSheet = reportSheet;
}
public HSSFWorkbook getReportWorkbook() {
return reportWorkbook;
}
public void setReportWorkbook(HSSFWorkbook reportWorkbook) {
this.reportWorkbook = reportWorkbook;
}
public String getTemplatePath() {
return templatePath;
}
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getSignPath() {
return signPath;
}
public void setSignPath(String signPath) {
this.signPath = signPath;
}
public String getoCid() {
return oCid;
}
public void setoCid(String oCid) {
this.oCid = oCid;
}
public String getPuuid() {
return puuid;
}
public void setPuuid(String puuid) {
this.puuid = puuid;
}
public boolean isFilegenerated() {
return filegenerated;
}
public void setFilegenerated(boolean filegenerated) {
this.filegenerated = filegenerated;
}
public void GenerateBankReports(ReportSettings RS,BankReportHandler RFH,String UserId,String BranchId)
{
Hashtable<String, String> QValsTab=new Hashtable<String, String>();
HashMap<String,String> OCasesTab=new HashMap<String,String>();
String subPath="";
setUserId(UserId);
String Uuids="";
setPrevBranch("");
setFilePath("");
setCurBranch("");
String filePrefix="";
setSignPath(RFH.getSignPath());
int listSize=RS.getCaselist().size();
for(int listIndex=0;listIndex<listSize;listIndex++)
{
setFilegenerated(false);
CaseList clist=(CaseList)RS.getCaselist().get(listIndex);
String tuuid=clist.getUuid();
if(clist.isGenreport())
{
Uuids=tuuid;
filePrefix=RS.getReporttype().equals("3") ? (clist.getCustomername().replaceAll("/| |&", "_")+"_"+clist.getApplno().replaceAll("\\s", "_").replaceAll("/","")+"_") : "";
if(RS.getReportby().equals("1"))
{
setCurBranch(clist.getBranch()+""+clist.getProduct()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getProduct().replaceAll("\\s", "_"));
}
else if(RS.getReportby().equals("2"))
{
setCurBranch(clist.getBranch()+""+clist.getApplno()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getApplno().replaceAll("\\s", "_"));
}
else if(RS.getReportby().equals("3"))
{
setCurBranch(clist.getBranch()+""+clist.getProduct()+""+clist.getApplno()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getProduct().replaceAll("\\s", "_"))+"/"+(clist.getApplno().replaceAll("\\s", "_"));
}
else
{
setCurBranch(clist.getBranch()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"));
}
if (QValsTab.containsKey(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/"))
{
Uuids=Uuids+","+QValsTab.get(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/").split(GlobalClass.ColDelim)[1];
}
QValsTab.put(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/", RFH.getProcessedOn()+GlobalClass.ColDelim+Uuids+GlobalClass.ColDelim+(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/")+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+clist.getBankbranchid()+GlobalClass.ColDelim+(RS.isArchivebatch() ? "1":"0")+GlobalClass.ColDelim+(RFH.getRunningmode())+GlobalClass.ColDelim);
if(!getCurBranch().equals(getPrevBranch()))
{
setPuuid(clist.getUuid());
setoCid(clist.getOnlinecaseid());
setFilePath(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/");
if(CreateDirectory(getFilePath()))
{
if(!isProcessFlag())
{
break;
}
}
else
{
setProcessFlag(false);
break;
}
setPrevBranch(getCurBranch());
}
if(RFH.getExtra()!=null && RFH.getExtra().containsKey(tuuid))
{
setTemplatePath(RFH.getSignPath()+RFH.getTemplatefiles()[0][8]);
CreateReportFile("", filePrefix);
if(!isProcessFlag())
{
break;
}
DesignReport(RFH.getExtra().get(tuuid).split(GlobalClass.ColDelim),RFH.getExtralayout());
}
if(isProcessFlag())
{
if(!getoCid().equals("0"))
{
OCasesTab.put(getoCid(),getPuuid()+GlobalClass.ColDelim+(getFilePath()+getFileName()));
}
}
}
}
if(isProcessFlag())
{
FinalizeBanklist(QValsTab, RS.isAutoemail(),RFH.getProcessedOn(), BranchId,RFH.getRunningmode(),OCasesTab,RS.getPortfolioid());
}
if(isProcessFlag())
{
setErrMsg(getErrCode()+"REPGEN:Info:Reports generated successfully."+(RS.isAutoemail() ? "\n\nEmail sent successfully.\n" : ""));
}
}
private void DesignReport(String [] reportData,String [][] reportlayout)
{
int layoutIndex=0;
HSSFRow row = null;
HSSFCell cell = null;
for(int cindx=8;cindx<reportData.length;cindx++)
{
Image img=null;
reportData[cindx] = reportData[cindx].replace("<lbr3@k>", "\r\n\r\n");
row = getReportSheet().getRow(Integer.parseInt(reportlayout[layoutIndex][15]));
cell = row.getCell(Integer.parseInt(reportlayout[layoutIndex][10]));
if(reportlayout[layoutIndex][2].equals("image"))
{
setImageinCell(getSignPath()+""+reportData[cindx],getReportWorkbook(),Integer.parseInt(reportlayout[layoutIndex][15]),Integer.parseInt(reportlayout[layoutIndex][10]));
}
else
{
cell.setCellValue(reportData[cindx]);
}
layoutIndex++;
}
String disclaimer = " This report is based on information gathered by our field executive/telecaller.";
disclaimer += " The Bank/NBFC is requested to corelate the same with documents/information on record/gathered";
disclaimer += " by them in the course of complete due diligence/appraisal being undertaken by the Bank/NBFC.";
disclaimer += " Our report should not be the sole criteria for sanction of the loan under reference.";
row = getReportSheet().getRow(Integer.parseInt(reportlayout[layoutIndex-1][15])+1);
cell = row.getCell(0);
if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) {
if (cell == null) {
cell = row.createCell(0);
}
}
cell.setCellValue(disclaimer);
WriteFile(getReportWorkbook());
}
private void WriteFile(HSSFWorkbook filledWorkbook)
{
try
{
FileOutputStream out = new FileOutputStream(getFilePath()+getFileName());
filledWorkbook.write(out);
out.close();
setFilegenerated(true);
}catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"error:File save operation failed."+exce.getMessage());
}
}
public void FinalizeBanklist(Hashtable<String, String> QValsTab,boolean isAutoemail,String processedOn,String BranchId,String runningMode,HashMap<String, String> OCasesTab,String Portfolioid)
{
DBFunctions dbf=new DBFunctions(getErrCode());
Set<String> keys=QValsTab.keySet();
String []Qvals=null;
if(OCasesTab.size() > 0)
{
String temp="";
Qvals=new String [4];
Iterator<String> keySetIterator = OCasesTab.keySet().iterator();
while(keySetIterator.hasNext()){
String key = keySetIterator.next();
temp=OCasesTab.get(key);
Qvals[0]=(Qvals[0]==null ? "" : Qvals[0])+""+key+",";
Qvals[1]=(Qvals[1]==null ? "" : Qvals[1])+""+temp.split(GlobalClass.ColDelim)[0]+",";
Qvals[2]=(Qvals[2]==null ? "" : Qvals[2])+""+temp.split(GlobalClass.ColDelim)[1]+",";
}
Qvals[0]=Qvals[0].substring(0,Qvals[0].length()-1);
Qvals[1]=Qvals[1].substring(0,Qvals[1].length()-1);
Qvals[2]=Qvals[2].substring(0,Qvals[2].length()-1);
Qvals[3]=Portfolioid;
dbf.setProcessFlag(true);
dbf.FetchRunQuery(156, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(dbf.getErrMsg()+". Uploading reports failed for one or more cases. Try re-uploading using Tools->Pending Uploads");
setErrDesc(dbf.getErrDesc());
setProcessFlag(true);
}
Qvals=null;
}
for(String key : keys)
{
dbf.setProcessFlag(true);
Qvals=QValsTab.get(key).split(GlobalClass.ColDelim);
Qvals[1]="uuid=''"+Qvals[1].replace(",", "'' or uuid=''")+"''";
dbf.FetchRunQuery(118, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(getErrMsg()+"Final updation failed for some or all cases.");
setErrDesc(dbf.getErrDesc());
setProcessFlag(dbf.isProcessFlag());
break;
}
}
if(!isProcessFlag())
{
setErrMsg(getErrMsg()+"Final updation failed for some or all cases.");
}
else
{
if(isAutoemail)
{
SendReports SR=new SendReports();
SR.setErrCode(getErrCode());
SR.setProcessFlag(true);
SR.SendReportsByBatch(processedOn, BranchId,getUserId(),runningMode);
if (!SR.isProcessFlag())
{
setErrMsg(SR.getErrMsg().replace(getErrCode()+"SEML:warning:", getErrCode()+"SEML:warning:Bank Reports generated successfully.\n\n"));
setErrDesc(SR.getErrDesc());
setProcessFlag(SR.isProcessFlag());
}
}
}
}
private void CreateReportFile(String reportType,String filePrefix)
{
int i=0;
setFileName(filePrefix+reportType+"_REP_"+i+".xls");
while(CheckFileExistence(getFilePath()+getFileName()))
{
i++;
setFileName(filePrefix+reportType+"_REP_"+i+".xls");
}
if(isProcessFlag())
{
try
{
setReportFile(new POIFSFileSystem(new FileInputStream(getTemplatePath())));
setReportWorkbook(new HSSFWorkbook(getReportFile(), true));
setReportSheet(getReportWorkbook().getSheet("Report"));
}
catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"error:Excel creation failed."+exce.getMessage());
}
}
}
private boolean CreateDirectory(String DirPath)
{
try
{
File f=new File(DirPath);
if(!f.isDirectory())
{
return f.mkdirs();
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private boolean CheckFileExistence(String PathToFile)
{
try
{
File f=new File(PathToFile);
if(!f.isFile())
{
return false;
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private void setImageinCell(String imgpath,HSSFWorkbook workbook,int row,int col)
{
ClientAnchor anchor = null;
try {
HSSFSheet sheet = getReportSheet();
java.io.InputStream inputStream = new FileInputStream(imgpath);
byte[] imageBytes = IOUtils.toByteArray(inputStream);
int pictureureIdx = workbook.addPicture(imageBytes, HSSFWorkbook.PICTURE_TYPE_PNG);
inputStream.close();
CreationHelper helper = workbook.getCreationHelper();
Drawing drawing = sheet.createDrawingPatriarch();
anchor = helper.createClientAnchor();
anchor.setAnchorType(ClientAnchor.MOVE_AND_RESIZE);
anchor.setCol1(col);
anchor.setRow1(row);
org.apache.poi.ss.usermodel.Picture pict = drawing.createPicture(anchor, pictureureIdx);
pict.resize(1.2);
}catch (Exception e) {
System.out.println(e);
}
}
}

View File

@@ -0,0 +1,541 @@
package matrix.nimble.operation.output.model;
import java.io.File;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.PDFFormatter;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Image;
public class CombinedReporting {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String UserId;
private String PrevBranch;
private String CurBranch;
private String FileName;
private String FilePath;
private String SignPath;
private String OCid;
private String Puuid;
private PDFFormatter PDFFile;
private Image QRCodeFile;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getPrevBranch() {
return PrevBranch;
}
public void setPrevBranch(String prevBranch) {
PrevBranch = prevBranch;
}
public String getCurBranch() {
return CurBranch;
}
public void setCurBranch(String curBranch) {
CurBranch = curBranch;
}
public String getFileName() {
return FileName;
}
public void setFileName(String fileName) {
FileName = fileName;
}
public String getFilePath() {
return FilePath;
}
public void setFilePath(String filePath) {
FilePath = filePath;
}
public String getSignPath() {
return SignPath;
}
public void setSignPath(String signPath) {
SignPath = signPath;
}
public PDFFormatter getPDFFile() {
return PDFFile;
}
public void setPDFFile(PDFFormatter pDFFile) {
PDFFile = pDFFile;
}
public Image getQRCodeFile() {
return QRCodeFile;
}
public void setQRCodeFile(Image qRCodeFile) {
QRCodeFile = qRCodeFile;
}
public String getUserId() {
return UserId;
}
public void setUserId(String userId) {
UserId = userId;
}
public String getOCid() {
return OCid;
}
public void setOCid(String oCid) {
OCid = oCid;
}
public String getPuuid() {
return Puuid;
}
public void setPuuid(String puuid) {
Puuid = puuid;
}
public void GenerateBankReports(ReportSettings RS,BankReportHandler RFH,String UserId,String BranchId)
{
Hashtable<String, String> QValsTab=new Hashtable<String, String>();
HashMap<String,String> OCasesTab=new HashMap<String,String>();
String subPath="";
setUserId(UserId);
String Uuids="";
setPrevBranch("");
setFilePath("");
setCurBranch("");
String filePrefix="";
PDFFormatter PDFF=new PDFFormatter();
PDFF.setErrCode(getErrCode());
PDFF.setProcessFlag(true);
BankReportHandler rfh=RFH;
ReportSettings rs=RS;
setSignPath(rfh.getSignPath());
int listSize=rs.getCaselist().size();
for(int listIndex=0;listIndex<listSize;listIndex++)
{
CaseList clist=(CaseList)rs.getCaselist().get(listIndex);
String tuuid=clist.getUuid();
if(clist.isGenreport())
{
Uuids=tuuid;
filePrefix=rs.getReporttype().equals("3") ? (clist.getCustomername().replaceAll("/| |&", "_")+"_"+clist.getApplno().replaceAll("\\s", "_").replaceAll("/","")+"_") : "";
if(rs.getReportby().equals("1"))
{
setCurBranch(clist.getBranch()+""+clist.getProduct()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getProduct().replaceAll("\\s", "_"));
}
else if(rs.getReportby().equals("2"))
{
setCurBranch(clist.getBranch()+""+clist.getApplno()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getApplno().replaceAll("\\s", "_"));
}
else if(rs.getReportby().equals("3"))
{
setCurBranch(clist.getBranch()+""+clist.getProduct()+""+clist.getApplno()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getProduct().replaceAll("\\s", "_"))+"/"+(clist.getApplno().replaceAll("\\s", "_"));
}
else
{
setCurBranch(clist.getBranch()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"));
}
if (QValsTab.containsKey(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/"))
{
Uuids=Uuids+","+QValsTab.get(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/").split(GlobalClass.ColDelim)[1];
}
QValsTab.put(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/", RFH.getProcessedOn()+GlobalClass.ColDelim+Uuids+GlobalClass.ColDelim+(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/")+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+clist.getBankbranchid()+GlobalClass.ColDelim+(RS.isArchivebatch() ? "1":"0")+GlobalClass.ColDelim+(RFH.getRunningmode())+GlobalClass.ColDelim);
if(!getCurBranch().equals(getPrevBranch()))
{
if(PDFF.getOutput()!=null)
{
PDFF.closeDocument();
if(!getOCid().equals("0"))
{
OCasesTab.put(getOCid(),getPuuid()+GlobalClass.ColDelim+(getFilePath()+getFileName()));
}
}
setPuuid(clist.getUuid());
setOCid(clist.getOnlinecaseid());
setFilePath(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/");
if(CreateDirectory(getFilePath()))
{
CreateReportFile("", PDFF,filePrefix);
if(!isProcessFlag())
{
break;
}
}
else
{
setProcessFlag(false);
break;
}
setPrevBranch(getCurBranch());
}
if(RFH.getResidence()!=null && RFH.getResidence().containsKey(tuuid))
{
PDFF.setFontBlack();
PDFF.createTable(120);
DesignReport(RFH.getResidence().get(tuuid).split(GlobalClass.ColDelim),RFH.getResilayout(),PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
if(RFH.getOffice()!=null && RFH.getOffice().containsKey(tuuid))
{
PDFF.setFontBlack();
PDFF.createTable(120);
DesignReport(RFH.getOffice().get(tuuid).split(GlobalClass.ColDelim),RFH.getOfflayout(),PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
if(RFH.getOfficesa()!=null && RFH.getOfficesa().containsKey(tuuid))
{
PDFF.setFontBlack();
PDFF.createTable(120);
DesignReport(RFH.getOfficesa().get(tuuid).split(GlobalClass.ColDelim),RFH.getOffsalayout(),PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
if(RFH.getTelecalling()!=null && RFH.getTelecalling().containsKey(tuuid))
{
PDFF.setFontBlack();
PDFF.createTable(120);
DesignReport(RFH.getTelecalling().get(tuuid).split(GlobalClass.ColDelim),RFH.getTvrlayout(),PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
if(RFH.getProperty()!=null && RFH.getProperty().containsKey(tuuid))
{
PDFF.setFontBlack();
PDFF.createTable(120);
DesignReport(RFH.getProperty().get(tuuid).split(GlobalClass.ColDelim),RFH.getProplayout(),PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
if(RFH.getRefrence()!=null && RFH.getRefrence().containsKey(tuuid))
{
PDFF.setFontBlack();
PDFF.createTable(120);
DesignReport(RFH.getRefrence().get(tuuid).split(GlobalClass.ColDelim),RFH.getReflayout(),PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
if(RFH.getDedupe()!=null && RFH.getDedupe().containsKey(tuuid))
{
PDFF.setFontBlack();
PDFF.createTable(120);
DesignReport(RFH.getDedupe().get(tuuid).split(GlobalClass.ColDelim),RFH.getDedlayout(),PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
if(RFH.getExtra()!=null && RFH.getExtra().containsKey(tuuid))
{
PDFF.setFontBlack();
PDFF.createTable(120);
DesignReport(RFH.getExtra().get(tuuid).split(GlobalClass.ColDelim),RFH.getExtralayout(),PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
}
}
if(PDFF.getOutput()!=null)
{
PDFF.closeDocument();
if(!getOCid().equals("0"))
{
OCasesTab.put(getOCid(),getPuuid()+GlobalClass.ColDelim+(getFilePath()+getFileName()));
}
}
if(isProcessFlag())
{
FinalizeBanklist(QValsTab, RS.isAutoemail(),RFH.getProcessedOn(), BranchId,RFH.getRunningmode(),OCasesTab,RS.getPortfolioid());
}
if(isProcessFlag())
{
setErrMsg(getErrCode()+"REPGEN:Info:Reports generated successfully."+(RS.isAutoemail() ? "\n\nEmail sent successfully.\n" : ""));
}
}
private void DesignReport(String [] reportData,String [][] reportlayout,PDFFormatter PDFF)
{
int layoutIndex=0;
for(int cindx=8;cindx<reportData.length;cindx++)
{
Image img=null;
PDFF.SetFont(reportlayout[layoutIndex][13], Integer.parseInt(reportlayout[layoutIndex][11]));
PDFF.setFontColor(new BaseColor(Integer.parseInt(reportlayout[layoutIndex][12].split(",")[0]), Integer.parseInt(reportlayout[layoutIndex][12].split(",")[1]), Integer.parseInt(reportlayout[layoutIndex][12].split(",")[2])));
PDFF.setBackColor(new BaseColor(Integer.parseInt(reportlayout[layoutIndex][14].split(",")[0]), Integer.parseInt(reportlayout[layoutIndex][14].split(",")[1]), Integer.parseInt(reportlayout[layoutIndex][14].split(",")[2])));
if(reportData[cindx].equals("{SK!PTH15D@TA}"))
{
layoutIndex++;
continue;
}
if(reportlayout[layoutIndex][2].equals("image"))
{
try
{
img=Image.getInstance(getSignPath()+""+reportData[cindx]);
}catch(Exception exce){}
PDFF.createCell(img, Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
else if(reportlayout[layoutIndex][2].equals("barcode"))
{
PDFF.createBCodeCell(reportData[cindx], Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
else if(reportlayout[layoutIndex][2].equals("pagebreak"))
{
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
else if(reportlayout[layoutIndex][2].equals("photographs"))
{
if(reportData[cindx].length() > 10)
{
String StoragePath = GlobalClass.getStoragePath();
reportData[cindx] = reportData[cindx].substring(0,reportData[cindx].length()-1);
String [] ImgArr = reportData[cindx].split(",");
File f = null;
int vimg=0;
for(int arrIndx=0; arrIndx < ImgArr.length; arrIndx++)
{
f=new File(StoragePath+ImgArr[arrIndx]);
if(f.exists())
{
try
{
img=Image.getInstance(StoragePath+ImgArr[arrIndx]);
int fsize = Integer.parseInt(reportlayout[layoutIndex][11]);
fsize = fsize == 0 ? 1 : fsize;
img.scalePercent(30f);
PDFF.createCell(img, Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
vimg++;
}catch(Exception exce){}
}
}
if(vimg != 0 && vimg%2 != 0)
{
PDFF.createCell("", Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
}
else
{
PDFF.createCell("NO IMAGE", Integer.parseInt(reportlayout[layoutIndex][3]), 120, Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],15,Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
}
else
{
int fstyle=Integer.parseInt(reportlayout[layoutIndex][3]);
if(reportData[cindx].toUpperCase().startsWith("<B>") && reportData[cindx].toUpperCase().endsWith("</B>"))
{
fstyle=1;
reportData[cindx]=reportData[cindx].replace("<b>", "");
reportData[cindx]=reportData[cindx].replace("</b>", "");
}
PDFF.createCell(reportData[cindx], fstyle, Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
layoutIndex++;
}
String disclaimer = " This report is based on information gathered by our field executive/telecaller";
disclaimer += " and Bank is requested to corelate the same with other documents/information on record/gathered";
disclaimer += " by the Bank in the course of complete due diligence/appraisal undertaken by the Bank.";
disclaimer += " Our report should not be the sole criteria for sanction of the loan under reference.";
PDFF.SetFont("TIMES", 6);
PDFF.setFontColor(new BaseColor(0,0,0));
//PDFF.createCell("Disclaimer:",5,8,3,"L",108,3,3,0,0);
//PDFF.createCell(disclaimer,0,112,3,"L",107,3,3,0,0);
PDFF.createCell("Disclaimer:",5,8,3,"L",0,3,3,0,0);
PDFF.createCell(disclaimer,0,112,3,"L",0,3,3,0,0);
}
private void CreateReportFile(String reportType,PDFFormatter PDFF,String filePrefix)
{
int i=0;
setFileName(filePrefix+reportType+"_REP_"+i+".pdf");
while(CheckFileExistence(getFilePath()+getFileName()))
{
i++;
setFileName(filePrefix+reportType+"_REP_"+i+".pdf");
}
if(isProcessFlag())
{
PDFF.CreateFile(getFilePath()+getFileName());
if(!PDFF.isProcessFlag())
{
setProcessFlag(false);
setErrDesc(PDFF.getErrDesc());
setErrMsg(PDFF.getErrMsg());
}
}
}
public void FinalizeBanklist(Hashtable<String, String> QValsTab,boolean isAutoemail,String processedOn,String BranchId,String runningMode,HashMap<String, String> OCasesTab,String Portfolioid)
{
DBFunctions dbf=new DBFunctions(getErrCode());
Set<String> keys=QValsTab.keySet();
String []Qvals=null;
if(OCasesTab.size() > 0)
{
String temp="";
Qvals=new String [4];
Iterator<String> keySetIterator = OCasesTab.keySet().iterator();
while(keySetIterator.hasNext()){
String key = keySetIterator.next();
temp=OCasesTab.get(key);
Qvals[0]=(Qvals[0]==null ? "" : Qvals[0])+""+key+",";
Qvals[1]=(Qvals[1]==null ? "" : Qvals[1])+""+temp.split(GlobalClass.ColDelim)[0]+",";
Qvals[2]=(Qvals[2]==null ? "" : Qvals[2])+""+temp.split(GlobalClass.ColDelim)[1]+",";
}
Qvals[0]=Qvals[0].substring(0,Qvals[0].length()-1);
Qvals[1]=Qvals[1].substring(0,Qvals[1].length()-1);
Qvals[2]=Qvals[2].substring(0,Qvals[2].length()-1);
Qvals[3]=Portfolioid;
dbf.setProcessFlag(true);
dbf.FetchRunQuery(156, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(dbf.getErrMsg()+". Uploading reports failed for one or more cases. Try re-uploading using Tools->Pending Uploads");
setErrDesc(dbf.getErrDesc());
setProcessFlag(true);
}
Qvals=null;
}
for(String key : keys)
{
dbf.setProcessFlag(true);
Qvals=QValsTab.get(key).split(GlobalClass.ColDelim);
Qvals[1]="uuid=''"+Qvals[1].replace(",", "'' or uuid=''")+"''";
dbf.FetchRunQuery(118, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(getErrMsg()+"Final updation failed for some or all cases.");
setErrDesc(dbf.getErrDesc());
setProcessFlag(dbf.isProcessFlag());
break;
}
}
if(!isProcessFlag())
{
setErrMsg(getErrMsg()+"Final updation failed for some or all cases.");
}
else
{
if(isAutoemail)
{
SendReports SR=new SendReports();
SR.setErrCode(getErrCode());
SR.setProcessFlag(true);
SR.SendReportsByBatch(processedOn, BranchId,getUserId(),runningMode);
if (!SR.isProcessFlag())
{
setErrMsg(SR.getErrMsg().replace(getErrCode()+"SEML:warning:", getErrCode()+"SEML:warning:Bank Reports generated successfully.\n\n"));
setErrDesc(SR.getErrDesc());
setProcessFlag(SR.isProcessFlag());
}
}
}
}
private boolean CreateDirectory(String DirPath)
{
try
{
File f=new File(DirPath);
if(!f.isDirectory())
{
return f.mkdirs();
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private boolean CheckFileExistence(String PathToFile)
{
try
{
File f=new File(PathToFile);
if(!f.isFile())
{
return false;
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
}

View File

@@ -0,0 +1,582 @@
package matrix.nimble.operation.output.model;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
import javax.imageio.ImageIO;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.util.Units;
import org.apache.poi.xwpf.usermodel.IBodyElement;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Image;
import com.itextpdf.text.pdf.codec.Base64.InputStream;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.PDFFormatter;
/**
* @author mswami
*
*/
public class CombinedWordlReporting {
private String errMsg;
private String errDesc;
private String errCode;
private boolean processFlag;
private String userId;
private String prevBranch;
private String curBranch;
private boolean filegenerated;
private XWPFDocument reportDocument;
private XWPFTable reportTable;
private String templatePath;
private String fileName;
private String filePath;
private String signPath;
private String oCid;
private String puuid;
public CombinedWordlReporting() {
setProcessFlag(true);
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public String getErrDesc() {
return errDesc;
}
public void setErrDesc(String errDesc) {
this.errDesc = errDesc;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public boolean isProcessFlag() {
return processFlag;
}
public void setProcessFlag(boolean processFlag) {
this.processFlag = processFlag;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPrevBranch() {
return prevBranch;
}
public void setPrevBranch(String prevBranch) {
this.prevBranch = prevBranch;
}
public String getCurBranch() {
return curBranch;
}
public void setCurBranch(String curBranch) {
this.curBranch = curBranch;
}
public XWPFTable getReportTable() {
return reportTable;
}
public void setReportTable(XWPFTable reportTable) {
this.reportTable = reportTable;
}
public XWPFDocument getReportDocument() {
return reportDocument;
}
public void setReportDocument(XWPFDocument reportDocument) {
this.reportDocument = reportDocument;
}
public String getTemplatePath() {
return templatePath;
}
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getSignPath() {
return signPath;
}
public void setSignPath(String signPath) {
this.signPath = signPath;
}
public String getoCid() {
return oCid;
}
public void setoCid(String oCid) {
this.oCid = oCid;
}
public String getPuuid() {
return puuid;
}
public void setPuuid(String puuid) {
this.puuid = puuid;
}
public boolean isFilegenerated() {
return filegenerated;
}
public void setFilegenerated(boolean filegenerated) {
this.filegenerated = filegenerated;
}
public void GenerateBankReports(ReportSettings RS,BankReportHandler RFH,String UserId,String BranchId)
{
Hashtable<String, String> QValsTab=new Hashtable<String, String>();
HashMap<String,String> OCasesTab=new HashMap<String,String>();
String subPath="";
setUserId(UserId);
String Uuids="";
setPrevBranch("");
setFilePath("");
setCurBranch("");
String filePrefix="";
setSignPath(RFH.getSignPath());
int listSize=RS.getCaselist().size();
for(int listIndex=0;listIndex<listSize;listIndex++)
{
setFilegenerated(false);
CaseList clist=(CaseList)RS.getCaselist().get(listIndex);
String tuuid=clist.getUuid();
if(clist.isGenreport())
{
Uuids=tuuid;
filePrefix=RS.getReporttype().equals("3") ? (clist.getCustomername().replaceAll("/| |&", "_")+"_"+clist.getApplno().replaceAll("\\s", "_").replaceAll("/","")+"_") : "";
if(RS.getReportby().equals("1"))
{
setCurBranch(clist.getBranch()+""+clist.getProduct()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getProduct().replaceAll("\\s", "_"));
}
else if(RS.getReportby().equals("2"))
{
setCurBranch(clist.getBranch()+""+clist.getApplno()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getApplno().replaceAll("\\s", "_"));
}
else if(RS.getReportby().equals("3"))
{
setCurBranch(clist.getBranch()+""+clist.getProduct()+""+clist.getApplno()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getProduct().replaceAll("\\s", "_"))+"/"+(clist.getApplno().replaceAll("\\s", "_"));
}
else
{
setCurBranch(clist.getBranch()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"));
}
if (QValsTab.containsKey(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/"))
{
Uuids=Uuids+","+QValsTab.get(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/").split(GlobalClass.ColDelim)[1];
}
QValsTab.put(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/", RFH.getProcessedOn()+GlobalClass.ColDelim+Uuids+GlobalClass.ColDelim+(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/")+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+clist.getBankbranchid()+GlobalClass.ColDelim+(RS.isArchivebatch() ? "1":"0")+GlobalClass.ColDelim+(RFH.getRunningmode())+GlobalClass.ColDelim);
if(!getCurBranch().equals(getPrevBranch()))
{
setPuuid(clist.getUuid());
setoCid(clist.getOnlinecaseid());
setFilePath(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/");
if(CreateDirectory(getFilePath()))
{
if(!isProcessFlag())
{
break;
}
}
else
{
setProcessFlag(false);
break;
}
setPrevBranch(getCurBranch());
}
if(RFH.getExtra()!=null && RFH.getExtra().containsKey(tuuid))
{
setTemplatePath(RFH.getSignPath()+RFH.getTemplatefiles()[0][8]);
CreateReportFile("", filePrefix);
if(!isProcessFlag())
{
break;
}
DesignReport(RFH.getExtra().get(tuuid).split(GlobalClass.ColDelim),RFH.getExtralayout());
}
if(isProcessFlag())
{
if(!getoCid().equals("0"))
{
OCasesTab.put(getoCid(),getPuuid()+GlobalClass.ColDelim+(getFilePath()+getFileName()));
}
}
}
}
if(isProcessFlag())
{
FinalizeBanklist(QValsTab, RS.isAutoemail(),RFH.getProcessedOn(), BranchId,RFH.getRunningmode(),OCasesTab,RS.getPortfolioid());
}
if(isProcessFlag())
{
setErrMsg(getErrCode()+"REPGEN:Info:Reports generated successfully."+(RS.isAutoemail() ? "\n\nEmail sent successfully.\n" : ""));
}
}
private void DesignReport(String [] reportData,String [][] reportlayout)
{
int layoutIndex=0;
XWPFParagraph paragraph;
XWPFRun run = null;
Iterator<IBodyElement> bodyElementIterator = getReportDocument().getBodyElementsIterator();
while(bodyElementIterator.hasNext()) {
IBodyElement element = bodyElementIterator.next();
if("TABLE".equalsIgnoreCase(element.getElementType().name())) {
reportTable = element.getBody().getTables().get(0);
}
}
XWPFTableRow row = null;
XWPFTableCell cell = null;
for(int cindx=8;cindx<reportData.length;cindx++)
{
Image img=null;
reportData[cindx] = reportData[cindx].replace("<lbr3@k>", "\n");
int rownumber = Integer.parseInt(reportlayout[layoutIndex][15]);
int cellnumber = Integer.parseInt(reportlayout[layoutIndex][10]);
row = reportTable.getRow(rownumber);
cell = row.getCell(cellnumber);
paragraph = cell.getParagraphs().get(0);
run = paragraph.createRun();
run.setFontSize(Integer.parseInt(reportlayout[layoutIndex][11]));
if(!reportlayout[layoutIndex][13].toUpperCase().equals("DEFAULT"))
{
run.setFontFamily(reportlayout[layoutIndex][13]);
}
if(reportlayout[layoutIndex][2].equals("image"))
{
try
{
FileInputStream fis = new FileInputStream(getSignPath()+""+reportData[cindx]);
run.addPicture(fis, XWPFDocument.PICTURE_TYPE_PNG, "docimage", Units.toEMU(Integer.parseInt(reportlayout[layoutIndex][5])), Units.toEMU(Integer.parseInt(reportlayout[layoutIndex][7])));
}
catch(Exception exce)
{
}
}
else if(reportlayout[layoutIndex][2].equals("photographs"))
{
if(reportData[cindx].length() > 10)
{
String StoragePath = GlobalClass.getStoragePath();
reportData[cindx] = reportData[cindx].substring(0,reportData[cindx].length()-1);
String [] ImgArr = reportData[cindx].split(",");
File f = null;
int vimg=0;
URL url;
BufferedImage image;
Dimension dim;
ByteArrayOutputStream bout;
ByteArrayInputStream bin;
for(int arrIndx=0; arrIndx < ImgArr.length; arrIndx++)
{
f=new File(StoragePath+ImgArr[arrIndx]);
if(vimg == 6) {
break;
}
if(f.exists())
{
try
{
/*CTRow ctrow = CTRow.Factory.parse(row.getCtRow().newInputStream());
XWPFTableRow newrow = new XWPFTableRow(ctrow, reportTable);
cell = newrow.getCell(cellnumber);
reportTable.addRow(newrow, rownumber + 1);
mergeCellsHorizontal(reportTable,rownumber + 1,0,2);*/
if(arrIndx%2 == 0) {
rownumber = rownumber + vimg;
vimg = 1;
}
row = reportTable.getRow(rownumber);
cell = row.getCell(arrIndx%2);
paragraph = cell.getParagraphs().get(0);
java.io.InputStream stream = new BufferedInputStream(new FileInputStream(StoragePath+ImgArr[arrIndx]));
System.out.println(StoragePath+ImgArr[arrIndx]);
//url = new URL(StoragePath+ImgArr[arrIndx]);
image = ImageIO.read(stream);
dim = new Dimension(image.getWidth(), image.getHeight());
double width = dim.getWidth();
double height = dim.getHeight();
double scaling = 1.0;
double maxwidth = Integer.parseInt(reportlayout[layoutIndex][5]); //Maximum image width in inch
if (width > 72*maxwidth) scaling = (72*maxwidth)/width; //scale width not to be greater than maxwidth in inches
bout = new ByteArrayOutputStream();
ImageIO.write(image, "jpeg", bout);
bout.flush();
bin = new ByteArrayInputStream(bout.toByteArray());
run = paragraph.createRun();
run.addPicture(bin, XWPFDocument.PICTURE_TYPE_JPEG, "visitphotographs",
Units.toEMU(width*scaling), Units.toEMU(height*scaling));
run.getCTR().getDrawingArray(0).getInlineArray(0).addNewCNvGraphicFramePr().addNewGraphicFrameLocks().setNoChangeAspect(true);
}catch(Exception exce){}
}
}
}
}
else
{
run.setText(reportData[cindx]);
}
layoutIndex++;
}
/*String disclaimer = " This report is based on information gathered by our field executive/telecaller.";
disclaimer += " The Bank/NBFC is requested to corelate the same with documents/information on record/gathered";
disclaimer += " by them in the course of complete due diligence/appraisal being undertaken by the Bank/NBFC.";
disclaimer += " Our report should not be the sole criteria for sanction of the loan under reference.";
row = getReportSheet().getRow(Integer.parseInt(reportlayout[layoutIndex-1][15])+1);
cell = row.getCell(0);
if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) {
if (cell == null) {
cell = row.createCell(0);
}
}
cell.setCellValue(disclaimer);*/
WriteFile(getReportDocument());
}
private void WriteFile(XWPFDocument filledDocument)
{
try
{
FileOutputStream out = new FileOutputStream(getFilePath()+getFileName());
filledDocument.write(out);
out.close();
setFilegenerated(true);
}catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"error:File save operation failed."+exce.getMessage());
}
}
public void FinalizeBanklist(Hashtable<String, String> QValsTab,boolean isAutoemail,String processedOn,String BranchId,String runningMode,HashMap<String, String> OCasesTab,String Portfolioid)
{
DBFunctions dbf=new DBFunctions(getErrCode());
Set<String> keys=QValsTab.keySet();
String []Qvals=null;
if(OCasesTab.size() > 0)
{
String temp="";
Qvals=new String [4];
Iterator<String> keySetIterator = OCasesTab.keySet().iterator();
while(keySetIterator.hasNext()){
String key = keySetIterator.next();
temp=OCasesTab.get(key);
Qvals[0]=(Qvals[0]==null ? "" : Qvals[0])+""+key+",";
Qvals[1]=(Qvals[1]==null ? "" : Qvals[1])+""+temp.split(GlobalClass.ColDelim)[0]+",";
Qvals[2]=(Qvals[2]==null ? "" : Qvals[2])+""+temp.split(GlobalClass.ColDelim)[1]+",";
}
Qvals[0]=Qvals[0].substring(0,Qvals[0].length()-1);
Qvals[1]=Qvals[1].substring(0,Qvals[1].length()-1);
Qvals[2]=Qvals[2].substring(0,Qvals[2].length()-1);
Qvals[3]=Portfolioid;
dbf.setProcessFlag(true);
dbf.FetchRunQuery(156, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(dbf.getErrMsg()+". Uploading reports failed for one or more cases. Try re-uploading using Tools->Pending Uploads");
setErrDesc(dbf.getErrDesc());
setProcessFlag(true);
}
Qvals=null;
}
for(String key : keys)
{
dbf.setProcessFlag(true);
Qvals=QValsTab.get(key).split(GlobalClass.ColDelim);
Qvals[1]="uuid=''"+Qvals[1].replace(",", "'' or uuid=''")+"''";
dbf.FetchRunQuery(118, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(getErrMsg()+"Final updation failed for some or all cases.");
setErrDesc(dbf.getErrDesc());
setProcessFlag(dbf.isProcessFlag());
break;
}
}
if(!isProcessFlag())
{
setErrMsg(getErrMsg()+"Final updation failed for some or all cases.");
}
else
{
if(isAutoemail)
{
SendReports SR=new SendReports();
SR.setErrCode(getErrCode());
SR.setProcessFlag(true);
SR.SendReportsByBatch(processedOn, BranchId,getUserId(),runningMode);
if (!SR.isProcessFlag())
{
setErrMsg(SR.getErrMsg().replace(getErrCode()+"SEML:warning:", getErrCode()+"SEML:warning:Bank Reports generated successfully.\n\n"));
setErrDesc(SR.getErrDesc());
setProcessFlag(SR.isProcessFlag());
}
}
}
}
private void CreateReportFile(String reportType,String filePrefix)
{
int i=0;
setFileName(filePrefix+reportType+"_REP_"+i+".docx");
while(CheckFileExistence(getFilePath()+getFileName()))
{
i++;
setFileName(filePrefix+reportType+"_REP_"+i+".docx");
}
if(isProcessFlag())
{
try
{
setReportDocument(new XWPFDocument(OPCPackage.openOrCreate(new File(getTemplatePath()))));
}
catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"error:Excel creation failed."+exce.getMessage());
}
}
}
private boolean CreateDirectory(String DirPath)
{
try
{
File f=new File(DirPath);
if(!f.isDirectory())
{
return f.mkdirs();
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private boolean CheckFileExistence(String PathToFile)
{
try
{
File f=new File(PathToFile);
if(!f.isFile())
{
return false;
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private void mergeCellsHorizontal(XWPFTable table, int row, int fromCell, int toCell) {
for (int cellIndex = fromCell; cellIndex <= toCell; cellIndex++) {
XWPFTableCell cell = table.getRow(row).getCell(cellIndex);
if ( cellIndex == fromCell ) {
// The first merged cell is set with RESTART merge value
cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.RESTART);
} else {
// Cells which join (merge) the first one, are set with CONTINUE
cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.CONTINUE);
}
}
}
}

View File

@@ -0,0 +1,582 @@
package matrix.nimble.operation.output.model;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
import javax.imageio.ImageIO;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.util.Units;
import org.apache.poi.xwpf.usermodel.IBodyElement;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Image;
import com.itextpdf.text.pdf.codec.Base64.InputStream;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.PDFFormatter;
/**
* @author mswami
*
*/
public class CombinedWordlReportingTabular {
private String errMsg;
private String errDesc;
private String errCode;
private boolean processFlag;
private String userId;
private String prevBranch;
private String curBranch;
private boolean filegenerated;
private XWPFDocument reportDocument;
private XWPFTable reportTable;
private String templatePath;
private String fileName;
private String filePath;
private String signPath;
private String oCid;
private String puuid;
public CombinedWordlReportingTabular() {
setProcessFlag(true);
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public String getErrDesc() {
return errDesc;
}
public void setErrDesc(String errDesc) {
this.errDesc = errDesc;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public boolean isProcessFlag() {
return processFlag;
}
public void setProcessFlag(boolean processFlag) {
this.processFlag = processFlag;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPrevBranch() {
return prevBranch;
}
public void setPrevBranch(String prevBranch) {
this.prevBranch = prevBranch;
}
public String getCurBranch() {
return curBranch;
}
public void setCurBranch(String curBranch) {
this.curBranch = curBranch;
}
public XWPFTable getReportTable() {
return reportTable;
}
public void setReportTable(XWPFTable reportTable) {
this.reportTable = reportTable;
}
public XWPFDocument getReportDocument() {
return reportDocument;
}
public void setReportDocument(XWPFDocument reportDocument) {
this.reportDocument = reportDocument;
}
public String getTemplatePath() {
return templatePath;
}
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getSignPath() {
return signPath;
}
public void setSignPath(String signPath) {
this.signPath = signPath;
}
public String getoCid() {
return oCid;
}
public void setoCid(String oCid) {
this.oCid = oCid;
}
public String getPuuid() {
return puuid;
}
public void setPuuid(String puuid) {
this.puuid = puuid;
}
public boolean isFilegenerated() {
return filegenerated;
}
public void setFilegenerated(boolean filegenerated) {
this.filegenerated = filegenerated;
}
public void GenerateBankReports(ReportSettings RS,BankReportHandler RFH,String UserId,String BranchId)
{
Hashtable<String, String> QValsTab=new Hashtable<String, String>();
HashMap<String,String> OCasesTab=new HashMap<String,String>();
String subPath="";
setUserId(UserId);
String Uuids="";
setPrevBranch("");
setFilePath("");
setCurBranch("");
String filePrefix="";
setSignPath(RFH.getSignPath());
int listSize=RS.getCaselist().size();
for(int listIndex=0;listIndex<listSize;listIndex++)
{
setFilegenerated(false);
CaseList clist=(CaseList)RS.getCaselist().get(listIndex);
String tuuid=clist.getUuid();
if(clist.isGenreport())
{
Uuids=tuuid;
filePrefix=RS.getReporttype().equals("3") ? (clist.getCustomername().replaceAll("/| |&", "_")+"_"+clist.getApplno().replaceAll("\\s", "_").replaceAll("/","")+"_") : "";
if(RS.getReportby().equals("1"))
{
setCurBranch(clist.getBranch()+""+clist.getProduct()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getProduct().replaceAll("\\s", "_"));
}
else if(RS.getReportby().equals("2"))
{
setCurBranch(clist.getBranch()+""+clist.getApplno()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getApplno().replaceAll("\\s", "_"));
}
else if(RS.getReportby().equals("3"))
{
setCurBranch(clist.getBranch()+""+clist.getProduct()+""+clist.getApplno()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(clist.getProduct().replaceAll("\\s", "_"))+"/"+(clist.getApplno().replaceAll("\\s", "_"));
}
else
{
setCurBranch(clist.getBranch()+""+filePrefix);
subPath=(clist.getBranch().replaceAll("\\s", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"));
}
if (QValsTab.containsKey(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/"))
{
Uuids=Uuids+","+QValsTab.get(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/").split(GlobalClass.ColDelim)[1];
}
QValsTab.put(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/", RFH.getProcessedOn()+GlobalClass.ColDelim+Uuids+GlobalClass.ColDelim+(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/")+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+clist.getBankbranchid()+GlobalClass.ColDelim+(RS.isArchivebatch() ? "1":"0")+GlobalClass.ColDelim+(RFH.getRunningmode())+GlobalClass.ColDelim);
if(!getCurBranch().equals(getPrevBranch()))
{
setPuuid(clist.getUuid());
setoCid(clist.getOnlinecaseid());
setFilePath(RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+subPath+"/");
if(CreateDirectory(getFilePath()))
{
if(!isProcessFlag())
{
break;
}
}
else
{
setProcessFlag(false);
break;
}
setPrevBranch(getCurBranch());
}
if(RFH.getExtra()!=null && RFH.getExtra().containsKey(tuuid))
{
setTemplatePath(RFH.getSignPath()+RFH.getTemplatefiles()[0][8]);
CreateReportFile("", filePrefix);
if(!isProcessFlag())
{
break;
}
DesignReport(RFH.getExtra().get(tuuid).split(GlobalClass.ColDelim),RFH.getExtralayout());
}
if(isProcessFlag())
{
if(!getoCid().equals("0"))
{
OCasesTab.put(getoCid(),getPuuid()+GlobalClass.ColDelim+(getFilePath()+getFileName()));
}
}
}
}
if(isProcessFlag())
{
FinalizeBanklist(QValsTab, RS.isAutoemail(),RFH.getProcessedOn(), BranchId,RFH.getRunningmode(),OCasesTab,RS.getPortfolioid());
}
if(isProcessFlag())
{
setErrMsg(getErrCode()+"REPGEN:Info:Reports generated successfully."+(RS.isAutoemail() ? "\n\nEmail sent successfully.\n" : ""));
}
}
private void DesignReport(String [] reportData,String [][] reportlayout)
{
int layoutIndex=0;
XWPFParagraph paragraph;
XWPFRun run = null;
Iterator<IBodyElement> bodyElementIterator = getReportDocument().getBodyElementsIterator();
while(bodyElementIterator.hasNext()) {
IBodyElement element = bodyElementIterator.next();
if("TABLE".equalsIgnoreCase(element.getElementType().name())) {
reportTable = element.getBody().getTables().get(0);
}
}
XWPFTableRow row = null;
XWPFTableCell cell = null;
for(int cindx=8;cindx<reportData.length;cindx++)
{
Image img=null;
reportData[cindx] = reportData[cindx].replace("<lbr3@k>", "\n");
int rownumber = Integer.parseInt(reportlayout[layoutIndex][15]);
int cellnumber = Integer.parseInt(reportlayout[layoutIndex][10]);
row = reportTable.getRow(rownumber);
cell = row.getCell(cellnumber);
paragraph = cell.getParagraphs().get(0);
run = paragraph.createRun();
run.setFontSize(Integer.parseInt(reportlayout[layoutIndex][11]));
if(!reportlayout[layoutIndex][13].toUpperCase().equals("DEFAULT"))
{
run.setFontFamily(reportlayout[layoutIndex][13]);
}
if(reportlayout[layoutIndex][2].equals("image"))
{
try
{
FileInputStream fis = new FileInputStream(getSignPath()+""+reportData[cindx]);
run.addPicture(fis, XWPFDocument.PICTURE_TYPE_PNG, "docimage", Units.toEMU(Integer.parseInt(reportlayout[layoutIndex][5])), Units.toEMU(Integer.parseInt(reportlayout[layoutIndex][7])));
}
catch(Exception exce)
{
}
}
else if(reportlayout[layoutIndex][2].equals("photographs"))
{
if(reportData[cindx].length() > 10)
{
String StoragePath = GlobalClass.getStoragePath();
reportData[cindx] = reportData[cindx].substring(0,reportData[cindx].length()-1);
String [] ImgArr = reportData[cindx].split(",");
File f = null;
int vimg=0;
URL url;
BufferedImage image;
Dimension dim;
ByteArrayOutputStream bout;
ByteArrayInputStream bin;
for(int arrIndx=0; arrIndx < ImgArr.length; arrIndx++)
{
f=new File(StoragePath+ImgArr[arrIndx]);
if(vimg == 6) {
break;
}
if(f.exists())
{
try
{
/*CTRow ctrow = CTRow.Factory.parse(row.getCtRow().newInputStream());
XWPFTableRow newrow = new XWPFTableRow(ctrow, reportTable);
cell = newrow.getCell(cellnumber);
reportTable.addRow(newrow, rownumber + 1);
mergeCellsHorizontal(reportTable,rownumber + 1,0,2);*/
if(arrIndx%2 == 0) {
rownumber = rownumber + vimg;
vimg = 1;
}
row = reportTable.getRow(rownumber);
cell = row.getCell(arrIndx%2);
paragraph = cell.getParagraphs().get(0);
java.io.InputStream stream = new BufferedInputStream(new FileInputStream(StoragePath+ImgArr[arrIndx]));
System.out.println(StoragePath+ImgArr[arrIndx]);
//url = new URL(StoragePath+ImgArr[arrIndx]);
image = ImageIO.read(stream);
dim = new Dimension(image.getWidth(), image.getHeight());
double width = dim.getWidth();
double height = dim.getHeight();
double scaling = 1.0;
double maxwidth = Integer.parseInt(reportlayout[layoutIndex][5]); //Maximum image width in inch
if (width > 72*maxwidth) scaling = (72*maxwidth)/width; //scale width not to be greater than maxwidth in inches
bout = new ByteArrayOutputStream();
ImageIO.write(image, "jpeg", bout);
bout.flush();
bin = new ByteArrayInputStream(bout.toByteArray());
run = paragraph.createRun();
run.addPicture(bin, XWPFDocument.PICTURE_TYPE_JPEG, "visitphotographs",
Units.toEMU(width*scaling), Units.toEMU(height*scaling));
run.getCTR().getDrawingArray(0).getInlineArray(0).addNewCNvGraphicFramePr().addNewGraphicFrameLocks().setNoChangeAspect(true);
}catch(Exception exce){}
}
}
}
}
else
{
run.setText(reportData[cindx]);
}
layoutIndex++;
}
/*String disclaimer = " This report is based on information gathered by our field executive/telecaller.";
disclaimer += " The Bank/NBFC is requested to corelate the same with documents/information on record/gathered";
disclaimer += " by them in the course of complete due diligence/appraisal being undertaken by the Bank/NBFC.";
disclaimer += " Our report should not be the sole criteria for sanction of the loan under reference.";
row = getReportSheet().getRow(Integer.parseInt(reportlayout[layoutIndex-1][15])+1);
cell = row.getCell(0);
if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) {
if (cell == null) {
cell = row.createCell(0);
}
}
cell.setCellValue(disclaimer);*/
WriteFile(getReportDocument());
}
private void WriteFile(XWPFDocument filledDocument)
{
try
{
FileOutputStream out = new FileOutputStream(getFilePath()+getFileName());
filledDocument.write(out);
out.close();
setFilegenerated(true);
}catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"error:File save operation failed."+exce.getMessage());
}
}
public void FinalizeBanklist(Hashtable<String, String> QValsTab,boolean isAutoemail,String processedOn,String BranchId,String runningMode,HashMap<String, String> OCasesTab,String Portfolioid)
{
DBFunctions dbf=new DBFunctions(getErrCode());
Set<String> keys=QValsTab.keySet();
String []Qvals=null;
if(OCasesTab.size() > 0)
{
String temp="";
Qvals=new String [4];
Iterator<String> keySetIterator = OCasesTab.keySet().iterator();
while(keySetIterator.hasNext()){
String key = keySetIterator.next();
temp=OCasesTab.get(key);
Qvals[0]=(Qvals[0]==null ? "" : Qvals[0])+""+key+",";
Qvals[1]=(Qvals[1]==null ? "" : Qvals[1])+""+temp.split(GlobalClass.ColDelim)[0]+",";
Qvals[2]=(Qvals[2]==null ? "" : Qvals[2])+""+temp.split(GlobalClass.ColDelim)[1]+",";
}
Qvals[0]=Qvals[0].substring(0,Qvals[0].length()-1);
Qvals[1]=Qvals[1].substring(0,Qvals[1].length()-1);
Qvals[2]=Qvals[2].substring(0,Qvals[2].length()-1);
Qvals[3]=Portfolioid;
dbf.setProcessFlag(true);
dbf.FetchRunQuery(156, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(dbf.getErrMsg()+". Uploading reports failed for one or more cases. Try re-uploading using Tools->Pending Uploads");
setErrDesc(dbf.getErrDesc());
setProcessFlag(true);
}
Qvals=null;
}
for(String key : keys)
{
dbf.setProcessFlag(true);
Qvals=QValsTab.get(key).split(GlobalClass.ColDelim);
Qvals[1]="uuid=''"+Qvals[1].replace(",", "'' or uuid=''")+"''";
dbf.FetchRunQuery(118, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(getErrMsg()+"Final updation failed for some or all cases.");
setErrDesc(dbf.getErrDesc());
setProcessFlag(dbf.isProcessFlag());
break;
}
}
if(!isProcessFlag())
{
setErrMsg(getErrMsg()+"Final updation failed for some or all cases.");
}
else
{
if(isAutoemail)
{
SendReports SR=new SendReports();
SR.setErrCode(getErrCode());
SR.setProcessFlag(true);
SR.SendReportsByBatch(processedOn, BranchId,getUserId(),runningMode);
if (!SR.isProcessFlag())
{
setErrMsg(SR.getErrMsg().replace(getErrCode()+"SEML:warning:", getErrCode()+"SEML:warning:Bank Reports generated successfully.\n\n"));
setErrDesc(SR.getErrDesc());
setProcessFlag(SR.isProcessFlag());
}
}
}
}
private void CreateReportFile(String reportType,String filePrefix)
{
int i=0;
setFileName(filePrefix+reportType+"_REP_"+i+".docx");
while(CheckFileExistence(getFilePath()+getFileName()))
{
i++;
setFileName(filePrefix+reportType+"_REP_"+i+".docx");
}
if(isProcessFlag())
{
try
{
setReportDocument(new XWPFDocument(OPCPackage.openOrCreate(new File(getTemplatePath()))));
}
catch(Exception exce)
{
setProcessFlag(false);
setErrDesc(exce.getMessage());
setErrMsg(getErrCode()+"error:Excel creation failed."+exce.getMessage());
}
}
}
private boolean CreateDirectory(String DirPath)
{
try
{
File f=new File(DirPath);
if(!f.isDirectory())
{
return f.mkdirs();
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private boolean CheckFileExistence(String PathToFile)
{
try
{
File f=new File(PathToFile);
if(!f.isFile())
{
return false;
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private void mergeCellsHorizontal(XWPFTable table, int row, int fromCell, int toCell) {
for (int cellIndex = fromCell; cellIndex <= toCell; cellIndex++) {
XWPFTableCell cell = table.getRow(row).getCell(cellIndex);
if ( cellIndex == fromCell ) {
// The first merged cell is set with RESTART merge value
cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.RESTART);
} else {
// Cells which join (merge) the first one, are set with CONTINUE
cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.CONTINUE);
}
}
}
}

View File

@@ -0,0 +1,268 @@
package matrix.nimble.operation.output.model;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import matrix.nimble.utilities.CommonFunctions;
import matrix.nimble.utilities.ExcelFormatter;
public class ExcelTrackers {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String fontfamily;
private String outfile;
private int fontsize;
private boolean createborder;
private String [][] headers;
private String [][] footers;
private String breakup;
private String pbreakup;
private String ppath;
public String getFontfamily() {
return fontfamily;
}
public void setFontfamily(String fontfamily) {
this.fontfamily = fontfamily;
}
public int getFontsize() {
return fontsize;
}
public void setFontsize(int fontsize) {
this.fontsize = fontsize;
}
public boolean isCreateborder() {
return createborder;
}
public void setCreateborder(boolean createborder) {
this.createborder = createborder;
}
public String[][] getHeaders() {
return headers;
}
public void setHeaders(String[][] headers) {
this.headers = headers;
}
public String[][] getFooters() {
return footers;
}
public void setFooters(String[][] footers) {
this.footers = footers;
}
public String getOutfile() {
return outfile;
}
public void setOutfile(String outfile) {
this.outfile = outfile;
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getBreakup() {
return breakup;
}
public void setBreakup(String breakup) {
this.breakup = breakup;
}
public String getPbreakup() {
return pbreakup;
}
public void setPbreakup(String pbreakup) {
this.pbreakup = pbreakup;
}
public String getPpath() {
return ppath;
}
public void setPpath(String ppath) {
this.ppath = ppath;
}
public void BanklistTracker(ReportSettings RS,BankReportHandler RFH)
{
setBreakup("");
setPbreakup("");
setPpath("");
int TotRow=0;
String [][] TrackerData=RFH.getTracker();
List<String[]> rowData=new ArrayList<String[]>();
String subpath="";
CommonFunctions comFunc=new CommonFunctions();
comFunc.setErrCode(getErrCode());
comFunc.setProcessFlag(true);
for(int Rindx=0;Rindx<TrackerData.length;Rindx++)
{
if(RS.getReportby().equals("1"))
{
setBreakup(TrackerData[Rindx][1]+""+TrackerData[Rindx][2]);
subpath=(TrackerData[Rindx][1].replace(" ", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(TrackerData[Rindx][2].replace(" ", "_"));
}
else if(RS.getReportby().equals("2"))
{
setBreakup(TrackerData[Rindx][1]+""+TrackerData[Rindx][4]);
subpath=(TrackerData[Rindx][1].replace(" ", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(TrackerData[Rindx][4].replace(" ", "_"));
}
else if(RS.getReportby().equals("3"))
{
setBreakup(TrackerData[Rindx][1]+""+TrackerData[Rindx][2]+""+TrackerData[Rindx][4]);
subpath=(TrackerData[Rindx][1].replace(" ", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"))+"/"+(TrackerData[Rindx][2].replace(" ", "_"))+"/"+(TrackerData[Rindx][4].replace(" ", "_"));
}
else
{
setBreakup(TrackerData[Rindx][1]);
subpath=(TrackerData[Rindx][1].replace(" ", "_"))+"/"+(RFH.getProcessedOn().replaceAll("/| |:", "_"));
}
if(!getPbreakup().toUpperCase().equals(getBreakup().toUpperCase()))
{
setPbreakup(getBreakup());
if(TotRow > 0)
{
GenerateTracker(rowData,TrackerData[0].length, RFH.getSignPath()+""+RS.getTemplatefile(), 1, 1, RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+getPpath()+"/");
if(isProcessFlag())
{
rowData=new ArrayList<String[]>();
}
else
{
RFH.setProcessFlag(false);
RFH.setErrMsg(getErrMsg());
RFH.setErrDesc(getErrDesc());
break;
}
}
setPpath(subpath);
}
TotRow=TotRow+1;
rowData.add(TrackerData[Rindx]);
}
if(rowData.size() > 0)
{
GenerateTracker(rowData,TrackerData[0].length, RFH.getSignPath()+""+RS.getTemplatefile(), 1, 1, RFH.getRootPath()+RFH.getCurDate()+"/"+RS.getPortfolioid()+"/"+getPpath()+"/");
if(isProcessFlag())
{
rowData=new ArrayList<String[]>();
}
else
{
RFH.setProcessFlag(false);
RFH.setErrMsg(getErrMsg());
RFH.setErrDesc(getErrDesc());
}
}
}
private void GenerateTracker(List<String[]> rowData,int Cols,String TemplateFile,int StartRow,int StartCol,String SubPath)
{
String [][] SubData=new String[rowData.size()][Cols];
ExcelFormatter ExlF=new ExcelFormatter();
ExlF.setCreateborder(isCreateborder());
ExlF.setProcessFlag(true);
for(int indx=0;indx<rowData.size();indx++)
{
SubData[indx]=rowData.get(indx);
}
setOutfile(SubPath);
if(CreateDirectory(getOutfile()))
{
int i=1;
setOutfile(SubPath+"Tracker.xls");
while(CheckFileExistence(getOutfile()))
{
setOutfile(SubPath+"Tracker_"+i+".xls");
}
if(isProcessFlag())
{
ExlF.GenerateTracker(SubData, TemplateFile, 1, 1,getOutfile());
if(!ExlF.isProcessFlag())
{
setProcessFlag(false);
setErrMsg(ExlF.getErrMsg());
setErrDesc(ExlF.getErrDesc());
}
else
{
setProcessFlag(true);
setErrMsg(getErrCode()+"TRKGEN:Info:Tracker generated successfully");
}
}
else
{
setProcessFlag(false);
setErrMsg(getErrMsg());
setErrDesc(getErrDesc());
}
}
else
{
setProcessFlag(false);
setErrMsg(getErrMsg());
setErrDesc(getErrDesc());
}
}
private boolean CreateDirectory(String DirPath)
{
try
{
File f=new File(DirPath);
if(!f.isDirectory())
{
return f.mkdirs();
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private boolean CheckFileExistence(String PathToFile)
{
try
{
File f=new File(PathToFile);
if(!f.isFile())
{
return false;
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
}

View File

@@ -0,0 +1,463 @@
package matrix.nimble.operation.output.model;
import java.io.File;
import java.util.Hashtable;
import java.util.Set;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Image;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.PDFFormatter;
public class PartWiseReporting {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String UserId;
private String PrevBranch;
private String CurBranch;
private Image QRCodeFile;
private String FileName;
private String FilePath;
private String SignPath;
private PDFFormatter PDFFile;
private Hashtable<String, String> QValsTab;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public PDFFormatter getPDFFile() {
return PDFFile;
}
public void setPDFFile(PDFFormatter pDFFile) {
PDFFile = pDFFile;
}
public String getPrevBranch() {
return PrevBranch;
}
public void setPrevBranch(String prevBranch) {
PrevBranch = prevBranch;
}
public String getCurBranch() {
return CurBranch;
}
public void setCurBranch(String curBranch) {
CurBranch = curBranch;
}
public String getFileName() {
return FileName;
}
public void setFileName(String fileName) {
FileName = fileName;
}
public String getFilePath() {
return FilePath;
}
public void setFilePath(String filePath) {
FilePath = filePath;
}
public String getSignPath() {
return SignPath;
}
public void setSignPath(String signPath) {
SignPath = signPath;
}
public Image getQRCodeFile() {
return QRCodeFile;
}
public void setQRCodeFile(Image qRCodeFile) {
QRCodeFile = qRCodeFile;
}
public Hashtable<String, String> getQValsTab() {
return QValsTab;
}
public void setQValsTab(Hashtable<String, String> qValsTab) {
QValsTab = qValsTab;
}
public String getUserId() {
return UserId;
}
public void setUserId(String userId) {
UserId = userId;
}
public void GenerateBankReports(ReportSettings RS,BankReportHandler RFH,String UserId,String BranchId)
{
Hashtable<String, String> QValsTab=new Hashtable<String, String>();
setQValsTab(QValsTab);
setUserId(UserId);
BankReportHandler rfh=RFH;
ReportSettings rs=RS;
setSignPath(rfh.getSignPath());
if(rfh.getRreport()!=null && rfh.getRreport().length > 0)
{
CreateReport(rfh.getRreport(),rfh.getResilayout(),"RES",rfh.getRootPath(),rfh.getCurDate(),rfh.getProcessedOn(),rs.getReportby(),rs.getReporttype(),UserId,BranchId,RS.isArchivebatch(),rfh.getRunningmode(),RS.getPortfolioid());
}
if(rfh.getOreport()!=null && rfh.getOreport().length > 0)
{
CreateReport(rfh.getOreport(),rfh.getOfflayout(),"OFF",rfh.getRootPath(),rfh.getCurDate(),rfh.getProcessedOn(),rs.getReportby(),rs.getReporttype(),UserId,BranchId,RS.isArchivebatch(),rfh.getRunningmode(),RS.getPortfolioid());
}
if(rfh.getOsareport()!=null && rfh.getOsareport().length > 0)
{
CreateReport(rfh.getOsareport(),rfh.getOffsalayout(),"OFF",rfh.getRootPath(),rfh.getCurDate(),rfh.getProcessedOn(),rs.getReportby(),rs.getReporttype(),UserId,BranchId,RS.isArchivebatch(),rfh.getRunningmode(),RS.getPortfolioid());
}
if(rfh.getTreport()!=null && rfh.getTreport().length > 0)
{
CreateReport(rfh.getTreport(),rfh.getTvrlayout(),"TEL",rfh.getRootPath(),rfh.getCurDate(),rfh.getProcessedOn(),rs.getReportby(),rs.getReporttype(),UserId,BranchId,RS.isArchivebatch(),rfh.getRunningmode(),RS.getPortfolioid());
}
if(rfh.getRtreport()!=null && rfh.getRtreport().length > 0)
{
CreateReport(rfh.getRtreport(),rfh.getReflayout(),"REF",rfh.getRootPath(),rfh.getCurDate(),rfh.getProcessedOn(),rs.getReportby(),rs.getReporttype(),UserId,BranchId,RS.isArchivebatch(),rfh.getRunningmode(),RS.getPortfolioid());
}
if(rfh.getPreport()!=null && rfh.getPreport().length > 0)
{
CreateReport(rfh.getPreport(),rfh.getProplayout(),"OTH",rfh.getRootPath(),rfh.getCurDate(),rfh.getProcessedOn(),rs.getReportby(),rs.getReporttype(),UserId,BranchId,RS.isArchivebatch(),rfh.getRunningmode(),RS.getPortfolioid());
}
if(rfh.getDdreport()!=null && rfh.getDdreport().length > 0)
{
CreateReport(rfh.getDdreport(),rfh.getDedlayout(),"DED",rfh.getRootPath(),rfh.getCurDate(),rfh.getProcessedOn(),rs.getReportby(),rs.getReporttype(),UserId,BranchId,RS.isArchivebatch(),rfh.getRunningmode(),RS.getPortfolioid());
}
if(rfh.getExtrareport()!=null && rfh.getExtrareport().length > 0)
{
CreateReport(rfh.getExtrareport(),rfh.getExtralayout(),"EXT",rfh.getRootPath(),rfh.getCurDate(),rfh.getProcessedOn(),rs.getReportby(),rs.getReporttype(),UserId,BranchId,RS.isArchivebatch(),rfh.getRunningmode(),RS.getPortfolioid());
}
if(isProcessFlag())
{
FinalizeBanklist(getQValsTab(), RS.isAutoemail(),RFH.getProcessedOn(),BranchId,RFH.getRunningmode());
}
if(isProcessFlag())
{
setErrMsg(getErrCode()+"REPGEN:Info:Reports generated successfully."+(RS.isAutoemail() ? "\n\nEmail sent successfully.\n" : ""));
}
}
private boolean CreateReport(String [][] reportData,String [][] reportlayout,String reportType,String rootPath,String curDate,String processedOn,String reportBy,String repType,String UserId,String BranchId,boolean isArchive,String runningMode,String portfolioid)
{
String subPath="";
String Uuids="";
setPrevBranch("");
setFilePath("");
String filePrefix="";
PDFFormatter PDFF=new PDFFormatter();
PDFF.setErrCode(getErrCode());
PDFF.setProcessFlag(true);
for(int Index=0;Index<reportData.length;Index++)
{
Uuids=reportData[Index][0];
filePrefix=repType.equals("1") ? (reportData[Index][6].replaceAll("/| |&", "_")+"_"+reportData[Index][5].replaceAll("\\s", "_")+"_") : "";
if(reportBy.equals("1"))
{
setCurBranch(reportData[Index][3]+""+reportData[Index][1]+""+filePrefix);
subPath=(reportData[Index][3].replaceAll("\\s", "_"))+"/"+(processedOn.replaceAll("/| |:", "_"))+"/"+(reportData[Index][1].replaceAll("\\s", "_"));
}
else if(reportBy.equals("2"))
{
setCurBranch(reportData[Index][3]+""+reportData[Index][5]+""+filePrefix);
subPath=(reportData[Index][3].replaceAll("\\s", "_"))+"/"+(processedOn.replaceAll("/| |:", "_"))+"/"+(reportData[Index][5].replaceAll("\\s", "_"));
}
else if(reportBy.equals("3"))
{
setCurBranch(reportData[Index][3]+""+reportData[Index][1]+""+reportData[Index][5]+""+filePrefix);
subPath=(reportData[Index][3].replaceAll("\\s", "_"))+"/"+(processedOn.replaceAll("/| |:", "_"))+"/"+(reportData[Index][1].replaceAll("\\s", "_"))+"/"+(reportData[Index][5].replaceAll("\\s", "_"));
}
else
{
setCurBranch(reportData[Index][3]+""+filePrefix);
subPath=(reportData[Index][3].replaceAll("\\s", "_"))+"/"+(processedOn.replaceAll("/| |:", "_"));
}
if (getQValsTab().containsKey(rootPath+curDate+"/"+portfolioid+"/"+subPath+"/"))
{
Uuids=Uuids+","+getQValsTab().get(rootPath+curDate+"/"+portfolioid+"/"+subPath+"/").split(GlobalClass.ColDelim)[1];
}
QValsTab.put(rootPath+curDate+"/"+portfolioid+"/"+subPath+"/", processedOn+GlobalClass.ColDelim+Uuids+GlobalClass.ColDelim+(rootPath+curDate+"/"+portfolioid+"/"+subPath+"/")+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+BranchId+GlobalClass.ColDelim+reportData[Index][7]+GlobalClass.ColDelim+(isArchive ? "1":"0")+GlobalClass.ColDelim+runningMode+GlobalClass.ColDelim);
if(!getCurBranch().equals(getPrevBranch()))
{
if(PDFF.getOutput()!=null)
{
PDFF.closeDocument();
}
setFilePath(rootPath+curDate+"/"+portfolioid+"/"+subPath+"/");
if(CreateDirectory(getFilePath()))
{
CreateReportFile(reportType, PDFF,filePrefix);
if(!isProcessFlag())
{
return false;
}
}
else
{
setProcessFlag(false);
return false;
}
setPrevBranch(getCurBranch());
}
PDFF.createTable(120);
PDFF.setFontBlack();
DesignReport(reportData[Index],reportlayout,PDFF);
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
if(PDFF.getOutput()!=null)
{
PDFF.closeDocument();
}
return true;
}
private void DesignReport(String [] reportData,String [][] reportlayout,PDFFormatter PDFF)
{
int layoutIndex=0;
for(int cindx=8;cindx<reportData.length;cindx++)
{
Image img=null;
PDFF.SetFont(reportlayout[layoutIndex][13], Integer.parseInt(reportlayout[layoutIndex][11]));
PDFF.setFontColor(new BaseColor(Integer.parseInt(reportlayout[layoutIndex][12].split(",")[0]), Integer.parseInt(reportlayout[layoutIndex][12].split(",")[1]), Integer.parseInt(reportlayout[layoutIndex][12].split(",")[2])));
PDFF.setBackColor(new BaseColor(Integer.parseInt(reportlayout[layoutIndex][14].split(",")[0]), Integer.parseInt(reportlayout[layoutIndex][14].split(",")[1]), Integer.parseInt(reportlayout[layoutIndex][14].split(",")[2])));
PDFF.setBorderColor(new BaseColor(Integer.parseInt(reportlayout[layoutIndex][16].split(",")[0]), Integer.parseInt(reportlayout[layoutIndex][16].split(",")[1]), Integer.parseInt(reportlayout[layoutIndex][16].split(",")[2])));
PDFF.setBorderWidth(Integer.parseInt(reportlayout[layoutIndex][17]));
PDFF.setRounderCorners(reportlayout[layoutIndex][18]);
if(reportData[cindx].equals("{SK!PTH15D@TA}"))
{
layoutIndex++;
continue;
}
if(reportlayout[layoutIndex][2].equals("image"))
{
try
{
img=Image.getInstance(getSignPath()+""+reportData[cindx]);
int imgscale = Integer.parseInt(reportlayout[layoutIndex][11]);
if(imgscale > 30) {
img.scalePercent(imgscale);
}
}catch(Exception exce){
}
PDFF.createCell(img, Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
else if(reportlayout[layoutIndex][2].equals("barcode"))
{
PDFF.createBCodeCell(reportData[cindx], Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
else if(reportlayout[layoutIndex][2].equals("pagebreak"))
{
PDFF.addTable();
PDFF.addPageBreak();
PDFF.createTable(120);
}
else if(reportlayout[layoutIndex][2].equals("photographs"))
{
if(reportData[cindx].length() > 10)
{
String StoragePath = GlobalClass.getStoragePath();
reportData[cindx] = reportData[cindx].substring(0,reportData[cindx].length()-1);
String [] ImgArr = reportData[cindx].split(",");
File f = null;
int vimg=0;
for(int arrIndx=0; arrIndx < ImgArr.length; arrIndx++)
{
f=new File(StoragePath+ImgArr[arrIndx]);
if(f.exists())
{
try
{
img=Image.getInstance(StoragePath+ImgArr[arrIndx]);
img.scalePercent(30f);
PDFF.createCell(img, Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
vimg++;
}catch(Exception exce){
System.out.println("Image Exception:" + exce.getMessage());
}
}
}
if(vimg != 0 && vimg%2 != 0)
{
PDFF.createCell("", Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
}
else
{
PDFF.createCell("NO IMAGE", Integer.parseInt(reportlayout[layoutIndex][3]), 120, Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],15,Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
}else if(reportlayout[layoutIndex][2].equals("inlinephoto")) {
if(reportData[cindx].length() > 10)
{
try
{
String StoragePath = GlobalClass.getStoragePath();
img=Image.getInstance(StoragePath+reportData[cindx]);
int imgscale = Integer.parseInt(reportlayout[layoutIndex][11]);
if(imgscale >= 30) {
img.scalePercent(imgscale); //Using FontSize Layout Filed's value to scale the image
}
PDFF.createCell(img, Integer.parseInt(reportlayout[layoutIndex][3]), Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}catch(Exception exce) {
System.out.println(exce.getMessage());
PDFF.createCell("No Image Available", 1, Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
}
}
else
{
int fstyle=Integer.parseInt(reportlayout[layoutIndex][3]);
if(reportData[cindx].toUpperCase().startsWith("<B>") && reportData[cindx].toUpperCase().endsWith("</B>"))
{
fstyle=1;
reportData[cindx]=reportData[cindx].replace("<b>", "");
reportData[cindx]=reportData[cindx].replace("</b>", "");
}
if(reportlayout[layoutIndex][2].equals("link")) { //To create data with hyperlink the data in reportData[cindx] should be delimited with '|' (pipe character) left side text on left side and link url on right
PDFF.createLinkCell(reportData[cindx], fstyle, Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}else if(reportlayout[layoutIndex][2].equals("chunk")){
PDFF.createChunkCell(reportData[cindx], fstyle, Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}else {
PDFF.createCell(reportData[cindx], fstyle, Integer.parseInt(reportlayout[layoutIndex][10]), Integer.parseInt(reportlayout[layoutIndex][4]),reportlayout[layoutIndex][8],Integer.parseInt(reportlayout[layoutIndex][9]),Integer.parseInt(reportlayout[layoutIndex][5]),Integer.parseInt(reportlayout[layoutIndex][7]),Integer.parseInt(reportlayout[layoutIndex][6]),Integer.parseInt(reportlayout[layoutIndex][15]));
}
}
layoutIndex++;
}
String disclaimer = " This report is based on information gathered by our field executive/telecaller";
disclaimer += " and Bank is requested to corelate the same with other documents/information on record/gathered";
disclaimer += " by the Bank in the course of complete due diligence/appraisal undertaken by the Bank.";
disclaimer += " Our report should not be the sole criteria for sanction of the loan under reference.";
PDFF.SetFont("TIMES", 6);
PDFF.setFontColor(new BaseColor(0,0,0));
//PDFF.createCell("Disclaimer:",5,8,3,"L",108,3,3,0,0);
//PDFF.createCell(disclaimer,0,112,3,"L",107,3,3,0,0);
PDFF.createCell("Disclaimer:",5,8,3,"L",0,3,3,0,0);
PDFF.createCell(disclaimer,0,112,3,"L",0,3,3,0,0);
}
private void CreateReportFile(String reportType,PDFFormatter PDFF,String filePrefix)
{
int i=0;
setFileName(filePrefix+reportType+"_REP_"+i+".pdf");
while(CheckFileExistence(getFilePath()+getFileName()))
{
i++;
setFileName(filePrefix+reportType+"_REP_"+i+".pdf");
}
if(isProcessFlag())
{
PDFF.CreateFile(getFilePath()+getFileName());
if(!PDFF.isProcessFlag())
{
setProcessFlag(false);
setErrDesc(PDFF.getErrDesc());
setErrMsg(PDFF.getErrMsg());
}
}
}
public void FinalizeBanklist(Hashtable<String, String> QValsTab,boolean isAutoemail,String processedOn,String BranchId,String runningMode)
{
DBFunctions dbf=new DBFunctions(getErrCode());
Set<String> keys=QValsTab.keySet();
for(String key : keys)
{
dbf.setProcessFlag(true);
String []Qvals=QValsTab.get(key).split(GlobalClass.ColDelim);
Qvals[1]="uuid=''"+Qvals[1].replace(",", "'' or uuid=''")+"''";
dbf.FetchRunQuery(118, Qvals);
if(!dbf.isProcessFlag())
{
setErrMsg(dbf.getErrMsg());
setErrDesc(dbf.getErrDesc());
setProcessFlag(dbf.isProcessFlag());
break;
}
}
if(!isProcessFlag())
{
setErrMsg(getErrMsg()+" Updation failed for some or all cases.");
}
else
{
if(isAutoemail)
{
SendReports SR=new SendReports();
SR.setErrCode(getErrCode());
SR.setProcessFlag(true);
SR.SendReportsByBatch(processedOn, BranchId, UserId,runningMode);
if (!SR.isProcessFlag())
{
setErrMsg(SR.getErrMsg().replace(getErrCode()+"SEML:warning:", getErrCode()+"SEML:warning:Bank Reports generated successfully.\n\n"));
setErrDesc(SR.getErrDesc());
setProcessFlag(SR.isProcessFlag());
}
}
}
}
private boolean CreateDirectory(String DirPath)
{
try
{
File f=new File(DirPath);
if(!f.isDirectory())
{
return f.mkdirs();
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
private boolean CheckFileExistence(String PathToFile)
{
try
{
File f=new File(PathToFile);
if(!f.isFile())
{
return false;
}
else
{
return true;
}
}catch(Exception exce)
{
setErrMsg(getErrCode()+"MKDIR:Error:"+exce.getMessage());
setErrDesc(exce.getLocalizedMessage());
setProcessFlag(false);
return false;
}
}
}

View File

@@ -0,0 +1,93 @@
package matrix.nimble.operation.output.model;
public class PartwiseExcelReporting {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String UserId;
private String PrevBranch;
private String CurBranch;
private String FileName;
private String FilePath;
private String SignPath;
private String OCid;
private String Puuid;
public PartwiseExcelReporting() {
setProcessFlag(true);
}
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getUserId() {
return UserId;
}
public void setUserId(String userId) {
UserId = userId;
}
public String getPrevBranch() {
return PrevBranch;
}
public void setPrevBranch(String prevBranch) {
PrevBranch = prevBranch;
}
public String getCurBranch() {
return CurBranch;
}
public void setCurBranch(String curBranch) {
CurBranch = curBranch;
}
public String getFileName() {
return FileName;
}
public void setFileName(String fileName) {
FileName = fileName;
}
public String getFilePath() {
return FilePath;
}
public void setFilePath(String filePath) {
FilePath = filePath;
}
public String getSignPath() {
return SignPath;
}
public void setSignPath(String signPath) {
SignPath = signPath;
}
public String getOCid() {
return OCid;
}
public void setOCid(String oCid) {
OCid = oCid;
}
public String getPuuid() {
return Puuid;
}
public void setPuuid(String puuid) {
Puuid = puuid;
}
}

View File

@@ -0,0 +1,237 @@
package matrix.nimble.operation.output.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.list.LazyList;
public class ReportSettings {
private String portfolioid;
private String uuids;
private String portname;
private String rrformat;
private String orformat;
private String orsaformat;
private String trformat;
private String prformat;
private String rtrformat;
private String ddformat;
private String tracker;
private String templatefile;
private int rvqid;
private int ovqid;
private int pvqid;
private int tvqid;
private int refvqid;
private int ddqid;
private int trackqid;
private int offsaqid;
private String reportby;
private boolean autoemail;
private String reporttype;
private boolean archivebatch;
private boolean attachannexure;
private String portsupervisor;
private String bsuid;
private boolean upload;
private String extrareport;
private int extraqid;
private String supname;
private List<CaseList> caselist = LazyList.decorate(new ArrayList(),FactoryUtils.instantiateFactory(CaseList.class));
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public String getPortname() {
return portname;
}
public void setPortname(String portname) {
this.portname = portname;
}
public List<CaseList> getCaselist() {
return caselist;
}
public void setCaselist(List<CaseList> caselist) {
this.caselist = caselist;
}
public String getUuids() {
return uuids;
}
public void setUuids(String uuids) {
this.uuids = uuids;
}
public String getRrformat() {
return rrformat;
}
public void setRrformat(String rrformat) {
this.rrformat = rrformat;
}
public String getOrformat() {
return orformat;
}
public void setOrformat(String orformat) {
this.orformat = orformat;
}
public String getTrformat() {
return trformat;
}
public void setTrformat(String trformat) {
this.trformat = trformat;
}
public String getPrformat() {
return prformat;
}
public void setPrformat(String prformat) {
this.prformat = prformat;
}
public String getRtrformat() {
return rtrformat;
}
public void setRtrformat(String rtrformat) {
this.rtrformat = rtrformat;
}
public String getDdformat() {
return ddformat;
}
public void setDdformat(String ddformat) {
this.ddformat = ddformat;
}
public String getTracker() {
return tracker;
}
public void setTracker(String tracker) {
this.tracker = tracker;
}
public String getTemplatefile() {
return templatefile;
}
public void setTemplatefile(String templatefile) {
this.templatefile = templatefile;
}
public int getRvqid() {
return rvqid;
}
public void setRvqid(int rvqid) {
this.rvqid = rvqid;
}
public int getOvqid() {
return ovqid;
}
public void setOvqid(int ovqid) {
this.ovqid = ovqid;
}
public int getPvqid() {
return pvqid;
}
public void setPvqid(int pvqid) {
this.pvqid = pvqid;
}
public int getTvqid() {
return tvqid;
}
public void setTvqid(int tvqid) {
this.tvqid = tvqid;
}
public int getRefvqid() {
return refvqid;
}
public void setRefvqid(int refvqid) {
this.refvqid = refvqid;
}
public int getDdqid() {
return ddqid;
}
public void setDdqid(int ddqid) {
this.ddqid = ddqid;
}
public int getTrackqid() {
return trackqid;
}
public void setTrackqid(int trackqid) {
this.trackqid = trackqid;
}
public String getReportby() {
return reportby;
}
public void setReportby(String reportby) {
this.reportby = reportby;
}
public String getReporttype() {
return reporttype;
}
public void setReporttype(String reporttype) {
this.reporttype = reporttype;
}
public String getBsuid() {
return bsuid;
}
public void setBsuid(String bsuid) {
this.bsuid = bsuid;
}
public boolean isAutoemail() {
return autoemail;
}
public void setAutoemail(boolean autoemail) {
this.autoemail = autoemail;
}
public boolean isArchivebatch() {
return archivebatch;
}
public void setArchivebatch(boolean archivebatch) {
this.archivebatch = archivebatch;
}
public boolean isAttachannexure() {
return attachannexure;
}
public void setAttachannexure(boolean attachannexure) {
this.attachannexure = attachannexure;
}
public String getPortsupervisor() {
return portsupervisor;
}
public void setPortsupervisor(String portsupervisor) {
this.portsupervisor = portsupervisor;
}
public String getOrsaformat() {
return orsaformat;
}
public void setOrsaformat(String orsaformat) {
this.orsaformat = orsaformat;
}
public int getOffsaqid() {
return offsaqid;
}
public void setOffsaqid(int offsaqid) {
this.offsaqid = offsaqid;
}
public boolean isUpload() {
return upload;
}
public void setUpload(boolean upload) {
this.upload = upload;
}
public String getExtrareport() {
return extrareport;
}
public void setExtrareport(String extrareport) {
this.extrareport = extrareport;
}
public int getExtraqid() {
return extraqid;
}
public void setExtraqid(int extraqid) {
this.extraqid = extraqid;
}
public String getSupname() {
return supname;
}
public void setSupname(String supname) {
this.supname = supname;
}
}

View File

@@ -0,0 +1,165 @@
package matrix.nimble.operation.output.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.EmailFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
public class SendReports {
private String ErrMsg;
private String ErrDesc;
private String ErrCode;
private boolean ProcessFlag;
private String ZipFilename;
private String Response;
private int TotalFailed;
public String getErrMsg() {
return ErrMsg;
}
public void setErrMsg(String errMsg) {
ErrMsg = errMsg;
}
public String getErrDesc() {
return ErrDesc;
}
public void setErrDesc(String errDesc) {
ErrDesc = errDesc;
}
public String getErrCode() {
return ErrCode;
}
public void setErrCode(String errCode) {
ErrCode = errCode;
}
public boolean isProcessFlag() {
return ProcessFlag;
}
public void setProcessFlag(boolean processFlag) {
ProcessFlag = processFlag;
}
public String getZipFilename() {
return ZipFilename;
}
public void setZipFilename(String zipFilename) {
ZipFilename = zipFilename;
}
public String getResponse() {
return Response;
}
public void setResponse(String response) {
Response = response;
}
public int getTotalFailed() {
return TotalFailed;
}
public void setTotalFailed(int totalFailed) {
TotalFailed = totalFailed;
}
public void SendReportsByBatch(String Batch,String BranchId,String UserId,String runningMode)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
String cond="m.batch='"+Batch+"' and u.branch_id="+BranchId+" and m.emailtype='"+runningMode+"'";
dbf.FetchRunQuery(119, (cond+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(!dbf.isProcessFlag())
{
setErrMsg(dbf.getErrMsg()+" Sendig reports failed.");
setErrDesc(dbf.getErrDesc());
setProcessFlag(dbf.isProcessFlag());
return;
}
else
{
String [][] mailbox=dbf.getResultArray();
Send(mailbox, dbf, Batch,UserId);
}
if(getTotalFailed()>0)
{
setProcessFlag(false);
setErrMsg(getErrCode()+"SEML:warning:Email to one or more receipents failed.\n"+getErrMsg());
}
}
public void SendReportsByMID(String Mailid,String BranchId,String UserId)
{
DBFunctions dbf=new DBFunctions(getErrCode());
dbf.setProcessFlag(true);
dbf.FetchRunQuery(119, (Mailid+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
if(!dbf.isProcessFlag())
{
setErrMsg(dbf.getErrMsg()+" Sendig reports failed.");
setErrDesc(dbf.getErrDesc());
setProcessFlag(dbf.isProcessFlag());
return;
}
else
{
String [][] mailbox=dbf.getResultArray();
Send(mailbox, dbf, GlobalClass.DateTime("yyyy/MM/dd HH:mm:ss", new java.util.Date()),UserId);
}
}
private void Send(String [][] mailbox,DBFunctions dbf,String MailedOn, String UserId)
{
int status=0;
setZipFilename(MailedOn.replaceAll("/| |:", "_")+".zip");
setErrMsg("Sending failed to\n");
setResponse("");
setTotalFailed(0);
EmailFunctions EFunc=new EmailFunctions();
dbf.setProcessFlag(true);
for(int indx=0;indx<mailbox.length;indx++)
{
status=1;
EFunc.setUsername(mailbox[indx][8]);
try
{
EFunc.setPassword(new ModuleFunctions(getErrCode()).decrypt(mailbox[indx][9]));
}catch(Exception exce) {System.out.println("Password conversion failed");}
EFunc.setTo(mailbox[indx][1]);
EFunc.setFrom(mailbox[indx][8]);
EFunc.setEid(mailbox[indx][9]);
EFunc.setCc(mailbox[indx][2]);
EFunc.setBcc(mailbox[indx][3]);
EFunc.setSubject(mailbox[indx][4]);
EFunc.setMessagebody(mailbox[indx][5]);
// Handling resend statements
if(!mailbox[indx][10].equals("0") && mailbox[indx][7].equals("1"))
{
setZipFilename(mailbox[indx][12].replaceAll("/| |:", "_")+".zip");
EFunc.setAttachments(mailbox[indx][6]+""+getZipFilename());
EFunc.setArchive(false);
}
else
{
EFunc.setAttachments(mailbox[indx][6]);
EFunc.setArchive(mailbox[indx][7].equals("1") ? true:false);
}
//----//
EFunc.setZipfilename(getZipFilename());
setResponse(EFunc.SendEmail(getErrCode()));
if(getResponse().contains("Error"))
{
setTotalFailed(getTotalFailed()+1);
setErrMsg(getErrMsg()+""+mailbox[indx][8]+". "+getResponse()+"\n");
status=9;
mailbox[indx][5]="<br><b><u><font color=red>"+getResponse()+" on "+MailedOn+"</font></u></b><br><br>"+mailbox[indx][5];
}
else
{
mailbox[indx][5]="<br><b><u><font color=green>Mail sent successfully on "+MailedOn+"</font></u></b><br><br>"+mailbox[indx][5];
}
if(!mailbox[indx][10].equals("0") && status!=9)
{
status=2;
}
dbf.setProcessFlag(true);
dbf.FetchRunQuery(128, (MailedOn+GlobalClass.ColDelim+UserId+GlobalClass.ColDelim+status+GlobalClass.ColDelim+getResponse()+GlobalClass.ColDelim+mailbox[indx][0]+GlobalClass.ColDelim+mailbox[indx][5]+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
}
if(getTotalFailed()>0)
{
setProcessFlag(false);
setErrMsg(getErrCode()+"SEML:warning:Email to one or more receipents failed.\n"+getErrMsg());
}
}
}

View File

@@ -0,0 +1,142 @@
package matrix.nimble.operation.output.model;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.ss.format.CellFormatType;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFDataFormat;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.sun.org.apache.xml.internal.security.utils.XalanXPathFactory;
import matrix.nimble.utilities.CommonFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.XLCell;
import java.io.*;
public class TrackerGeneratorHelper {
public TrackerGeneratorHelper() {
}
private String createDirectories(String subpath) throws Exception {
String storagePath = GlobalClass.getStoragePath()+"output/trackers/"+GlobalClass.DateTime("yyyy/MM/", new java.util.Date())+subpath;
File path = new File(storagePath);
if(!path.exists()) {
path.mkdirs();
}
return storagePath;
}
public String generateTrackerFormat(TrackerSetting trackerSetting, String templatepath) throws Exception {
String responseJson = "{\"status\":\"failed\",\"message\":\"Error: No sheet mapping available for this tracker\"}";
String storagePath = "";
CommonFunctions comfunc = new CommonFunctions();
if(trackerSetting.sheets.size() > 0) {
FileInputStream file = new FileInputStream(new File(templatepath));
XSSFWorkbook workbook = new XSSFWorkbook(file);
String [] fieldindex = trackerSetting.generationrule.split("-");
for(TrackerSheet sheet : trackerSetting.sheets) {
XSSFSheet xlsheet = workbook.getSheet(sheet.sheetname);
if(sheet.getSheetLayout()) {
String [][] headerlayout = comfunc.GetSubArray("header", 4, sheet.getTrackerlayout());
String [][] detailslayout = comfunc.GetSubArray("details", 4, sheet.getTrackerlayout());
String [][] footerlayout = comfunc.GetSubArray("footer", 4, sheet.getTrackerlayout());
if(sheet.getSheetData(trackerSetting.portfolio_id+"",trackerSetting.fromdate,trackerSetting.todate)) {
String [][] trackerData = sheet.getTrackerData();
if(trackerData.length == 0) {
continue;
}
for(String index:fieldindex) {
storagePath = trackerData[0][Integer.parseInt(index)]+"/";
}
storagePath = createDirectories(storagePath);
int rowindex = sheet.rowindex;
if(headerlayout != null) {
XSSFRow row = xlsheet.getRow(rowindex);
for(String[] layout: headerlayout) {
XSSFCellStyle style = workbook.createCellStyle();
XSSFCell cell = row.createCell(Integer.parseInt(layout[0]));
XLCell.Border border = XLCell.Border.valueOf(Integer.parseInt(layout[5]));
CreateCellBorder(style, border);
SetCellFont(workbook, style, Integer.parseInt(layout[10]), layout[11], layout[12], layout[6]);
cell.setCellStyle(style);
SetCellType(workbook, style, layout[3], cell, trackerData[0][Integer.parseInt(layout[2])]);
}
rowindex ++;
}
for(String[] data: trackerData) {
XSSFRow row = xlsheet.createRow(rowindex);
for(String[] layout: detailslayout) {
XSSFCellStyle style = workbook.createCellStyle();
XSSFCell cell = row.createCell(Integer.parseInt(layout[0]));
XLCell.Border border = XLCell.Border.valueOf(Integer.parseInt(layout[5]));
CreateCellBorder(style, border);
SetCellFont(workbook, style, Integer.parseInt(layout[10]), layout[11], layout[12], layout[6]);
cell.setCellStyle(style);
SetCellType(workbook, style, layout[3], cell, data[Integer.parseInt(layout[2])]);
}
rowindex++;
}
}
}
}
workbook.setForceFormulaRecalculation(true);
file.close();
String timestamp = GlobalClass.DateTime("dd_HH_mm_ss", new java.util.Date());
FileOutputStream outFile =new FileOutputStream(new File(storagePath+"_"+timestamp+"_"+trackerSetting.templatefile));
workbook.write(outFile);
outFile.close();
responseJson = "{\"status\":\"success\",\"data\":\""+GlobalClass.ChangeToDocserverPath(storagePath+"_"+timestamp+"_"+trackerSetting.templatefile)+"\"}";
}
return responseJson;
}
private void CreateCellBorder(XSSFCellStyle style,XLCell.Border border)
{
if(border == XLCell.Border.ALL ) {
style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
style.setBorderTop(XSSFCellStyle.BORDER_THIN);
style.setBorderRight(XSSFCellStyle.BORDER_THIN);
style.setBorderLeft(XSSFCellStyle.BORDER_THIN);
}
}
private void SetCellFont(XSSFWorkbook wb, XSSFCellStyle style,int fontsize, String fontname, String fontstyle, String forecolorRGB) {
XSSFFont font = wb.createFont();
//font =style.getFont();
font.setFontHeightInPoints((short)fontsize);
font.setBold("bold".equalsIgnoreCase(fontstyle));
font.setFontName(fontname);
String [] rgb = forecolorRGB.split(",");
XSSFColor color = new XSSFColor(new java.awt.Color(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2])));
font.setColor(color);
style.setFont(font);
}
private void SetCellType(XSSFWorkbook wb, XSSFCellStyle style, String type, XSSFCell cell, String data) {
DataFormatter df = new DataFormatter();
if(type.equals("number")) {
cell.setCellValue(new Double(data));
}else {
cell.setCellValue(data);
}
}
}

View File

@@ -0,0 +1,20 @@
package matrix.nimble.operation.output.model;
import java.util.List;
public class TrackerSetting {
public int portfolio_id;
public String portname;
public int tracker_id;
public String templatename;
public String templatefile;
public String generationrule;
public String fromdate;
public String todate;
public List<TrackerSheet> sheets;
public TrackerSetting() {
}
}

View File

@@ -0,0 +1,49 @@
package matrix.nimble.operation.output.model;
import matrix.nimble.utilities.DBFunctions;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.NimbleException;
public class TrackerSheet {
public int sheet_id;
public String sheetname;
public int rowindex;
public int colindex;
public int queryid;
private String [][] trackerlayout;
private String [][] sheetdata;
public TrackerSheet() {
}
public String[][] getTrackerlayout() {
return trackerlayout;
}
public String[][] getTrackerData() {
return sheetdata;
}
public boolean getSheetLayout() throws Exception {
DBFunctions dbf = new DBFunctions("9111");
dbf.setProcessFlag(true);
dbf.FetchRunQuery(496, new String[] {this.sheet_id+""});
if(dbf.isProcessFlag()) {
trackerlayout = dbf.getResultArray();
return true;
}else {
throw new NimbleException("Error: While fetching Sheet layout: "+dbf.getErrMsg());
}
}
public boolean getSheetData(String portfolio_id, String fromdate, String todate) throws Exception {
DBFunctions dbf = new DBFunctions("9111");
dbf.setProcessFlag(true);
dbf.FetchRunQuery(this.queryid, new String[] {portfolio_id,GlobalClass.ConvertToYMD(fromdate),GlobalClass.ConvertToYMD(todate),fromdate,todate});
if(dbf.isProcessFlag()) {
sheetdata = dbf.getResultArray();
return true;
}else {
return false;
}
}
}

View File

@@ -0,0 +1,896 @@
package matrix.nimble.operation.reporting.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//spring libraries
import matrix.nimble.model.Session;
import matrix.nimble.operation.reporting.model.FinalDone;
import matrix.nimble.operation.reporting.model.NegUpdRequest;
import matrix.nimble.operation.reporting.model.OfficeReport;
import matrix.nimble.operation.reporting.model.OperatorReporting;
import matrix.nimble.operation.reporting.model.OtherReport;
import matrix.nimble.operation.reporting.model.RefrenceReport;
import matrix.nimble.operation.reporting.model.ReportingHandler;
import matrix.nimble.operation.reporting.model.ResidenceReport;
import matrix.nimble.operation.reporting.model.ScannerReporting;
import matrix.nimble.operation.reporting.model.TelecallingReport;
import matrix.nimble.operation.reporting.model.TelecallingReporting;
import matrix.nimble.utilities.GlobalClass;
import matrix.nimble.utilities.ModuleFunctions;
import matrix.nimble.utilities.StringFunctions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes({"Sessvals"})
public class Operations {
//---> Operator Reporting Grid
@RequestMapping(value="optrreporting",method=RequestMethod.POST )
public String operatorReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2001");
OperatorReporting oprReporting=new OperatorReporting();
oprReporting.setPortcond("1=1");
oprReporting.setVercond("1=1");
session.setAttribute("usertype", "opr");
session.setAttribute("userrole", null);
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2001");
String [] QueryVals={Sessvals.getUserID(),oprReporting.getPortcond(),oprReporting.getVercond(),"OPR"};
model.addAttribute("oprReporting",rpHandler.getOprReportingRecords(QueryVals,oprReporting));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",modFunc.GetResultArray(61,(Sessvals.getUserID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/oprreporting";
}
//<--- Operator Reporting Grid
//---> Filter Operator Reporting Grid
@RequestMapping(value="filterreporting",method=RequestMethod.POST )
public String filterOprReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="oprReporting") OperatorReporting oprRep,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2001");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2001");
String pcond=oprRep.getPortcond();
String vcond=oprRep.getVercond();
pcond=pcond.equals("1=1") ? pcond:pcond.substring(0, pcond.lastIndexOf(" or ")).replace("port", "portfolio_id");
vcond=vcond.equals("1=1") ? vcond:vcond.substring(0, vcond.lastIndexOf(" or ")).replace("ver", "verifier");
String [] QueryVals={Sessvals.getUserID(),pcond,vcond,session.getAttribute("usertype").toString()};
model.addAttribute("oprReporting",rpHandler.getOprReportingRecords(QueryVals,oprRep));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",modFunc.GetResultArray(61,(Sessvals.getUserID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/oprreporting";
}
//<--- Filter Operator Reporting Grid
//---> Residence Reporting
@RequestMapping(value="rreport",method=RequestMethod.GET )
public String ResidenceReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@RequestParam String rand,@RequestParam String uuid,@RequestParam String pid,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
model.addAttribute("resiDetails",rpHandler.ResidenceReportForm(session.getAttribute("usertype").toString(), Sessvals.getUserID(), uuid));
if(rpHandler.isProcessFlag())
{
rpHandler.GetReportOptions(pid,0);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("resrelation",rpHandler.GetOptionSet("RESI RELATION", 2));
model.addAttribute("marstatus",rpHandler.GetOptionSet("MARITAL STATUS", 2));
model.addAttribute("resowner",rpHandler.GetOptionSet("RESI OWNERSHIP", 2));
model.addAttribute("resacc",rpHandler.GetOptionSet("RESI ACCESSIBILITY", 2));
model.addAttribute("resmort",rpHandler.GetOptionSet("RESI MOTORABILITY", 2));
model.addAttribute("resloc",rpHandler.GetOptionSet("RESI LOCALITY", 2));
model.addAttribute("rtype",rpHandler.GetOptionSet("RESI TYPE", 2));
model.addAttribute("constype",rpHandler.GetOptionSet("RESI CONSTRUCTION TYPE", 2));
model.addAttribute("resint",rpHandler.GetOptionSet("RESI INTERIOR", 2));
model.addAttribute("livstd",rpHandler.GetOptionSet("RESI LIVING STANDARD", 2));
model.addAttribute("resbehav",rpHandler.GetOptionSet("RESI BEHAVIOR", 2));
model.addAttribute("resstat",rpHandler.GetOptionSet("REPORT STATUS", 2));
model.addAttribute("negres",rpHandler.GetOptionSet("RESI NEGATIVE REASON", 2));
model.addAttribute("qual",rpHandler.GetOptionSet("QUALIFICATION", 2));
}
else
{
rpHandler.setErrMsg("");
}
}
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/resireport";
}
//<--- Residence Reporting Ends
//---> Copy Residence Reporting
@RequestMapping(value="copyRreport",method=RequestMethod.POST )
public String CopyResidenceReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="resiDetails") ResidenceReport resRep,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
rpHandler.CopyRReport(resRep, request.getParameter("cuuid"), Sessvals.getUserID(), session.getAttribute("usertype").toString());
if(rpHandler.isProcessFlag())
{
rpHandler.GetReportOptions(resRep.getPortfolioid(),0);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("resrelation",rpHandler.GetOptionSet("RESI RELATION", 2));
model.addAttribute("marstatus",rpHandler.GetOptionSet("MARITAL STATUS", 2));
model.addAttribute("resowner",rpHandler.GetOptionSet("RESI OWNERSHIP", 2));
model.addAttribute("resacc",rpHandler.GetOptionSet("RESI ACCESSIBILITY", 2));
model.addAttribute("resmort",rpHandler.GetOptionSet("RESI MOTORABILITY", 2));
model.addAttribute("resloc",rpHandler.GetOptionSet("RESI LOCALITY", 2));
model.addAttribute("rtype",rpHandler.GetOptionSet("RESI TYPE", 2));
model.addAttribute("constype",rpHandler.GetOptionSet("RESI CONSTRUCTION TYPE", 2));
model.addAttribute("resint",rpHandler.GetOptionSet("RESI INTERIOR", 2));
model.addAttribute("livstd",rpHandler.GetOptionSet("RESI LIVING STANDARD", 2));
model.addAttribute("resbehav",rpHandler.GetOptionSet("RESI BEHAVIOR", 2));
model.addAttribute("resstat",rpHandler.GetOptionSet("REPORT STATUS", 2));
model.addAttribute("negres",rpHandler.GetOptionSet("RESI NEGATIVE REASON", 2));
model.addAttribute("qual",rpHandler.GetOptionSet("QUALIFICATION", 2));
}
else
{
rpHandler.setErrMsg("");
}
}
model.addAttribute("resiDetails",resRep);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/resireport";
}
//<--- Copy Residence Reporting Ends
//---> Save Residence Report
@RequestMapping(value="rreportsave",method=RequestMethod.POST )
public String SaveResidenceReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="resiDetails") ResidenceReport resRep,HttpSession session)
{
String DynamicQuery="";
String iscompsave=resRep.getIscompsave();
StringFunctions strFunc=new StringFunctions("2002");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
if(resRep.getDynamicctrls().length()>0)
{
String [] DCtrls=resRep.getDynamicctrls().split(GlobalClass.ColDelim);
String CtrlVal="";
for(int indx=0;indx<DCtrls.length;indx++)
{
CtrlVal= DCtrls[indx].toUpperCase().contains("CHKFIELD") ? strFunc.AutoCorrect(request.getParameter(DCtrls[indx]),1) : strFunc.AutoCorrect(request.getParameter(DCtrls[indx]),5);
DynamicQuery=DynamicQuery+","+DCtrls[indx]+"=''"+CtrlVal+"''";
resRep.InvokeSetter("set"+DCtrls[indx],CtrlVal);
}
}
resRep=rpHandler.resDynamicHtml(resRep, resRep.getPortfolioid());
rpHandler.GetReportOptions(resRep.getPortfolioid(),0);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("resrelation",rpHandler.GetOptionSet("RESI RELATION", 2));
model.addAttribute("marstatus",rpHandler.GetOptionSet("MARITAL STATUS", 2));
model.addAttribute("resowner",rpHandler.GetOptionSet("RESI OWNERSHIP", 2));
model.addAttribute("resacc",rpHandler.GetOptionSet("RESI ACCESSIBILITY", 2));
model.addAttribute("resmort",rpHandler.GetOptionSet("RESI MOTORABILITY", 2));
model.addAttribute("resloc",rpHandler.GetOptionSet("RESI LOCALITY", 2));
model.addAttribute("rtype",rpHandler.GetOptionSet("RESI TYPE", 2));
model.addAttribute("constype",rpHandler.GetOptionSet("RESI CONSTRUCTION TYPE", 2));
model.addAttribute("resint",rpHandler.GetOptionSet("RESI INTERIOR", 2));
model.addAttribute("livstd",rpHandler.GetOptionSet("RESI LIVING STANDARD", 2));
model.addAttribute("resbehav",rpHandler.GetOptionSet("RESI BEHAVIOR", 2));
model.addAttribute("resstat",rpHandler.GetOptionSet("REPORT STATUS", 2));
model.addAttribute("negres",rpHandler.GetOptionSet("RESI NEGATIVE REASON", 2));
model.addAttribute("qual",rpHandler.GetOptionSet("QUALIFICATION", 2));
}
rpHandler.SaveResiReport(resRep, DynamicQuery,Sessvals.getUserID(),session.getAttribute("usertype").toString());
if(rpHandler.isProcessFlag() && iscompsave.equals("0"))
{
rpHandler.setProcessFlag(false);
}
else if(rpHandler.isProcessFlag() && iscompsave.equals("1"))
{
//resRep=rpHandler.resDynamicHtml(resRep, resRep.getPortfolioid());
rpHandler.setErrMsg("closed");
}
model.addAttribute("resiDetails",resRep);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/resireport";
}
//<--- Residence Report Save Ends
//---> Office Reporting
@RequestMapping(value="oreport",method=RequestMethod.GET )
public String OfficeReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@RequestParam String rand,@RequestParam String uuid,@RequestParam String pid,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
model.addAttribute("offDetails",rpHandler.OfficeReportForm(session.getAttribute("usertype").toString(), Sessvals.getUserID(), uuid));
if(rpHandler.isProcessFlag())
{
rpHandler.GetReportOptions(pid,1);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("offrelation",rpHandler.GetOptionSet("OFF RELATION", 2));
model.addAttribute("offodesign",rpHandler.GetOptionSet("DESIGNATION", 2));
model.addAttribute("offonob",rpHandler.GetOptionSet("OFF NOB", 2));
model.addAttribute("offojobtype",rpHandler.GetOptionSet("TYPE OF JOB", 2));
model.addAttribute("offoloca",rpHandler.GetOptionSet("OFF LOCALITY", 2));
model.addAttribute("offoowner",rpHandler.GetOptionSet("OFF OWNERSHIP", 2));
model.addAttribute("offostatus",rpHandler.GetOptionSet("REPORT STATUS", 2));
model.addAttribute("offnegres",rpHandler.GetOptionSet("OFF NEGATIVE REASON", 2));
model.addAttribute("offacc",rpHandler.GetOptionSet("OFF ACCESSIBILITY", 2));
model.addAttribute("offact",rpHandler.GetOptionSet("OFF ACTIVITY", 2));
model.addAttribute("orgtype",rpHandler.GetOptionSet("ORG TYPE", 2));
}
}
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/offreport";
}
//<--- Office Reporting Ends
//---> Copy Office Report
@RequestMapping(value="copyOreport",method=RequestMethod.POST )
public String CopyOfficeReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="offDetails") OfficeReport offRep,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
rpHandler.CopyOReport(offRep, request.getParameter("cuuid"), Sessvals.getUserID(), session.getAttribute("usertype").toString());
if(rpHandler.isProcessFlag())
{
rpHandler.GetReportOptions(offRep.getPortfolioid(),1);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("offrelation",rpHandler.GetOptionSet("OFF RELATION", 2));
model.addAttribute("offodesign",rpHandler.GetOptionSet("DESIGNATION", 2));
model.addAttribute("offonob",rpHandler.GetOptionSet("OFF NOB", 2));
model.addAttribute("offojobtype",rpHandler.GetOptionSet("TYPE OF JOB", 2));
model.addAttribute("offoloca",rpHandler.GetOptionSet("OFF LOCALITY", 2));
model.addAttribute("offoowner",rpHandler.GetOptionSet("OFF OWNERSHIP", 2));
model.addAttribute("offostatus",rpHandler.GetOptionSet("REPORT STATUS", 2));
model.addAttribute("offnegres",rpHandler.GetOptionSet("OFF NEGATIVE REASON", 2));
model.addAttribute("offacc",rpHandler.GetOptionSet("OFF ACCESSIBILITY", 2));
model.addAttribute("offact",rpHandler.GetOptionSet("OFF ACTIVITY", 2));
model.addAttribute("orgtype",rpHandler.GetOptionSet("ORG TYPE", 2));
}
}
model.addAttribute("offDetails",offRep);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/offreport";
}
//<--- Copy Office Report Ends
//---> Save Office Report
@RequestMapping(value="oreportsave",method=RequestMethod.POST )
public String SaveOfficeReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="offDetails") OfficeReport offRep,HttpSession session)
{
String DynamicQuery="";
String iscompsave=offRep.getIscompsave();
StringFunctions strFunc=new StringFunctions("2002");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
if(offRep.getDynamicctrls().length()>0)
{
String [] DCtrls=offRep.getDynamicctrls().split(GlobalClass.ColDelim);
String CtrlVal="";
for(int indx=0;indx<DCtrls.length;indx++)
{
CtrlVal=strFunc.AutoCorrect(request.getParameter(DCtrls[indx]),3);
DynamicQuery=DynamicQuery+","+DCtrls[indx]+"=''"+CtrlVal+"''";
offRep.InvokeSetter("set"+DCtrls[indx],strFunc.IsNull(request.getParameter(DCtrls[indx])) ? "" : request.getParameter(DCtrls[indx]));
}
}
offRep=rpHandler.offDynamicHtml(offRep, offRep.getPortfolioid());
rpHandler.GetReportOptions(offRep.getPortfolioid(),1);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("offrelation",rpHandler.GetOptionSet("OFF RELATION", 2));
model.addAttribute("offodesign",rpHandler.GetOptionSet("DESIGNATION", 2));
model.addAttribute("offonob",rpHandler.GetOptionSet("OFF NOB", 2));
model.addAttribute("offojobtype",rpHandler.GetOptionSet("TYPE OF JOB", 2));
model.addAttribute("offoloca",rpHandler.GetOptionSet("OFF LOCALITY", 2));
model.addAttribute("offoowner",rpHandler.GetOptionSet("OFF OWNERSHIP", 2));
model.addAttribute("offostatus",rpHandler.GetOptionSet("REPORT STATUS", 2));
model.addAttribute("offnegres",rpHandler.GetOptionSet("OFF NEGATIVE REASON", 2));
model.addAttribute("offacc",rpHandler.GetOptionSet("OFF ACCESSIBILITY", 2));
model.addAttribute("offact",rpHandler.GetOptionSet("OFF ACTIVITY", 2));
model.addAttribute("orgtype",rpHandler.GetOptionSet("ORG TYPE", 2));
}
rpHandler.SaveOffReport(offRep, DynamicQuery,Sessvals.getUserID(),session.getAttribute("usertype").toString());
if(rpHandler.isProcessFlag() && iscompsave.equals("0"))
{
rpHandler.setProcessFlag(false);
}
else if(rpHandler.isProcessFlag() && iscompsave.equals("1"))
{
//offRep=rpHandler.offDynamicHtml(offRep, offRep.getPortfolioid());
rpHandler.setErrMsg("closed");
}
model.addAttribute("offDetails",offRep);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/offreport";
}
//<--- Office Report Save Ends
//---> Other Reporting
@RequestMapping(value="preport",method=RequestMethod.GET )
public String OtherReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@RequestParam String rand,@RequestParam String uuid,@RequestParam String pid,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
model.addAttribute("othDetails",rpHandler.otherReportForm(session.getAttribute("usertype").toString(), Sessvals.getUserID(), uuid));
if(rpHandler.isProcessFlag())
{
rpHandler.GetReportOptions(pid,4);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("propstat",rpHandler.GetOptionSet("REPORT STATUS", 2));
model.addAttribute("negres",rpHandler.GetOptionSet("OTH NEGATIVE REASON", 2));
}
}
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/othreport";
}
//<--- Other Reporting Ends
//---> Save Other Report
@RequestMapping(value="preportsave",method=RequestMethod.POST )
public String SaveOtherReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="othDetails") OtherReport othRep,HttpSession session)
{
String DynamicQuery="";
String iscompsave=othRep.getIscompsave();
StringFunctions strFunc=new StringFunctions("2002");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
if(othRep.getDynamicctrls().length()>0)
{
String [] DCtrls=othRep.getDynamicctrls().split(GlobalClass.ColDelim);
String CtrlVal="";
for(int indx=0;indx<DCtrls.length;indx++)
{
CtrlVal=strFunc.AutoCorrect(request.getParameter(DCtrls[indx]),3);
DynamicQuery=DynamicQuery+","+DCtrls[indx]+"=''"+CtrlVal+"''";
othRep.InvokeSetter("set"+DCtrls[indx],strFunc.IsNull(request.getParameter(DCtrls[indx])) ? "" : request.getParameter(DCtrls[indx]));
}
}
othRep=rpHandler.otherDynamicHtml(othRep, othRep.getPortfolioid());
rpHandler.GetReportOptions(othRep.getPortfolioid(),4);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("propstat",rpHandler.GetOptionSet("REPORT STATUS", 2));
model.addAttribute("negres",rpHandler.GetOptionSet("OTH NEGATIVE REASON", 2));
}
rpHandler.SaveOthReport(othRep, DynamicQuery,Sessvals.getUserID(),session.getAttribute("usertype").toString());
if(rpHandler.isProcessFlag() && iscompsave.equals("0"))
{
rpHandler.setProcessFlag(false);
}
else if(rpHandler.isProcessFlag() && iscompsave.equals("1"))
{
//offRep=rpHandler.offDynamicHtml(offRep, offRep.getPortfolioid());
rpHandler.setErrMsg("closed");
}
model.addAttribute("othDetails",othRep);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/othreport";
}
//<--- Other Report Save Ends
//-------------TELECALLING REPORTING SECTION BEGINS-------------------------
//---> Telecalling Reporting Grid
@RequestMapping(value="telreporting",method=RequestMethod.POST )
public String teleReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2003");
TelecallingReporting telReporting=new TelecallingReporting();
telReporting.setPortcond("1=1");
session.setAttribute("usertype", "topr");
session.setAttribute("userrole", null);
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2003");
String [] QueryVals={Sessvals.getUserID(),telReporting.getPortcond(),"branch_id="+Sessvals.getBranchID()};
model.addAttribute("telReporting",rpHandler.getTelReportingRecords(QueryVals,telReporting));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/telreporting";
}
//<--- Telecalling Reporting Grid Ends
//---> Filter Telecalling Reporting Grid
@RequestMapping(value="filtertelgrid",method=RequestMethod.POST )
public String filterTelReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="telReporting") TelecallingReporting telRep,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2003");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2003");
String pcond=telRep.getPortcond();
pcond=pcond.equals("1=1") ? pcond:pcond.substring(0, pcond.lastIndexOf(" or ")).replace("port", "portfolio_id");
String [] QueryVals={Sessvals.getUserID(),pcond,"branch_id="+Sessvals.getBranchID()};
model.addAttribute("telReporting",rpHandler.getTelReportingRecords(QueryVals,telRep));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/telreporting";
}
//<--- Filter Telecalling Reporting Grid Ends
//---> Telecalling Reporting
@RequestMapping(value="treport",method=RequestMethod.GET )
public String tvrReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@RequestParam String rand,@RequestParam String uuid,@RequestParam String pid,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
model.addAttribute("tvrDetails",rpHandler.tvrReportForm(session.getAttribute("usertype").toString(), Sessvals.getUserID(), uuid));
if(rpHandler.isProcessFlag())
{
rpHandler.GetReportOptions(pid,3);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("ncontreason",rpHandler.GetOptionSet("NOT CONTACTED REASON", 2));
model.addAttribute("resrelation",rpHandler.GetOptionSet("RESI RELATION", 2));
model.addAttribute("resownership",rpHandler.GetOptionSet("RESI OWNERSHIP", 2));
model.addAttribute("offrelation",rpHandler.GetOptionSet("OFF RELATION", 2));
model.addAttribute("offdesign",rpHandler.GetOptionSet("DESIGNATION", 2));
model.addAttribute("offnob",rpHandler.GetOptionSet("OFF NOB", 2));
}
}
model.addAttribute("callerlist",new ModuleFunctions("2002").GetResultArray(105, (Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/tvrreport";
}
//<--- Telecalling Reporting Ends
//---> Save Telecalling Report
@RequestMapping(value="treportsave",method=RequestMethod.POST )
public String SaveTvrReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="tvrDetails") TelecallingReport tvrRep,HttpSession session)
{
String DynamicQuery="";
String iscompsave=tvrRep.getIscompsave();
StringFunctions strFunc=new StringFunctions("2002");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2002");
rpHandler.setProcessFlag(true);
if(tvrRep.getDynamicctrls().length()>0)
{
String [] DCtrls=tvrRep.getDynamicctrls().split(GlobalClass.ColDelim);
String CtrlVal="";
for(int indx=0;indx<DCtrls.length;indx++)
{
CtrlVal=strFunc.AutoCorrect(request.getParameter(DCtrls[indx]),3);
DynamicQuery=DynamicQuery+","+DCtrls[indx]+"=''"+CtrlVal+"''";
tvrRep.InvokeSetter("set"+DCtrls[indx],strFunc.IsNull(request.getParameter(DCtrls[indx])) ? "" : request.getParameter(DCtrls[indx]));
}
}
tvrRep=rpHandler.tvrDynamicHtml(tvrRep,tvrRep.getPortfolioid());
rpHandler.GetReportOptions(tvrRep.getPortfolioid(),3);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
model.addAttribute("ncontreason",rpHandler.GetOptionSet("NOT CONTACTED REASON", 2));
model.addAttribute("resrelation",rpHandler.GetOptionSet("RESI RELATION", 2));
model.addAttribute("resownership",rpHandler.GetOptionSet("RESI OWNERSHIP", 2));
model.addAttribute("offrelation",rpHandler.GetOptionSet("OFF RELATION", 2));
model.addAttribute("offdesign",rpHandler.GetOptionSet("DESIGNATION", 2));
model.addAttribute("offnob",rpHandler.GetOptionSet("OFF NOB", 2));
}
rpHandler.SavetvrReport(tvrRep, DynamicQuery,Sessvals.getUserID(),session.getAttribute("usertype").toString());
if(rpHandler.isProcessFlag() && iscompsave.equals("0"))
{
rpHandler.setProcessFlag(false);
}
else if(rpHandler.isProcessFlag() && iscompsave.equals("1"))
{
//offRep=rpHandler.offDynamicHtml(offRep, offRep.getPortfolioid());
rpHandler.setErrMsg("closed");
}
model.addAttribute("callerlist",new ModuleFunctions("2002").GetResultArray(105, (Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("tvrDetails",tvrRep);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/tvrreport";
}
//<--- Telecalling Report Save Ends
//---> Refrence Calling Reporting
@RequestMapping(value="rtreport",method=RequestMethod.GET )
public String refReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@RequestParam String rand,@RequestParam String uuid,@RequestParam String pid,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2005");
rpHandler.setProcessFlag(true);
model.addAttribute("refDetails",rpHandler.refReportForm(session.getAttribute("usertype").toString(), Sessvals.getUserID(), uuid));
if(rpHandler.isProcessFlag())
{
rpHandler.GetReportOptions(pid,2);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
//model.addAttribute("offrelation",rpHandler.GetOptionSet("OFF RELATION", 2));
}
}
model.addAttribute("callerlist",new ModuleFunctions("2002").GetResultArray(105, (Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/refreport";
}
//<--- Refrence Calling Reporting Ends
//---> Save Refrence Calling Report
@RequestMapping(value="rtreportsave",method=RequestMethod.POST )
public String SaveRefReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="refDetails") RefrenceReport refRep,HttpSession session)
{
String DynamicQuery="";
String iscompsave=refRep.getIscompsave();
StringFunctions strFunc=new StringFunctions("2005");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2005");
rpHandler.setProcessFlag(true);
if(refRep.getDynamicctrls().length()>0)
{
String [] DCtrls=refRep.getDynamicctrls().split(GlobalClass.ColDelim);
String CtrlVal="";
for(int indx=0;indx<DCtrls.length;indx++)
{
CtrlVal=strFunc.AutoCorrect(request.getParameter(DCtrls[indx]),3);
DynamicQuery=DynamicQuery+","+DCtrls[indx]+"=''"+CtrlVal+"''";
refRep.InvokeSetter("set"+DCtrls[indx],strFunc.IsNull(request.getParameter(DCtrls[indx])) ? "" : request.getParameter(DCtrls[indx]));
}
}
refRep=rpHandler.refDynamicHtml(refRep,refRep.getPortfolioid());
rpHandler.GetReportOptions(refRep.getPortfolioid(),4);
if(rpHandler.isProcessFlag() && rpHandler.getResultData()!=null)
{
//model.addAttribute("offrelation",rpHandler.GetOptionSet("OFF RELATION", 2));
}
rpHandler.SaverefReport(refRep, DynamicQuery,Sessvals.getUserID(),session.getAttribute("usertype").toString());
if(rpHandler.isProcessFlag() && iscompsave.equals("0"))
{
rpHandler.setProcessFlag(false);
}
else if(rpHandler.isProcessFlag() && iscompsave.equals("1"))
{
//offRep=rpHandler.offDynamicHtml(offRep, offRep.getPortfolioid());
rpHandler.setErrMsg("closed");
}
model.addAttribute("callerlist",new ModuleFunctions("2002").GetResultArray(105, (Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("refDetails",refRep);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/refreport";
}
//<--- Refrence Calling Report Save Ends
//---> Scanner Reporting Grid
@RequestMapping(value="scanreporting",method=RequestMethod.POST )
public String scannerReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2004");
ScannerReporting scanReporting=new ScannerReporting();
scanReporting.setPortcond("1=-2");
scanReporting.setVercond("1=1");
scanReporting.setBranch("-1");
scanReporting.setProductid("-1");
session.setAttribute("usertype", "mgr");
session.setAttribute("userrole", null);
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2004");
String [] QueryVals={Sessvals.getUserID(),scanReporting.getPortcond(),scanReporting.getVercond(),"branch_id="+Sessvals.getBranchID(),"1=1","1=1"};
model.addAttribute("scanReporting",rpHandler.getScanReportingRecords(QueryVals,scanReporting));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",modFunc.GetResultArray(89,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("productlist",null);
model.addAttribute("branchlist",null);
model.addAttribute("msg","");
return "operation/reporting/scanning";
}
//<--- Operator Reporting Grid
//---> Filter Scanner Reporting Grid
@RequestMapping(value="filterscangrid",method=RequestMethod.POST )
public String filterScanReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="scanReporting") ScannerReporting scanRep,HttpSession session)
{
String tempVcond="";
ModuleFunctions modFunc=new ModuleFunctions("2004");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2004");
String pcond=scanRep.getPortcond();
String vcond=scanRep.getVercond();
String prodcond=scanRep.getProductid();
String brncond=scanRep.getBranch().equals("-1") ? "1=1":"bank_branch_id="+scanRep.getBranch();
pcond=pcond.equals("1=1") ? pcond:pcond.substring(0, pcond.lastIndexOf(" or ")).replaceAll("port", "portfolio_id");
if(!vcond.equals("1=1"))
{
tempVcond=vcond.substring(0, vcond.lastIndexOf(" or ")).replace("ver", "resiverifier");
vcond=tempVcond+" or "+tempVcond.replace("resiverifier", "offverifier");
vcond=vcond+" or "+tempVcond.replace("resiverifier", "propverifier");
}
String [] QueryVals={Sessvals.getUserID(),pcond,vcond,"branch_id="+Sessvals.getBranchID(),prodcond,brncond};
model.addAttribute("scanReporting",rpHandler.getScanReportingRecords(QueryVals,scanRep));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",modFunc.GetResultArray(89,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("productlist",modFunc.GetResultArray(70, (scanRep.getPortfolioid()+GlobalClass.ColDelim+"description='PRODUCT'"+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("branchlist",modFunc.GetResultArray(4, (scanRep.getPortfolioid()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/scanning";
}
//<--- Filter Operator Reporting Grid
//---> Scanner QC Reporting Grid
@RequestMapping(value="qcscanreporting",method=RequestMethod.POST )
public String QcscannerGrid(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
String frmdate = GlobalClass.DateTime("dd/MM/yyyy", new java.util.Date());
ModuleFunctions modFunc=new ModuleFunctions("2004");
ScannerReporting scanReporting=new ScannerReporting();
scanReporting.setPortcond("receivedon > '"+frmdate+"'");
scanReporting.setVercond("receivedon < '"+frmdate+" 23:59:59'");
scanReporting.setBranch("1=1");
scanReporting.setProductid("1=1");
session.setAttribute("usertype", "mgr");
session.setAttribute("userrole", null);
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2004");
String [] QueryVals={Sessvals.getUserID(),scanReporting.getPortcond(),scanReporting.getVercond(),"branch_id="+Sessvals.getBranchID(),"1=1","1=1"};
scanReporting.setPortfolioid(frmdate);
scanReporting.setVerifierid(frmdate);
model.addAttribute("scanReporting",rpHandler.getQCScanReportingRecords(QueryVals,scanReporting));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("verlist",modFunc.GetResultArray(89,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("branchlist",modFunc.GetResultArray(442,("branch_id="+Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/scanningqc";
}
//<--- Operator Reporting Grid
//---> Filter Scanner Reporting Grid
@RequestMapping(value="filterqcscangrid",method=RequestMethod.POST )
public String filterQcScanReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="scanReporting") ScannerReporting scanRep,HttpSession session)
{
String tempVcond="";
ModuleFunctions modFunc=new ModuleFunctions("2004");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2004");
String pcond="receivedon > '"+GlobalClass.ConvertToYMD(scanRep.getPortfolioid())+"'";
String vcond="receivedon < '"+GlobalClass.ConvertToYMD(scanRep.getVerifierid())+" 23:59:59'";
String [] QueryVals={Sessvals.getUserID(),pcond,vcond,"branch_id="+Sessvals.getBranchID(),"1=1","1=1"};
model.addAttribute("scanReporting",rpHandler.getQCScanReportingRecords(QueryVals,scanRep));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("verlist",modFunc.GetResultArray(89,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("branchlist",modFunc.GetResultArray(442,("branch_id="+Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/scanningqc";
}
//<--- Filter Operator Reporting Grid
//---> Final Done
@RequestMapping(value="fdreport",method=RequestMethod.GET )
public String fdReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@RequestParam String rand,@RequestParam String uuid,@RequestParam String pid,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2006");
rpHandler.setProcessFlag(true);
model.addAttribute("fdDetails",rpHandler.fdReportForm(session.getAttribute("usertype").toString(), Sessvals.getUserID(), uuid));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/finaldone";
}
//<--- Final Done Ends
//---> Save Final Done
@RequestMapping(value="fdreportsave",method=RequestMethod.POST )
public String SaveFdReport(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="fdDetails") FinalDone fdRep,HttpSession session)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2006");
rpHandler.setProcessFlag(true);
rpHandler.SavefdReport(fdRep, Sessvals.getUserID());
if(rpHandler.isProcessFlag())
{
rpHandler.setErrMsg("closed");
}
model.addAttribute("fdDetails",fdRep);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("msg",rpHandler.getErrMsg());
model.addAttribute("status",rpHandler.isProcessFlag());
return "operation/reporting/finaldone";
}
//<--- Final Done Save Ends
//---> Show Photos Starts
@RequestMapping(value="showphotos",method=RequestMethod.GET )
public String ShowPhotos(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@RequestParam String mvcode,@RequestParam String reptype)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2007");
/*if(session.getAttribute("usertype").toString().equals("mgr"))
{*/
rpHandler.setProcessFlag(true);
model.addAttribute("photolist",rpHandler.FetchPhotos(mvcode,reptype));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("status",rpHandler.isProcessFlag());
model.addAttribute("msg",rpHandler.getErrMsg());
/*}
else
{
rpHandler.setProcessFlag(false);
model.addAttribute("photolist",null);
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("status",false);
model.addAttribute("msg","2007LFIL:Error:Unauthorised Access!!!");
}*/
return "operation/reporting/photoviewer";
}
//<--- Show Photos Ends
//---> Show GPS Location Starts
@RequestMapping(value="showgpsloc",method=RequestMethod.GET )
public String ShowGpsLoc(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session,@RequestParam String mvcode,@RequestParam String reptype)
{
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2008");
rpHandler.setProcessFlag(true);
model.addAttribute("gpsloc",rpHandler.GetGpsLoc(mvcode,reptype));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("status",rpHandler.isProcessFlag());
model.addAttribute("msg",rpHandler.getErrMsg());
return "operation/reporting/gpslocviewer";
}
//<--- Show GPS Location Ends
//---> Bank Software Updation Operator Reporting Grid
@RequestMapping(value="bksoftreporting",method=RequestMethod.POST )
public String bksoftoprReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2001");
OperatorReporting oprReporting=new OperatorReporting();
oprReporting.setPortcond("1=0");
oprReporting.setVercond("1=0");
session.setAttribute("usertype", "bopr");
session.setAttribute("userrole", null);
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2001");
String [] QueryVals={Sessvals.getUserID(),oprReporting.getPortcond(),oprReporting.getVercond(),"BOPR"};
model.addAttribute("oprReporting",rpHandler.geBksofttOprReportingRecords(QueryVals,oprReporting));
oprReporting.setPortcond("1=1");
oprReporting.setVercond("1=1");
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(286,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
//model.addAttribute("verlist",modFunc.GetResultArray(61,(Sessvals.getUserID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",null);
model.addAttribute("msg","");
return "operation/reporting/bksoprreporting";
}
//<--- Bank Software Updation Operator Reporting Grid End
//---> Filter Bank Software Updation Operator Reporting Grid
@RequestMapping(value="filterbkreporting",method=RequestMethod.POST )
public String filterBkOprReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="oprReporting") OperatorReporting oprRep,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2001");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2001");
String pcond=oprRep.getPortcond();
String vcond=oprRep.getVercond();
pcond=(pcond.equals("1=1") || pcond.equals("1=0")) ? "1=1":pcond.substring(0, pcond.lastIndexOf(" or ")).replace("port", "portfolio_id");
vcond=(vcond.equals("1=1") || vcond.equals("1=0")) ? "1=1":vcond.substring(0, vcond.lastIndexOf(" or ")).replace("ver", "verifier");
String [] QueryVals={Sessvals.getUserID(),pcond,vcond,session.getAttribute("usertype").toString()};
model.addAttribute("oprReporting",rpHandler.geBksofttOprReportingRecords(QueryVals,oprRep));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(286,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
//model.addAttribute("verlist",modFunc.GetResultArray(61,(Sessvals.getUserID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",null);
model.addAttribute("msg","");
return "operation/reporting/bksoprreporting";
}
//<--- Filter Bank Software Updation Operator Reporting Grid End
//---> Quality Software Grid
@RequestMapping(value="qcsoftreporting",method=RequestMethod.POST )
public String QCSoftOprReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2001");
OperatorReporting oprReporting=new OperatorReporting();
oprReporting.setPortcond("1=0");
oprReporting.setVercond("1=0");
session.setAttribute("usertype", "bopr");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2001");
String [] QueryVals={Sessvals.getUserID(),oprReporting.getPortcond(),oprReporting.getVercond(),"BOPR"};
model.addAttribute("oprReporting",rpHandler.geQCsofttOprReportingRecords(QueryVals,oprReporting));
oprReporting.setPortcond("1=1");
oprReporting.setVercond("1=1");
session.setAttribute("userrole", "ccmgr");
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",modFunc.GetResultArray(69,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/qcrreporting";
}
//<--- Quality Software Grid End
//---> Filter Quality Software Grid
@RequestMapping(value="filterqcreporting",method=RequestMethod.POST )
public String filterQCOprReporting(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="oprReporting") OperatorReporting oprRep,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("2001");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("2001");
String pcond=oprRep.getPortcond();
String vcond=oprRep.getVercond();
String othflt="";
if(oprRep.getFltfromdt().length()==10 && oprRep.getFlttodt().length()==10)
{
othflt +="and doneon >= '"+oprRep.getFltfromdt()+" 00:00:00' and doneon <= '"+oprRep.getFlttodt()+" 23:59:59' ";
}
if(!oprRep.getFltrisk().equals("-1"))
{
othflt +="and risk = '"+oprRep.getFltrisk()+"' ";
}
if(oprRep.getFltpincode().length()==6)
{
othflt +="and pincode = '"+oprRep.getFltpincode()+"' ";
}
session.setAttribute("userrole", "ccmgr");
pcond=(pcond.equals("1=1") || pcond.equals("1=0")) ? "1=1":pcond.substring(0, pcond.lastIndexOf(" or ")).replace("port", "portfolio_id");
vcond=(vcond.equals("1=1") || vcond.equals("1=0")) ? "1=1":vcond.substring(0, vcond.lastIndexOf(" or ")).replace("ver", "verifier");
String [] QueryVals={Sessvals.getUserID(),pcond,vcond,session.getAttribute("usertype").toString(),othflt};
model.addAttribute("oprReporting",rpHandler.geQCsofttOprReportingRecords(QueryVals,oprRep));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("verlist",modFunc.GetResultArray(69,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/qcrreporting";
}
//<--- Filter Quality Software Grid End
//---> Negative DB Updation Reporting Grid
@RequestMapping(value="negupdrequests",method=RequestMethod.POST )
public String NegUpdGrid(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("6601");
NegUpdRequest NegRep=new NegUpdRequest();
NegRep.setPortcond("1=0");
session.setAttribute("usertype", "mgr");
session.setAttribute("userrole", "ccmgr");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("6601");
String [] QueryVals={Sessvals.getUserID(),NegRep.getPortcond(),"mgr"};
model.addAttribute("negUpdreq",rpHandler.NegUpdRequestGrid(QueryVals,NegRep));
NegRep.setPortcond("1=1");
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/negupdrequests";
}
//<--- Negative DB Updation Reporting Grid End
//---> Filter Negative DB Updation Reporting Grid
@RequestMapping(value="filternegupdreq",method=RequestMethod.POST )
public String filterNegUpdGrid(ModelMap model,HttpServletRequest request,@ModelAttribute(value="Sessvals") Session Sessvals,@ModelAttribute(value="negUpdreq") NegUpdRequest NegRep,HttpSession session)
{
ModuleFunctions modFunc=new ModuleFunctions("6601");
ReportingHandler rpHandler=new ReportingHandler();
rpHandler.setErrCode("6601");
String pcond=NegRep.getPortcond();
pcond=(pcond.equals("1=1") || pcond.equals("1=0")) ? "1=1":pcond.substring(0, pcond.lastIndexOf(" or ")).replace("port", "portfolio_id");
String [] QueryVals={Sessvals.getUserID(),pcond,session.getAttribute("usertype").toString()};
model.addAttribute("negUpdreq",rpHandler.NegUpdRequestGrid(QueryVals,NegRep));
model.addAttribute("Sessvals",Sessvals);
model.addAttribute("portlist",modFunc.GetResultArray(3,(Sessvals.getBranchID()+GlobalClass.ColDelim).split(GlobalClass.ColDelim)));
model.addAttribute("msg","");
return "operation/reporting/negupdrequests";
}
//<--- Filter Negative DB Updation Reporting Grid End
}

View File

@@ -0,0 +1,168 @@
package matrix.nimble.operation.reporting.model;
public class FinalDone {
private String uuid;
private boolean isdone;
private String rstatus;
private String rremarks;
private String ostatus;
private String oremarks;
private String rtstatus;
private String rtremarks;
private String otstatus;
private String otremarks;
private String ref1status;
private String ref1remarks;
private String ref2status;
private String ref2remarks;
private String pstatus;
private String premarks;
private String overallstatus;
private String portfolio;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getRstatus() {
return rstatus;
}
public void setRstatus(String rstatus) {
this.rstatus = rstatus;
}
public String getRremarks() {
return rremarks;
}
public void setRremarks(String rremarks) {
this.rremarks = rremarks;
}
public String getOstatus() {
return ostatus;
}
public void setOstatus(String ostatus) {
this.ostatus = ostatus;
}
public String getOremarks() {
return oremarks;
}
public void setOremarks(String oremarks) {
this.oremarks = oremarks;
}
public String getPstatus() {
return pstatus;
}
public void setPstatus(String pstatus) {
this.pstatus = pstatus;
}
public String getPremarks() {
return premarks;
}
public void setPremarks(String premarks) {
this.premarks = premarks;
}
public String getOverallstatus() {
return overallstatus;
}
public void setOverallstatus(String overallstatus) {
this.overallstatus = overallstatus;
}
public boolean isIsdone() {
return isdone;
}
public void setIsdone(boolean isdone) {
this.isdone = isdone;
}
public String getRtstatus() {
return rtstatus;
}
public void setRtstatus(String rtstatus) {
this.rtstatus = rtstatus;
}
public String getRtremarks() {
return rtremarks;
}
public void setRtremarks(String rtremarks) {
this.rtremarks = rtremarks;
}
public String getOtstatus() {
return otstatus;
}
public void setOtstatus(String otstatus) {
this.otstatus = otstatus;
}
public String getOtremarks() {
return otremarks;
}
public void setOtremarks(String otremarks) {
this.otremarks = otremarks;
}
public String getRef1status() {
return ref1status;
}
public void setRef1status(String ref1status) {
this.ref1status = ref1status;
}
public String getRef1remarks() {
return ref1remarks;
}
public void setRef1remarks(String ref1remarks) {
this.ref1remarks = ref1remarks;
}
public String getRef2status() {
return ref2status;
}
public void setRef2status(String ref2status) {
this.ref2status = ref2status;
}
public String getRef2remarks() {
return ref2remarks;
}
public void setRef2remarks(String ref2remarks) {
this.ref2remarks = ref2remarks;
}
public String getPortfolio() {
return portfolio;
}
public void setPortfolio(String portfolio) {
this.portfolio = portfolio;
}
}

View File

@@ -0,0 +1,74 @@
package matrix.nimble.operation.reporting.model;
public class NegUpdRequest {
String portfolioid;
String portcond;
String porthtml;
int totresi;
int totoff;
int totprop;
int pending;
private String [][] caselist;
public NegUpdRequest()
{
setPortfolioid("0");
}
public String getPortfolioid() {
return portfolioid;
}
public void setPortfolioid(String portfolioid) {
this.portfolioid = portfolioid;
}
public int getTotresi() {
return totresi;
}
public void setTotresi(int totresi) {
this.totresi = totresi;
}
public int getTotoff() {
return totoff;
}
public void setTotoff(int totoff) {
this.totoff = totoff;
}
public int getTotprop() {
return totprop;
}
public void setTotprop(int totprop) {
this.totprop = totprop;
}
public int getPending() {
return pending;
}
public void setPending(int pending) {
this.pending = pending;
}
public String[][] getCaselist() {
return caselist;
}
public void setCaselist(String[][] caselist) {
this.caselist = caselist;
}
public String getPortcond() {
return portcond;
}
public void setPortcond(String portcond) {
this.portcond = portcond;
}
public String getPorthtml() {
return porthtml;
}
public void setPorthtml(String porthtml) {
this.porthtml = porthtml;
}
public void setDefaultValues()
{
setPending(0);
setTotresi(0);
setTotoff(0);
setTotprop(0);
}
}

Some files were not shown because too many files have changed in this diff Show More