Commit d7638e12 authored by skumbhar's avatar skumbhar

solved defect log


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94627 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6dce5d8b
......@@ -101,7 +101,8 @@ public class ItemSerCrPolicy extends ValidatorEJB implements ItemSerCrPolicyLoca
Date dateOfBirth;
int ctr = 0, currentFormNo = 0, childNodeListLength = 0, cnt = 0;
String itemSeries = "", crPolicy = "";
String itemSeries = "", crPolicy = "", policyType = "", descr = "";
String policySql = "", policyResult = "", policyInput = "", policyCond = "", title = "";
try {
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
......@@ -130,15 +131,17 @@ public class ItemSerCrPolicy extends ValidatorEJB implements ItemSerCrPolicyLoca
if (childNodeName.equalsIgnoreCase("cr_policy")) {
crPolicy = genericUtility.getColumnValue("cr_policy", dom);
itemSeries = genericUtility.getColumnValue("item_ser", dom);
policyType = genericUtility.getColumnValue("policy_type", dom);
crPolicy = crPolicy == null ? "" : crPolicy.trim();
itemSeries = itemSeries == null ? "" : itemSeries.trim();
policyType = policyType == null ? "" : policyType.trim();
if (crPolicy.length() == 0) {
errCode = "VMICP";
errString = getErrorString("cr_policy", errCode, userId);
break;
} else {
sql = "select count(1) from itemser_cr_policy where item_ser = ? and cr_policy = ?";
sql = "select nvl(count(1),0) from itemser_cr_policy where item_ser = ? and cr_policy = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, itemSeries);
pStmt.setString(2, crPolicy);
......@@ -159,6 +162,31 @@ public class ItemSerCrPolicy extends ValidatorEJB implements ItemSerCrPolicyLoca
errString = getErrorString("cr_policy", errCode, userId);
break;
}
sql = null; cnt = 0;
sql = "select nvl(count(1),0) from gencodes where fld_name = ? and fld_value = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, "CR_POLICY");
pStmt.setString(2, crPolicy);
rs = pStmt.executeQuery();
if (rs.next()) {
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if("U".equalsIgnoreCase(policyType) && cnt > 0)
{
errCode = "VISCRPEGC";
errString = getErrorString("policy_type", errCode, userId);
break;
} else if ("S".equalsIgnoreCase(policyType) && cnt <= 0) {
errCode = "VISCRPNEGC";
errString = getErrorString("cr_policy", errCode, userId);
break;
}
}
} else if (childNodeName.equalsIgnoreCase("item_ser")) {
itemSeries = genericUtility.getColumnValue("item_ser", dom);
......@@ -182,6 +210,78 @@ public class ItemSerCrPolicy extends ValidatorEJB implements ItemSerCrPolicyLoca
break;
}
}
} else if (childNodeName.equalsIgnoreCase("title")) {
title = genericUtility.getColumnValue("title", dom);
title = title == null ? "" : title.trim();
if (title.length() == 0) {
errCode = "VISCRPTLNL";
errString = getErrorString("title", errCode, userId);
break;
}
} else if (childNodeName.equalsIgnoreCase("descr")) {
crPolicy = genericUtility.getColumnValue("cr_policy", dom);
descr = genericUtility.getColumnValue("descr", dom);
policyType = genericUtility.getColumnValue("policy_type", dom);
crPolicy = crPolicy == null ? "" : crPolicy.trim();
descr = descr == null ? "" : descr.trim();
policyType = policyType == null ? "" : policyType.trim();
if (descr.length() == 0) {
errCode = "DESCBLK";
errString = getErrorString("descr", errCode, userId);
break;
} else {
cnt = 0;
if("S".equalsIgnoreCase(policyType))
{
sql = "select nvl(count(1),0) from gencodes where fld_name = ? and fld_value = ? and descr = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, "CR_POLICY");
pStmt.setString(2, crPolicy);
pStmt.setString(3, descr);
rs = pStmt.executeQuery();
if (rs.next()) {
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if (cnt == 0) {
errCode = "VISCRPDRM";
errString = getErrorString("descr", errCode, userId);
break;
}
}
}
} else if (childNodeName.equalsIgnoreCase("policy_sql")) {
policySql = genericUtility.getColumnValue("policy_sql", dom);
policySql = policySql == null ? "" : policySql.trim();
if (policySql.length() != 0) {
policyResult = genericUtility.getColumnValue("policy_result", dom);
policyInput = genericUtility.getColumnValue("policy_input", dom);
policyCond = genericUtility.getColumnValue("policy_condition", dom);
policyResult = policyResult == null ? "" : policyResult.trim();
policyInput = policyInput == null ? "" : policyInput.trim();
policyCond = policyCond == null ? "" : policyCond.trim();
if (policyResult.length() == 0) {
errCode = "VISCRPRNL";
errString = getErrorString("policy_result", errCode, userId);
break;
} else if (policyInput.length() == 0) {
errCode = "VISCRPINL";
errString = getErrorString("policy_input", errCode, userId);
break;
} else if (policyCond.length() == 0) {
errCode = "VISCRPCNL";
errString = getErrorString("policy_condition", errCode, userId);
break;
}
}
}
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment