Commit 1ec00647 authored by nkhan's avatar nkhan

[S15IBAS003] Updated Sources For Adding Validation From MSI And removing extra validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103418 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a742bd72
......@@ -5,15 +5,12 @@ import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......
......@@ -104,16 +104,18 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
/* Comment By Nasruddin [16-sep-19] START
if(childNodeName.equalsIgnoreCase("dist_route"))
{
distRoute = checkNull(genericUtility.getColumnValue("dist_route", dom));
//if(distRoute == null || distRoute.trim().length() == 0)
//{
// errCode = "VTDISRTBK";
// errList.add(errCode);
// errFields.add(childNodeName.toLowerCase());
//}
if(editFlag.equalsIgnoreCase("A") && distRoute != null && distRoute.trim().length() > 0)
{
......@@ -136,30 +138,32 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
pstmt.close();
pstmt = null;
}
}
else if(childNodeName.equalsIgnoreCase("descr"))
{
descr = checkNull(genericUtility.getColumnValue("descr", dom));
if(descr == null || descr.trim().length() == 0)
{
errCode = "VMDESCR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("stan_code__fr"))
} Comment By Nasruddin [16-sep-19] END */
if(childNodeName.equalsIgnoreCase("stan_code__fr"))
{
StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeFrom == null || StanCodeFrom.trim().length() == 0)
{
errCode = "VMSTANCOD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(StanCodeFrom != null && StanCodeFrom.trim().length() > 0)
Comment By Nasruddin [16-sep-19] End */
if(StanCodeFrom != null && StanCodeFrom.trim().length() > 0)
{
sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -184,13 +188,15 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
else if(childNodeName.equalsIgnoreCase("stan_code__to"))
{
StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeTo == null || StanCodeTo.trim().length() == 0)
{
errCode = "VMSTANCOD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
Comment By Nasruddin [16-sep-19] End */
if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
{
sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -257,13 +263,15 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
if(childNodeName.equalsIgnoreCase("stan_code__fr"))
{
StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeFrom == null || StanCodeFrom.trim().length() == 0)
{
errCode = "VMSTANCOD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(StanCodeFrom != null && StanCodeFrom.trim().length() > 0)
}Comment By Nasruddin [16-sep-19] End */
if(StanCodeFrom != null && StanCodeFrom.trim().length() > 0)
{
sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -288,13 +296,14 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
else if(childNodeName.equalsIgnoreCase("stan_code__to"))
{
StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeTo == null || StanCodeTo.trim().length() == 0)
{
errCode = "VMSTANCOD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
}Comment By Nasruddin [16-sep-19] End */
if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
{
sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql);
......
......@@ -112,7 +112,8 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
/* Comment By Nasruddin khan Start [16/SEP/16] Start
if(childNodeName.trim().equalsIgnoreCase("item_ser"))
{
itemSer = genericUtility.getColumnValue("item_ser", dom);
......@@ -125,7 +126,8 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr
}
}
else if(childNodeName.trim().equalsIgnoreCase("sc_code"))
Comment By Nasruddin khan Start [16/SEP/16] END*/
if(childNodeName.trim().equalsIgnoreCase("sc_code"))
{
scCode = genericUtility.getColumnValue("sc_code", dom);
if(scCode != null && scCode.trim().length() > 0)
......@@ -167,7 +169,10 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr
scCode = genericUtility.getColumnValue("sc_code", dom);
itemSer = genericUtility.getColumnValue("ls_item_ser", dom);
}
if(scCode == null){scCode = "";}
if(scCode == null)
{
scCode = "";
}
sql = "select count(1) from disc_apr_strg where item_ser = ? and sc_code = ? and eff_from = ? ";
pstmt = conn.prepareStatement(sql);
......
......@@ -75,120 +75,166 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe
//Changes and Commented By Bhushan on 13-06-2016 :END
conn.setAutoCommit(false);
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, userId);
if (objContext != null && objContext.trim().length() > 0) {
if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
}
switch (currentFormNo) {
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++) {
for (ctr = 0; ctr < childNodeLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("agent_code")) {
if (childNodeName.equalsIgnoreCase("agent_code"))
{
System.out.println(":::childNodeName" + childNodeName);
String agentCode = genericUtility.getColumnValue("agent_code", dom);
agentCode = agentCode == null ? "" : agentCode.trim();
System.out.println("::: agentCode" + agentCode);
if(agentCode.length() <= 0){
if(agentCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("agent_code", "VTAGENTB", userId);
break;
}
else{
if(editFlag.equalsIgnoreCase("A")){
else
{
if(editFlag.equalsIgnoreCase("A"))
{
int count = 0;
sql = "select count(*) as count from ins_agent where agent_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, agentCode);
rs = pstmt.executeQuery();
if(rs.next()){
if(rs.next())
{
count = rs.getInt("count");
}
// Changed By Nasruddin khan [16-SEP-16] START
pstmt.close();
pstmt = null;
rs.close();
rs = null;
// Changed By Nasruddin khan [16-SEP-16] END
if(count > 0){
errString = itmdbAccessEJB.getErrorString("agent_code", "VDIAC", userId);
break;
}
}
}
}
if (childNodeName.equalsIgnoreCase("count_code")) {
if (childNodeName.equalsIgnoreCase("count_code"))
{
System.out.println(":::childNodeName" + childNodeName);
String countCode = genericUtility.getColumnValue("count_code", dom);
/* Changed By Nasruddin [16-SEP-16] START
countCode = countCode == null ? "" : countCode.trim();
System.out.println("::: countCode" + countCode);
if(countCode.length() <= 0){
if(countCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("count_code", "VTCOUNTB", userId);
break;
}
else{
int count = 0;
sql = "select count(*) as count from country where count_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, countCode);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt("count");
}
if(count <= 0){
errString = itmdbAccessEJB.getErrorString("count_code", "VTCONTCD1", userId);
break;
}
else Changed By Nasruddin [16-SEP-16] END*/
if( countCode != null && countCode.trim().length() > 0)
{
int count = 0;
sql = "select count(*) as count from country where count_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, countCode);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt("count");
}
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("count_code", "VTCONTCD1", userId);
break;
}
}
if (childNodeName.equalsIgnoreCase("stan_code")) {
}
}
if (childNodeName.equalsIgnoreCase("stan_code"))
{
System.out.println(":::childNodeName" + childNodeName);
String stanCode = genericUtility.getColumnValue("stan_code", dom);
/* Changed By Nasruddin [16/SEP/16] START
stanCode = stanCode == null ? "" : stanCode.trim();
System.out.println("::: stanCode" + stanCode);
if(stanCode.length() <= 0){
if(stanCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("stan_code", "VTSTATB", userId);
break;
}
else{
int count = 0;
sql = "select count(*) as count from station where stan_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, stanCode);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt("count");
}
if(count <= 0){
errString = itmdbAccessEJB.getErrorString("stan_code", "VMSTANINVD", userId);
break;
}
else
{
int count = 0;
sql = "select count(*) as count from station where stan_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, stanCode);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt("count");
}
if(count <= 0){
errString = itmdbAccessEJB.getErrorString("stan_code", "VMSTANINVD", userId);
break;
}
}
//Changed By Nasruddin [16/SEP/16] END */
int count = 0;
sql = "select count(*) as count from station where stan_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, stanCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt("count");
}
if( stanCode != null && stanCode.trim().length() > 0)
{
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("stan_code", "VTSTAN1", userId);
//errString = itmdbAccessEJB.getErrorString("stan_code", "VMSTANINVD", userId);
break;
}
}
if (childNodeName.equalsIgnoreCase("supp_code__ins")) {
}
if (childNodeName.equalsIgnoreCase("supp_code__ins"))
{
System.out.println(":::childNodeName" + childNodeName);
String suppCode = genericUtility.getColumnValue("supp_code__ins", dom);
suppCode = suppCode == null ? "" : suppCode.trim();
System.out.println("::: stanCode" + suppCode);
int count = 0;
sql = "select count(*) as count from insurance where supp_code__ins = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCode);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt("count");
}
if(count <= 0){
errString = itmdbAccessEJB.getErrorString("supp_code__ins", "VTNINSSUPP", userId);
break;
}
/*else{
//Changed By Nasruddin [16-SEP-16]
if(suppCode != null && suppCode.trim().length() > 0)
{
int count = 0;
sql = "select count(*) as count from insurance where supp_code__ins = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt("count");
}
if(count <= 0)
{
errString = itmdbAccessEJB.getErrorString("supp_code__ins", "VTNINSSUPP", userId);
break;
}
}
/*else{
GenValidate gV = new GenValidate();
String result = gV.generalValidate(dom, "supp_code__ins", "w_insurance_agent");
if(result.trim().length() <= 0 && result == ""){
......@@ -198,9 +244,9 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe
errString = itmdbAccessEJB.getErrorString("supp_code__ins", "VTNINSSUPP", userId);
}
}*/
}
}
}
}
}
}
}catch (Exception e)
{
......
......@@ -11,6 +11,7 @@ package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
......@@ -61,14 +62,16 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
String childNodeValue = "", childNodeName = "", errString = "", errCode = "", spec_tol = "",
item_code = "", qc_reqd_type = "", stk_opt = "", qc_reqd = "", track_shelf_life = "", str_shelf_life= "",
sql = "", sql2 = "", sql3 = "", sql4 = "", errorType = "",
userId = "";
int count = 0, cnt = 0, purLeadTime = 0, mfgPerc = 0, mfgLeadTime = 0, cycle_count = 0, shelf_life = 0, dlv_prd_tol = 0, min_shelf_life = 0,
userId = "", unit = "", transer = "M-ITEM", stkOpt="", loginSiteCode= "";
int count = 0, cnt = 0, purLeadTime = 0, mfgPerc = 0, mfgLeadTime = 0, cycle_count = 0, shelf_life = 0, dlv_prd_tol = 0, min_shelf_life = 0, noSalesMonth = 0,
qcLeadTime = 0, yieldPerc = 0, ctr = 0, childNodeListLength;
java.util.Date today = null, validUpto = null;
NodeList parentNodeList = null, childNodeList = null;
Node parentNode = null, childNode = null;
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
FinCommon finCommon = new FinCommon(); // Changed By Nasruddin 19-SEP-16
DistCommon common = new DistCommon();// Changed By Nasruddin 19-SEP-16
Connection conn = null;
PreparedStatement pstmt = null, pstmt2 = null, pstmt3 = null, pstmt4 = null, pstmt5 = null;
ResultSet rs = null, rs2 = null, rs3 = null, rs4 = null, rs5 = null;
......@@ -80,35 +83,43 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
// Changed By Nasruddin 19-SEP-16
loginSiteCode = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
//TODO -- FOR LOOP START.
for (ctr = 0; ctr < childNodeListLength; ctr++) {
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
count = 0;
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName().toLowerCase().trim();
//item_code
if (childNodeName.equalsIgnoreCase("item_code")) {
if (childNodeName.equalsIgnoreCase("item_code"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
sql = "select key_flag from transetup where tran_window = 'w_item'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
String key_flag = "";
if(rs.next()) {
if(rs.next())
{
key_flag = rs.getString(1);
}
key_flag = key_flag == null ? "" : key_flag.trim();
if(key_flag.equalsIgnoreCase("M") && (childNodeValue == null || childNodeValue.trim().length() == 0)) {
if(key_flag.equalsIgnoreCase("M") && (childNodeValue == null || childNodeValue.trim().length() == 0))
{
errCode = "VMITEMNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if (childNodeValue != null && childNodeValue.trim().length() > 0) {
if (editFlag.equalsIgnoreCase("A")) {
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
if (editFlag.equalsIgnoreCase("A"))
{
sql = "select count(*) from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -120,8 +131,10 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
rs = null;
pstmt.close();
pstmt = null;
if (count > 0) {
errCode = "VTITMEXST";
if (count > 0)
{
//errCode = "VTITMEXST";// Changed By Nasruddin
errCode = "VMPMKY";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
......@@ -129,22 +142,35 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//descr
else if(childNodeName.equalsIgnoreCase("descr")) {
else if(childNodeName.equalsIgnoreCase("descr"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
errCode = "VTDESC1";
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
//errCode = "VTDESC1";
errCode = "VMBDESCR";// Changed By Nasruddin
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//item_parnt
else if(childNodeName.equalsIgnoreCase("item_parnt") || childNodeName.equalsIgnoreCase("item_code__al")) {
//item_parnt Changed BY Nasruddin 19-SEP-16
//else if(childNodeName.equalsIgnoreCase("item_parnt") || childNodeName.equalsIgnoreCase("item_code__al"))
else if(childNodeName.equalsIgnoreCase("item_parnt") )
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
/* Comment By Nasruddin [16-SEP-16] START
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMITEMNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
}
Comment By Nasruddin [16-SEP-16] END */
//Changed By Nasruddin khan [16-SEP-16]
//if (childNodeValue != null && childNodeValue.trim().length() > 0)
item_code = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom));
if( childNodeValue.trim().length() > 0 && (!(childNodeValue).equalsIgnoreCase(item_code)))
{
sql = "select count(*) from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -157,29 +183,39 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
pstmt.close();
pstmt = null;
if (count == 0) {
errCode = "VMITEMCD1";
//errCode = "VMITEMCD1";
errCode = "VTITEMP1"; // Changed By Nasruddin
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
//stk_opt
else if(childNodeName.equalsIgnoreCase("stk_opt")) {
else if(childNodeName.equalsIgnoreCase("stk_opt"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
qc_reqd_type = checkNullAndTrim(genericUtility.getColumnValue("qc_reqd_type", dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMSTKOPT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
if(childNodeValue.equalsIgnoreCase("1")){
if(!qc_reqd_type.equals("I")){
}
else if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
if(childNodeValue.equalsIgnoreCase("1"))
{
if(!qc_reqd_type.equals("I"))
{
errCode = "VIWRSTKOPT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else if(childNodeValue.equalsIgnoreCase("2")){
if(!qc_reqd_type.equals("L") && !qc_reqd_type.equals("S") && !qc_reqd_type.equals("U")){
}
else if(childNodeValue.equalsIgnoreCase("2"))
{
if(!qc_reqd_type.equals("L") && !qc_reqd_type.equals("S") && !qc_reqd_type.equals("U"))
{
errCode = "VIWRSTKOPT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -188,14 +224,66 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//unit
else if(childNodeName.equalsIgnoreCase("unit")) {
else if(childNodeName.equalsIgnoreCase("unit"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
item_code = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
/* Comment By Nasruddin [19-sep-16] StART
* if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VTUOM1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
}Comment By Nasruddin [19-sep-16] end*/
// Changed By Nasruddin [19-sep-16] START
sql = "SELECT COUNT(1) FROM UOM WHERE UNIT = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( count == 0 )
{
errCode = "VTUOM1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
if(childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(1) from stock where item_code = ? and unit = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, item_code);
pstmt.setString(2, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count > 0)
{
errCode = "VTSTKITM ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
// Changed By Nasruddin [19-sep-16] END
/* Comment By Nasruddin [19-sep-16] StART
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from stock where item_code = ? and unit = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, item_code);
......@@ -208,23 +296,33 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
rs = null;
pstmt.close();
pstmt = null;
if (count > 0) {
if (count > 0)
{
errCode = "VTSTKITM ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}Comment By Nasruddin [19-sep-16] end*/
}
// Changed By Nasruddin khan [19-SEP-16] START
//unit__pur/unit__sal
else if(childNodeName.equalsIgnoreCase("unit__pur") || childNodeName.equalsIgnoreCase("unit__sal") ||
childNodeName.equalsIgnoreCase("unit__netwt") || childNodeName.equalsIgnoreCase("unit__dimn") ||
childNodeName.equalsIgnoreCase("unit") || childNodeName.equalsIgnoreCase("unit__rate")) {
/*else if(childNodeName.equalsIgnoreCase("unit__pur") || childNodeName.equalsIgnoreCase("unit__sal") || childNodeName.equalsIgnoreCase("unit__netwt") || childNodeName.equalsIgnoreCase("unit__dimn") ||
childNodeName.equalsIgnoreCase("unit") || childNodeName.equalsIgnoreCase("unit__rate")) {*/
// Changed By Nasruddin khan [19-SEP-16] END
else if(childNodeName.equalsIgnoreCase("unit__pur") || childNodeName.equalsIgnoreCase("unit__sal") || childNodeName.equalsIgnoreCase("unit__rate"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
/* Comment By Nasruddin [19-SEP-16] START
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VTUOM1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
}
Comment By Nasruddin [19-SEP-16] END */
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from uom where unit = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -243,15 +341,21 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
}
//site_code__own/site_code
else if(childNodeName.equalsIgnoreCase("site_code__own") || childNodeName.equalsIgnoreCase("site_code") || childNodeName.equalsIgnoreCase("site_code__ship")) {
else if(childNodeName.equalsIgnoreCase("site_code__own") || childNodeName.equalsIgnoreCase("site_code") || childNodeName.equalsIgnoreCase("site_code__ship"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
/* Changed By Nasruddin [19-SEP-16] START
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VTMNULSITE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
}
else if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -263,70 +367,100 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
if (count == 0)
{
errCode = "VMSITE1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}*/
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
errCode = this.isSiteCode(childNodeValue, transer);
System.out.println("SiteCode Error code is"+errCode);
if (errCode != null && errCode.trim().length() > 0)
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
// Changed By Nasruddin [19-SEP-16] END
}
//loc_code/loc_type__parent/loc_zone__pref/loc_code__recv
else if(childNodeName.equalsIgnoreCase("loc_code") ||
else if(childNodeName.equalsIgnoreCase("loc_code")
/*childNodeName.equalsIgnoreCase("loc_type__parent") || childNodeName.equalsIgnoreCase("loc_zone__pref") || */
childNodeName.equalsIgnoreCase("loc_code__recv")) {
/*childNodeName.equalsIgnoreCase("loc_code__recv") Comment By Nasruddin 19-SEP-16 */)
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue != null && childNodeValue.trim().length() > 0) {
sql = "select count(*) from location where loc_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
errCode = "INVLOCCODE ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
stkOpt = checkNullAndTrim(genericUtility.getColumnValue("stk_opt", dom));
//Changed By Nasruddin [19-SEP-16]
//if (childNodeValue != null && childNodeValue.trim().length() > 0) {
if(!stk_opt.equalsIgnoreCase("0"))
{
sql = "select count(*) from location where loc_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0)
{
errCode = "INVLOCCODE ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
//apr_code
else if(childNodeName.equalsIgnoreCase("apr_code")) {
else if(childNodeName.equalsIgnoreCase("apr_code"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
stk_opt = checkNullAndTrim(genericUtility.getColumnValue("stk_opt", dom));
if (childNodeValue != null && childNodeValue.trim().length() > 0) {
if(!stk_opt.equalsIgnoreCase("0")) {
// Changed By Nasruddin [19-SEP-16]
// stk_opt = checkNullAndTrim(genericUtility.getColumnValue("stk_opt", dom));
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
//if(!stk_opt.equalsIgnoreCase("0"))
//{
sql = "select count(*) from aprlev where apr_code= ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
if (count == 0)
{
errCode = "VTAPR1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//}
}
}
//tax_chap
else if(childNodeName.equalsIgnoreCase("tax_chap") || childNodeName.equalsIgnoreCase("tax_chap__rep")) {
//tax_chap Changed by Nasruddin [19-SEP-16]
else if(childNodeName.equalsIgnoreCase("tax_chap") )
//else if(childNodeName.equalsIgnoreCase("tax_chap") || childNodeName.equalsIgnoreCase("tax_chap__rep"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
/*if (childNodeValue == null || childNodeValue.trim().length() == 0) {
errCode = "VMITEMCD1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else */if (childNodeValue != null && childNodeValue.trim().length() > 0) {
} else */
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from taxchap where tax_chap = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -338,7 +472,8 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
if (count == 0)
{
errCode = "VTTCHAP1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -346,13 +481,16 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//tax_class
else if(childNodeName.equalsIgnoreCase("tax_class")) {
else if(childNodeName.equalsIgnoreCase("tax_class"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
/*if (childNodeValue == null || childNodeValue.trim().length() == 0) {
errCode = "VMITEMCD1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else */if (childNodeValue != null && childNodeValue.trim().length() > 0) {
} else */
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from taxclass where tax_class = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -372,13 +510,17 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//unit__rate
else if(childNodeName.equalsIgnoreCase("unit__rate")) {
/* Comment By Nasruddin 19-SEP-16 START
* else if(childNodeName.equalsIgnoreCase("unit__rate"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VTUOM1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
}
else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
sql = "select count(*) from uom where unit = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -396,27 +538,35 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
errFields.add(childNodeName.toLowerCase());
}
}
}
} Comment By Nasruddin 19-SEP-16 END*/
//cycle_count
else if(childNodeName.equalsIgnoreCase("cycle_count")) {
else if(childNodeName.equalsIgnoreCase("cycle_count"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
try {
try
{
cycle_count = Integer.parseInt(childNodeValue);
if(cycle_count < 0) {
if(cycle_count < 0)
{
errCode = "VTCYC1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} catch (Exception e) {
}
catch (Exception e)
{
cycle_count = 0;
}
}
//qc_cycle_time
else if(childNodeName.equalsIgnoreCase("qc_cycle_time")) {
else if(childNodeName.equalsIgnoreCase("qc_cycle_time"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
qc_reqd = checkNullAndTrim(genericUtility.getColumnValue("qc_reqd", dom));
if(qc_reqd.equalsIgnoreCase("Y")){
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if(qc_reqd.equalsIgnoreCase("Y"))
{
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMQCREQD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -424,11 +574,14 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//spec_reqd
else if(childNodeName.equalsIgnoreCase("spec_reqd")) {
else if(childNodeName.equalsIgnoreCase("spec_reqd"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
qc_reqd = checkNullAndTrim(genericUtility.getColumnValue("qc_reqd", dom));
if(qc_reqd.equalsIgnoreCase("Y")){
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if(qc_reqd.equalsIgnoreCase("Y"))
{
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMSPEC1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -436,11 +589,15 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//qc_reqd_type
else if(childNodeName.equalsIgnoreCase("qc_reqd_type")) {
else if(childNodeName.equalsIgnoreCase("qc_reqd_type"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
qc_reqd = checkNullAndTrim(genericUtility.getColumnValue("qc_reqd", dom));
if(qc_reqd.equalsIgnoreCase("Y")){
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if(qc_reqd.equalsIgnoreCase("Y"))
{
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMQCTYPE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -448,16 +605,22 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//qc_reqd
else if(childNodeName.equalsIgnoreCase("qc_reqd")) {
else if(childNodeName.equalsIgnoreCase("qc_reqd"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
stk_opt = checkNullAndTrim(genericUtility.getColumnValue("stk_opt", dom));
if(qc_reqd.equalsIgnoreCase("Y")){
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if(qc_reqd.equalsIgnoreCase("Y"))
{
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VTQCREQERR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (childNodeValue.equalsIgnoreCase("Y")){
if(!stk_opt.equalsIgnoreCase("2")) {
}
else if (childNodeValue.equalsIgnoreCase("Y"))
{
if(!stk_opt.equalsIgnoreCase("2"))
{
errCode = "VMSTKOPT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -466,13 +629,18 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//pack_code
else if(childNodeName.equalsIgnoreCase("pack_code")) {
else if(childNodeName.equalsIgnoreCase("pack_code"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
/*if (childNodeValue == null || childNodeValue.trim().length() == 0) {
errCode = "VMITEMCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else */if (childNodeValue != null && childNodeValue.trim().length() > 0) {
} else */
//if (childNodeValue != null && childNodeValue.trim().length() > 0)
//{
sql = "select count(*) from packing where pack_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -484,46 +652,60 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
if (count == 0)
{
errCode = "VTPKCD1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//}
}
//shelf_life
else if(childNodeName.equalsIgnoreCase("shelf_life")) {
else if(childNodeName.equalsIgnoreCase("shelf_life"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
track_shelf_life = checkNullAndTrim(genericUtility.getColumnValue("track_shelf_life", dom));
if(track_shelf_life.equalsIgnoreCase("Y")) {
try {
if(track_shelf_life.equalsIgnoreCase("Y"))
{
try
{
shelf_life = Integer.parseInt(childNodeValue==null ? "0" : childNodeValue.trim());
if(shelf_life <= 0) {
if(shelf_life <= 0)
{
errCode = "VSHELF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} catch (Exception e) {
}
catch (Exception e)
{
cycle_count = 0;
}
}
}
//min_shelf_life
else if(childNodeName.equalsIgnoreCase("min_shelf_life")) {
else if(childNodeName.equalsIgnoreCase("min_shelf_life"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
track_shelf_life = checkNullAndTrim(genericUtility.getColumnValue("track_shelf_life", dom));
str_shelf_life = checkNullAndTrim(genericUtility.getColumnValue("shelf_life", dom));
shelf_life = Integer.parseInt(str_shelf_life == null ? "0" : str_shelf_life);
min_shelf_life = Integer.parseInt(childNodeValue == null ? "0" : childNodeValue);
if(track_shelf_life.equalsIgnoreCase("Y")) {
if(min_shelf_life <= 0) {
if(track_shelf_life.equalsIgnoreCase("Y"))
{
if(min_shelf_life <= 0)
{
errCode = "VMIN_SHELF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(shelf_life > 0){
if(min_shelf_life > shelf_life) {
if(shelf_life > 0)
{
if(min_shelf_life > shelf_life)
{
errCode = "VMINSHELF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -532,43 +714,60 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//emp_code__pln/emp_code__pur/emp_code__iapr
else if(childNodeName.equalsIgnoreCase("emp_code__pln") || childNodeName.equalsIgnoreCase("emp_code__pur") || childNodeName.equalsIgnoreCase("emp_code__iapr") || childNodeName.equalsIgnoreCase("emp_code__qcaprv")) {
else if(childNodeName.equalsIgnoreCase("emp_code__pln") || childNodeName.equalsIgnoreCase("emp_code__pur") || childNodeName.equalsIgnoreCase("emp_code__iapr") || childNodeName.equalsIgnoreCase("emp_code__qcaprv"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if(childNodeValue.trim().length() > 0) {
if(childNodeValue.trim().length() > 0)
{/*Changed By Nasruddin [19-SEP-16] START
sql = "select count(*) from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
if (count == 0)
{
errCode = "EMPCODENF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
*/
errCode = finCommon.isEmployee(loginSiteCode, childNodeValue, transer, conn);
if (errCode != null && errCode.trim().length() > 0)
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
// Changed By Nasruddin [19-SEP-16] END
}
}
//role_code__indaprv/role_code__qcaprv
else if(childNodeName.equalsIgnoreCase("role_code__indaprv") || childNodeName.equalsIgnoreCase("role_code__qcaprv")) {
else if(childNodeName.equalsIgnoreCase("role_code__indaprv") || childNodeName.equalsIgnoreCase("role_code__qcaprv"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if(childNodeValue.trim().length() > 0) {
if(childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from wf_role where role_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
if (count == 0)
{
errCode = "VTINVDROLL ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -576,12 +775,15 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//dlv_prd_tol_bef/dlv_prd_tol_aft
else if(childNodeName.equalsIgnoreCase("dlv_prd_tol_bef") || childNodeName.equalsIgnoreCase("dlv_prd_tol_aft")) {
else if(childNodeName.equalsIgnoreCase("dlv_prd_tol_bef") || childNodeName.equalsIgnoreCase("dlv_prd_tol_aft"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
spec_tol = checkNullAndTrim(genericUtility.getColumnValue("spec_tol", dom));
dlv_prd_tol = Integer.parseInt(childNodeValue);
if(spec_tol.equalsIgnoreCase("Y")) {
if(dlv_prd_tol == 0){
if(spec_tol.equalsIgnoreCase("Y"))
{
if(dlv_prd_tol == 0)
{
errCode = "VMTOL01 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -589,9 +791,11 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//supp_code__pref
else if(childNodeName.equalsIgnoreCase("supp_code__pref")) {
else if(childNodeName.equalsIgnoreCase("supp_code__pref"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if(childNodeValue.trim().length() > 0) {
if(childNodeValue.trim().length() > 0)
{ /*Changed By Nasruddin 19-SEP-16 Start
sql = "select count(*) from supplier where supp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -603,41 +807,58 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
if (count == 0)
{
errCode = "INVSUPPCD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
*/
errCode = finCommon.isSupplier(loginSiteCode, childNodeValue, transer, conn);
if (errCode != null && errCode.trim().length() > 0)
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
// Changed By Nasruddin 19-SEP-16 END
}
}
//mfg_date_on
/*else if(childNodeName.equalsIgnoreCase("mfg_date_on")) {
//mfg_date_on Changed By Nasruddin 19-SEP-16
else if(childNodeName.equalsIgnoreCase("mfg_date_on"))
{
childNodeValue = checkNull(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VTMFGDATE2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}*/
}
//emp_code__qcaprv
else if(childNodeName.equalsIgnoreCase("emp_code__qcaprv")) {
else if(childNodeName.equalsIgnoreCase("emp_code__qcaprv"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
qc_reqd = checkNullAndTrim(genericUtility.getColumnValue("qc_reqd", dom));
if(qc_reqd.equalsIgnoreCase("Y")) {
if(qc_reqd.equalsIgnoreCase("Y"))
{/* Changed By Nasruddin 19-SEP-16 START
sql = "select count(*), relieve_date from employee where emp_code = ? group by relieve_date";// and relieve_date > sysdate";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
today = Calendar.getInstance().getTime();
if (rs.next()) {
if (rs.next())
{
java.sql.Date rlvDate = rs.getDate(2);
Date dtRelDate = new Date(rlvDate.getTime());
if(dtRelDate.before(today) && !dtRelDate.equals(today)){
if(dtRelDate.before(today) && !dtRelDate.equals(today))
{
errCode = "VMEMPRLVD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else {
}
else
{
errCode = "EMPCODENF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -646,6 +867,42 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
rs = null;
pstmt.close();
pstmt = null;
*/
if(childNodeValue == null || childNodeValue.trim().length() == 0 )
{
errCode = "VERREMPL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
sql = "select count(*), relieve_date from employee where emp_code = ? group by relieve_date";// and relieve_date > sysdate";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
today = Calendar.getInstance().getTime();
if (rs.next())
{
java.sql.Date rlvDate = rs.getDate(2);
Date dtRelDate = new Date(rlvDate.getTime());
if(dtRelDate.before(today) && !dtRelDate.equals(today))
{
errCode = "VMEMPRLVD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else
{
errCode = "EMPCODENF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
}
//item_type
......@@ -676,39 +933,57 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
}
//item_ser
else if(childNodeName.equalsIgnoreCase("item_ser") || childNodeName.equalsIgnoreCase("item_ser__pref")) {
//item_ser Changed By Nasruddin 19-SEP-16
//else if(childNodeName.equalsIgnoreCase("item_ser") || childNodeName.equalsIgnoreCase("item_ser__pref"))
else if(childNodeName.equalsIgnoreCase("item_ser"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if(childNodeValue.equalsIgnoreCase("item_ser")) {
/* Comment By Nasruddin 19-SEP-16 START
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
if(childNodeValue.equalsIgnoreCase("item_ser"))
{
errCode = "VTITSER1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
}
Comment By Nasruddin 19-SEP-16 END */
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count <= 0) {
if (count <= 0)
{
errCode = "VTITEMSER1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else {
}
else
{
sql = "select case when link_yn is null then 'Y' else link_yn end from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
String link_yn = rs.getString(1);
if(link_yn.equalsIgnoreCase("N")){
if(link_yn.equalsIgnoreCase("N"))
{
errCode = "VMISER";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -722,34 +997,49 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//item_code__parent
else if(childNodeName.equalsIgnoreCase("item_code__parent") || childNodeName.equalsIgnoreCase("item_code__plan")) {
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if(childNodeName.equalsIgnoreCase("item_code__parent")) {
// COMMENT BY NASRUDDIN 19-sep-16
//else if(childNodeName.equalsIgnoreCase("item_code__parent") || childNodeName.equalsIgnoreCase("item_code__plan")) {
else if(childNodeName.equalsIgnoreCase("item_code__parent"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
item_code = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom));
/* Changed by Nasruddin [19-SEP-16] Start
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
if(childNodeName.equalsIgnoreCase("item_code__parent"))
{
errCode = "VMITEMCD1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
sql = "select count(*) from item where item_code = ?";
}
Comment by Nasruddin [19-SEP-16] END */
//if (childNodeValue != null && childNodeValue.trim().length() > 0)
if (childNodeValue != null && childNodeValue.trim().length() > 0 && (!(childNodeValue).equalsIgnoreCase(item_code)))
{
sql = "select count(1) from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
if (count == 0)
{
errCode = "VTSCHITEM1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
// Changed by Nasruddin [19-SEP-16] END
}
//grp_code
//grp_code
/* Comment By Nasruddin 19-SEP-16 START
else if(childNodeName.equalsIgnoreCase("grp_code")) {
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
......@@ -759,7 +1049,7 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
sql = "SELECT count(*) FROM GENCODES WHERE FLD_NAME='GRP_CODE'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt(1);
......@@ -819,6 +1109,7 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
}
//count_code__own/count_code__mfg
else if(childNodeName.equalsIgnoreCase("count_code__own") || childNodeName.equalsIgnoreCase("count_code__mfg")) {
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
......@@ -851,7 +1142,7 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
sql = "SELECT count(*) FROM GENCODES WHERE FLD_NAME='SGRP_CODE'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt(1);
......@@ -866,35 +1157,42 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
errFields.add(childNodeName.toLowerCase());
}
}
}
} Comment By Nasruddin 19-SEP-16 END */
//brand_code
else if(childNodeName.equalsIgnoreCase("brand_code")) {
else if(childNodeName.equalsIgnoreCase("brand_code"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
/* Comment By Nasruddin 19-SEP-16 Start
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMBRNCDNL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
sql = "select count(*) from brand where code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0) {
//Invalid BRAND Code
errCode = "VMBRNCDNIN";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
Comment By Nasruddin 19-SEP-16 END */
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from brand where code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count == 0)
{
//Invalid BRAND Code
errCode = "VTBRAND";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
//bom_code__std/bom_code
/*bom_code__std/bom_code Comment By Nasruddin 19-SEP-16 START
else if(childNodeName.equalsIgnoreCase("bom_code__std") || childNodeName.equalsIgnoreCase("bom_code")) {
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
/*if (childNodeValue == null || childNodeValue.trim().length() == 0) {
......@@ -902,7 +1200,7 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
errCode = "VMITEMCD1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else */if (childNodeValue != null && childNodeValue.trim().length() > 0) {
} else if (childNodeValue != null && childNodeValue.trim().length() > 0) {
sql = "select count(*) from bom where bom_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -921,29 +1219,38 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
errFields.add(childNodeName.toLowerCase());
}
}
}
//cust_code__mkt
else if (childNodeName.equalsIgnoreCase("cust_code__mkt")) {
} Comment By Nasruddin 19-SEP-16 END */
//cust_code__mkt
else if (childNodeName.equalsIgnoreCase("cust_code__mkt"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
/*if (childNodeValue == null || childNodeValue.trim().length() == 0) {
/*Comment By Nasruddin 19-SEP-16 START
* if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
//TODO BOM Code Costing cannot be Blank
errCode = "VMITEMCD1 ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} else */if (childNodeValue != null && childNodeValue.trim().length() > 0) {
}
else
/*Comment By Nasruddin 19-SEP-16 END */
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
String blkListed = "";
sql = "select black_listed from customer where cust_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
blkListed = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (blkListed.equalsIgnoreCase("Y")) {
if (blkListed.equalsIgnoreCase("Y"))
{
//Invalid BRAND Code
errCode = "VTCSTBLK";
errList.add(errCode);
......@@ -952,6 +1259,7 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
//item_code__ndc/item_code__ndc11
/*Comment By Nasruddin 19-SEP-16 STARt
else if(childNodeName.equalsIgnoreCase("item_code__ndc") || childNodeName.equalsIgnoreCase("item_code__ndc11")) {
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
......@@ -976,14 +1284,17 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
errFields.add(childNodeName.toLowerCase());
}
}
}
}cust_code__mkt Comment By Nasruddin 19-SEP-16 END*/
//loc_code
else if(childNodeName.equalsIgnoreCase("loc_code")) {
else if(childNodeName.equalsIgnoreCase("loc_code"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
stk_opt = checkNullAndTrim(genericUtility.getColumnValue("stk_opt", dom));
if(!stk_opt.equalsIgnoreCase("0")) {
if (childNodeValue != null && childNodeValue.trim().length() > 0) {
if(!stk_opt.equalsIgnoreCase("0"))
{
if (childNodeValue != null && childNodeValue.trim().length() > 0)
{
sql = "select count(*) from location where loc_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, childNodeValue);
......@@ -1003,7 +1314,7 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
}
//loc_type
/*loc_type Comment bY Nasruddin 19-SEP-16 START
else if(childNodeName.equalsIgnoreCase("loc_type")) {
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
......@@ -1030,17 +1341,22 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
}
loc_type Comment bY Nasruddin 19-SEP-16 END*/
//supp_sour
else if(childNodeName.equalsIgnoreCase("supp_sour")) {
else if(childNodeName.equalsIgnoreCase("supp_sour"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMSUPPSR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//price_list
else if(childNodeName.equalsIgnoreCase("price_list")) {
/* Comment By Nasruddin 19-SEP-16 START
else if(childNodeName.equalsIgnoreCase("price_list"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue.trim().length() > 0) {
sql = "select count(*) from pricelist where price_list = ?";
......@@ -1061,15 +1377,96 @@ public class ItemIC extends ValidatorEJB implements ItemICLocal, ItemICRemote {
}
}
}
Comment By Nasruddin 19-SEP-16 END */
//order_opt
else if(childNodeName.equalsIgnoreCase("order_opt")) {
else if(childNodeName.equalsIgnoreCase("order_opt"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0) {
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMORDOPT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
// Changed By Nasruddin 19-SEP-16 Start
else if(childNodeName.equalsIgnoreCase("auto_reqc"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMAUTORT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("auto_reqc"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
if (childNodeValue == null || childNodeValue.trim().length() == 0)
{
errCode = "VMAUTORT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("no_sales_month"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
track_shelf_life = checkNullAndTrim(genericUtility.getColumnValue("min_shelf_life", dom));
min_shelf_life = Integer.parseInt(track_shelf_life == null ? "0" : track_shelf_life);
if (childNodeValue != null )
{
noSalesMonth = Integer.parseInt(childNodeValue == null ? "0" : childNodeValue);
if( noSalesMonth > min_shelf_life)
{
errCode = "VMCGTMSL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("no_sales_month"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
track_shelf_life = checkNullAndTrim(genericUtility.getColumnValue("min_shelf_life", dom));
min_shelf_life = Integer.parseInt(track_shelf_life == null ? "0" : track_shelf_life);
if (childNodeValue != null )
{
noSalesMonth = Integer.parseInt(childNodeValue == null ? "0" : childNodeValue);
if( noSalesMonth > min_shelf_life)
{
errCode = "VMCGTMSL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("phy_attrib_1") || childNodeName.equalsIgnoreCase("phy_attrib_2") ||
childNodeName.equalsIgnoreCase("phy_attrib_3") || childNodeName.equalsIgnoreCase("phy_attrib_4") ||
childNodeName.equalsIgnoreCase("phy_attrib_5"))
{
childNodeValue = checkNullAndTrim(genericUtility.getColumnValue(childNodeName, dom));
track_shelf_life = checkNullAndTrim(genericUtility.getColumnValue("min_shelf_life", dom));
min_shelf_life = Integer.parseInt(track_shelf_life == null ? "0" : track_shelf_life);
if (childNodeValue != null )
{
noSalesMonth = Integer.parseInt(childNodeValue == null ? "0" : childNodeValue);
if( noSalesMonth > min_shelf_life)
{
errCode = "VMCGTMSL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
// // Changed By Nasruddin 19-SEP-16 END
}
//TODO -- FOR LOOP End.
......
......@@ -136,7 +136,6 @@ public class ItemLot extends ValidatorEJB implements ItemLotLocal,ItemLotRemote
pstmt = null;
}
}//end of for
int errListSize = errList.size();
int cnt = 0;
String errFldName = null;
......
......@@ -130,8 +130,10 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
if (childNodeName.equalsIgnoreCase("item_code"))
{
itemCode=this.genericUtility.getColumnValue("item_code", dom);
if (itemCode != null && itemCode.trim().length() > 0 )
{
//Changed By Nasruddin 19-SEP-16 START
//if (itemCode != null && itemCode.trim().length() > 0 )
//{
sql = "select count(*) from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
......@@ -153,15 +155,16 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
errFields.add(childNodeName.toLowerCase());
}
}else
{
/*}else
//{
errCode = "VMITEMCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}//Changed By Nasruddin 19-SEP-16 END*/
}
else if (childNodeName.equalsIgnoreCase("lot_no__from"))
/*
* else if (childNodeName.equalsIgnoreCase("lot_no__from"))
{
lotNofrom=this.genericUtility.getColumnValue("lot_no__from", dom);
if (lotNofrom == null || lotNofrom.trim().length() == 0 )
......@@ -183,7 +186,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
errFields.add(childNodeName.toLowerCase());
}
}
} //Changed By Nasruddin 19-SEP-16 END*/
else if (childNodeName.equalsIgnoreCase("unit__pack"))
{
unitPack=checkNull(this.genericUtility.getColumnValue("unit__pack", dom));
......@@ -209,7 +212,8 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
}
}
else if (childNodeName.equalsIgnoreCase("site_code__mfg"))
/* Comment By Nasruddin 19-SEP-16 STARt
else if (childNodeName.equalsIgnoreCase("site_code__mfg"))
{
siteCodeMfg=this.genericUtility.getColumnValue("site_code__mfg", dom);
if (siteCodeMfg == null || siteCodeMfg.trim().length() == 0 )
......@@ -272,6 +276,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
}
}
Comment By Nasruddin 19-SEP-16 END*/
else if (childNodeName.equalsIgnoreCase("net_weight"))
{
netWeight=checkDoubleNull(this.genericUtility.getColumnValue("net_weight", dom));
......
......@@ -80,6 +80,9 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
String siteCode = "";
String suppCodeMnfr = "";
String refSer = "";
String sql = "";
String itemCode = "";
String LockGroup = "";
int ctr = 0;
int currentFormNo = 0;
int cnt = 0;
......@@ -128,8 +131,10 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
if (childNodeName.equalsIgnoreCase("supp_code__mnfr"))
{
suppCodeMnfr=checkNull(this.genericUtility.getColumnValue("supp_code__mnfr", dom));
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "site_code"));
if (suppCodeMnfr != null && suppCodeMnfr.trim().length() > 0 )
/* Changed By Nasruddin [19-SEP-16] START
* siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "site_code"));
* if (suppCodeMnfr != null && suppCodeMnfr.trim().length() > 0 )
{
errCode = finCommon.isSupplier(siteCode, suppCodeMnfr, refSer, conn);
......@@ -138,9 +143,83 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} */
sql = "SELECT COUNT(1) FROM SUPPLIER WHERE SUPP_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCodeMnfr);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt == 0)
{
errCode = "VMSUPP1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
if("A".equalsIgnoreCase(editFlag))
{
itemCode =checkNull(this.genericUtility.getColumnValue("item_code", dom));
sql = "select COUNT(1) from ITEMMNFR where ITEM_CODE = ? and SUPP_CODE__MNFR = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, suppCodeMnfr);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt > 0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
if (childNodeName.equalsIgnoreCase("lock_group"))
{
LockGroup = checkNull(this.genericUtility.getColumnValue("lock_group", dom));
if( LockGroup != null && (!(LockGroup).equalsIgnoreCase("0")))
{
sql = "SELECT COUNT(1) FROM LOCK_GROUP WHERE LOCK_GROUP = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, LockGroup);
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt == 0)
{
errCode = "VTLOCKGRP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
// Changed By Nasruddin [19-SEP-16] end
}
valueXmlString.append("</Detail1>");
break;
......
......@@ -18,6 +18,7 @@ import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
//import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
......@@ -119,8 +120,10 @@ public class ItemRegNoIC extends ValidatorEJB implements ItemRegNoICLocal, ItemR
pstmt.close();
pstmt = null;
}
}
if(childNodeName.equalsIgnoreCase("item_code"))
/* Comment By Nasruddin 19-SEP-16 [START]
* if(childNodeName.equalsIgnoreCase("item_code"))
{
itemCode = genericUtility.getColumnValue("item_code", dom);
if(itemCode == null || itemCode.trim().length() == 0)
......@@ -139,7 +142,8 @@ public class ItemRegNoIC extends ValidatorEJB implements ItemRegNoICLocal, ItemR
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}Comment By Nasruddin 19-SEP-16 [END]*/
}
int errListSize = errList.size();
cnt = 0;
......
......@@ -100,8 +100,9 @@ public class ItemSerChange extends ValidatorEJB implements ItemSerChangeLocal,It
if(childNodeName.equalsIgnoreCase("item_ser"))
{
itemSer = genericUtility.getColumnValue("item_ser", dom);
if(itemSer != null && itemSer.trim().length() > 0)
{
//if(itemSer != null && itemSer.trim().length() > 0)
//{
itemSerOld = genericUtility.getColumnValue("item_ser__old", dom);
sql = "select count(*) from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
......@@ -128,7 +129,7 @@ public class ItemSerChange extends ValidatorEJB implements ItemSerChangeLocal,It
rs = null;
pstmt.close();
pstmt = null;
}
//}
}
else if(childNodeName.equalsIgnoreCase("eff_date"))
{
......
......@@ -44,39 +44,44 @@ public class ItemSerCrPolicy extends ValidatorEJB implements ItemSerCrPolicyLoca
Node parentNode = null;
Node childNode = null;
String childNodeName = "";
try {
System.out.println("xmlString ..> " + xmlString);
System.out.println("xmlString1 ..> " + xmlString1);
System.out.println("xmlString2 ..> " + xmlString2);
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0) {
dom2 = parseString("<Root>" + xmlString2 + "</Root>");
}
if (objContext != null && Integer.parseInt(objContext) == 1) {
try
{
System.out.println("xmlString ..> " + xmlString);
System.out.println("xmlString1 ..> " + xmlString1);
System.out.println("xmlString2 ..> " + xmlString2);
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0) {
dom2 = parseString("<Root>" + xmlString2 + "</Root>");
}
if (objContext != null && Integer.parseInt(objContext) == 1)
{
parentNodeList = dom2.getElementsByTagName("Header0");
parentNode = parentNodeList.item(1);
childNodeList = parentNode.getChildNodes();
for (int x = 0; x < childNodeList.getLength(); x++) {
childNode = childNodeList.item(x);
childNodeName = childNode.getNodeName();
System.out.println("childnodename ..> " + childNodeName);
if (childNodeName.equalsIgnoreCase("Detail1")) {
errString = wfValData(dom, dom1, dom2, "1", editFlag, xtraParams);
if (errString != null && errString.trim().length() > 0)
break;
} else if (childNodeName.equalsIgnoreCase("Detail2")) {
for (int x = 0; x < childNodeList.getLength(); x++)
{
childNode = childNodeList.item(x);
childNodeName = childNode.getNodeName();
System.out.println("childnodename ..> " + childNodeName);
if (childNodeName.equalsIgnoreCase("Detail1"))
{
errString = wfValData(dom, dom1, dom2, "1", editFlag, xtraParams);
if (errString != null && errString.trim().length() > 0)
break;
}
else if (childNodeName.equalsIgnoreCase("Detail2"))
{
errString = wfValData(dom, dom1, dom2, "2", editFlag, xtraParams);
break;
}
}
}
}
else {
errString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams);
}
}
else
{
errString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams);
}
} catch (Exception e) {
System.out.println("Exception : Inside ItemSerCrPolicy wfValData Method ..> " + e.getMessage());
throw new ITMException(e);
......@@ -84,163 +89,224 @@ public class ItemSerCrPolicy extends ValidatorEJB implements ItemSerCrPolicyLoca
return (errString);
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException {
System.out.println("inside wfValData ====================");
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{
System.out.println("inside wfValData ====================");
//GenericUtility genericUtility;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null;
String errString = "";
String errCode = "";
Connection conn = null;
PreparedStatement pStmt = null;
ResultSet rs = null;
String sql = "";
String userId = "";
SimpleDateFormat simpleDateFormat;
Date dateOfBirth;
int ctr = 0, currentFormNo = 0, childNodeListLength = 0, cnt = 0;
String itemSeries = "", crPolicy = "", policyType = "", descr = "";
String policySql = "", policyResult = "", policyInput = "", policyCond = "", title = "";
try {
ConnDriver connDriver = new ConnDriver();
//Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END
conn.setAutoCommit(false);
connDriver = null;
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
//genericUtility = GenericUtility.getInstance();
simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
if (objContext != null && objContext.trim().length() > 0) {
currentFormNo = Integer.parseInt(objContext);
}
switch (currentFormNo) {
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++) {
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
childNodeName = childNodeName == null ? "" : childNodeName.trim();
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 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);
rs = pStmt.executeQuery();
if (rs.next()) {
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if ((cnt > 1) && ("E".equalsIgnoreCase(editFlag))) {
errCode = "VMUCP";
errString = getErrorString("cr_policy", errCode, userId);
break;
} else if ((cnt > 0) && (!"E".equalsIgnoreCase(editFlag))) {
errCode = "VMUCP";
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")) {
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null;
String errString = "";
String errCode = "";
Connection conn = null;
PreparedStatement pStmt = null;
ResultSet rs = null;
String sql = "";
String userId = "";
SimpleDateFormat simpleDateFormat;
Date dateOfBirth;
int ctr = 0, currentFormNo = 0, childNodeListLength = 0, cnt = 0;
String itemSeries = "", crPolicy = "", policyType = "", descr = "";
String policySql = "", policyResult = "", policyInput = "", policyCond = "", title = "";
try {
ConnDriver connDriver = new ConnDriver();
//Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END
conn.setAutoCommit(false);
connDriver = null;
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
//genericUtility = GenericUtility.getInstance();
simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
}
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
childNodeName = childNodeName == null ? "" : childNodeName.trim();
// Changed By Nasruddin 22-SEP-16 START
if (childNodeName.equalsIgnoreCase("cr_policy"))
{
crPolicy = genericUtility.getColumnValue("cr_policy", dom);
itemSeries = genericUtility.getColumnValue("item_ser", dom);
if( crPolicy == null || crPolicy.trim().length() == 0)
{
errCode = "VMICP";
errString = getErrorString("cr_policy", errCode, userId);
break;
}
else
{
cnt = 0;
sql = "SELECT COUNT(1) FROM ITEMSER_CR_POLICY WHERE ITEM_SER = ? AND CR_POLICY = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, itemSeries);
pStmt.setString(2, crPolicy);
rs = pStmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
}
/*
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 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);
rs = pStmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if ((cnt > 1) && ("E".equalsIgnoreCase(editFlag)))
{
errCode = "VMUCP";
errString = getErrorString("cr_policy", errCode, userId);
break;
}
else if ((cnt > 0) && (!"E".equalsIgnoreCase(editFlag)))
{
errCode = "VMUCP";
errString = getErrorString("cr_policy", errCode, userId);
break;
}
sql = null;
sql= "";
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;
Comment By Nasruddin Start [20-SEP=-16] START
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;
}
}
Comment By Nasruddin Start [20-SEP=-16] END*/
}
/* Comment By Nasruddin 20-SEP-16 START
else if (childNodeName.equalsIgnoreCase("item_ser"))
{
itemSeries = genericUtility.getColumnValue("item_ser", dom);
itemSeries = itemSeries == null ? "" : itemSeries.trim();
if (itemSeries.length() > 0) {
if (itemSeries.length() > 0)
{
sql = "select nvl(count(1),0) from itemser where item_ser = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, itemSeries);
rs = pStmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if (cnt == 0) {
if (cnt == 0)
{
errCode = "VTITEMSER1";
errString = getErrorString("item_ser", errCode, userId);
break;
}
} else {
}
else
{
errCode = "VTITEMSER5";
errString = getErrorString("item_ser", errCode, userId);
break;
}
} else if (childNodeName.equalsIgnoreCase("title")) {
}
else if (childNodeName.equalsIgnoreCase("title"))
{
title = genericUtility.getColumnValue("title", dom);
title = title == null ? "" : title.trim();
if (title.length() == 0) {
if (title.length() == 0)
{
errCode = "VISCRPTLNL";
errString = getErrorString("title", errCode, userId);
break;
}
} else if (childNodeName.equalsIgnoreCase("descr")) {
}
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) {
if (descr.length() == 0)
{
errCode = "DESCBLK";
errString = getErrorString("descr", errCode, userId);
break;
} else {
}
else
{
cnt = 0;
if("S".equalsIgnoreCase(policyType))
{
......@@ -250,33 +316,38 @@ public class ItemSerCrPolicy extends ValidatorEJB implements ItemSerCrPolicyLoca
pStmt.setString(2, crPolicy);
pStmt.setString(3, descr);
rs = pStmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if (cnt == 0) {
if (cnt == 0)
{
errCode = "VISCRPDRM";
errString = getErrorString("descr", errCode, userId);
break;
}
}
}
} else if (childNodeName.equalsIgnoreCase("policy_sql")) {
}
else if (childNodeName.equalsIgnoreCase("policy_sql"))
{
policySql = genericUtility.getColumnValue("policy_sql", dom);
policySql = policySql == null ? "" : policySql.trim();
if (policySql.length() != 0) {
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);
......@@ -290,41 +361,61 @@ public class ItemSerCrPolicy extends ValidatorEJB implements ItemSerCrPolicyLoca
errString = getErrorString("policy_condition", errCode, userId);
break;
}
}
}
}
break;
}
} catch (Exception e) {
System.out.println("^^^^^^^ ItemSerCrPolicy Validation Error ^^^^^^^");
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
} finally {
try {
if (conn != null) {
conn.close();
}
conn = null;
genericUtility = null;
parentNodeList = null;
childNodeList = null;
parentNode = null;
childNode = null;
childNodeName = null;
errCode = null;
sql = null;
userId = null;
simpleDateFormat = null;
dateOfBirth = null;
itemSeries = null;
crPolicy = null;
} catch (Exception d) {
d.printStackTrace();
throw new ITMException(d);
}
}
return errString;
}
}Comment By Nasruddin 20-SEP-16 END*/
}
break;
}
}
catch (Exception e)
{
System.out.println("^^^^^^^ ItemSerCrPolicy Validation Error ^^^^^^^");
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
finally
{
try
{
if (conn != null)
{
// Changed By Nasruddin START 22-SEP-16
if(pStmt != null)
{
pStmt.close();
pStmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// Changed By Nasruddin END 22-SEP-16
conn.close();
}
conn = null;
genericUtility = null;
parentNodeList = null;
childNodeList = null;
parentNode = null;
childNode = null;
childNodeName = null;
errCode = null;
sql = null;
userId = null;
simpleDateFormat = null;
dateOfBirth = null;
itemSeries = null;
crPolicy = null;
}
catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
return errString;
}
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException {
......
......@@ -25,7 +25,7 @@ import org.w3c.dom.NodeList;
public class ItemSerIC extends ValidatorEJB implements ItemSerICLocal, ItemSerICRemote
{
E12GenericUtility genericUtility= new E12GenericUtility();
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
String errString = "";
......@@ -88,33 +88,41 @@ public class ItemSerIC extends ValidatorEJB implements ItemSerICLocal, ItemSerIC
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("Child Node Name------->>["+childNodeName+"]");
if(childNodeName.equalsIgnoreCase("item_ser")){
if(childNodeName.equalsIgnoreCase("item_ser"))
{
String keyFlag="";
itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom));
keyFlag=getNameOrDescrForCode(conn, "transetup", "key_flag", "tran_window", "w_itemser");
keyFlag=keyFlag==null ? "M" : keyFlag.trim();
if("M".equalsIgnoreCase(keyFlag) && itemSer.length() ==0){
errCode = "VMCODNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
if("M".equalsIgnoreCase(keyFlag) && itemSer.length() ==0)
{
errCode = "VMCODNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if("A".equalsIgnoreCase(editFlag.trim())){
cnt=getDBRowCount(conn,"itemser","item_ser",itemSer);
if(cnt > 0){
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if("A".equalsIgnoreCase(editFlag.trim()))
{
cnt=getDBRowCount(conn,"itemser","item_ser",itemSer);
if(cnt > 0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("descr")){
else if(childNodeName.equalsIgnoreCase("descr"))
{
String descr="";
descr = checkNull(genericUtility.getColumnValue("descr", dom));
if(descr.length()== 0){
if(descr.length()== 0)
{
errCode = "VMDESCR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
}
else
{
itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom));
sql="select count(1) from itemser where item_ser <> ? and descr = ?";
pstmt=conn.prepareStatement(sql);
......@@ -132,642 +140,820 @@ public class ItemSerIC extends ValidatorEJB implements ItemSerICLocal, ItemSerIC
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("tax_chap")){
else if(childNodeName.equalsIgnoreCase("tax_chap"))
{
taxChap = checkNull(genericUtility.getColumnValue("tax_chap", dom));
System.out.println("tAX CHAP ----->>>["+taxChap+"]");
if(taxChap.length() > 0){
cnt=getDBRowCount(conn,"TAXCHAP","TAX_CHAP",taxChap);
if(cnt == 0){
errCode = "VMTAXCHP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(taxChap.length() > 0)
{
cnt=getDBRowCount(conn,"TAXCHAP","TAX_CHAP",taxChap);
if(cnt == 0)
{
errCode = "VMTAXCHP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("site_code")){
else if(childNodeName.equalsIgnoreCase("site_code"))
{
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
System.out.println("siteCode ----->>>["+siteCode+"]");
if(siteCode.length() > 0){
cnt=getDBRowCount(conn,"SITE","SITE_CODE",siteCode);
if(cnt == 0){
errCode = "VMSITE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(siteCode.length() > 0)
{
cnt=getDBRowCount(conn,"SITE","SITE_CODE",siteCode);
if(cnt == 0)
{
errCode = "VMSITE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("loc_code")){
else if(childNodeName.equalsIgnoreCase("loc_code"))
{
locCode = checkNull(genericUtility.getColumnValue("loc_code", dom));
System.out.println("locCode ----->>>["+locCode+"]");
if(locCode.length() > 0){
cnt=getDBRowCount(conn,"LOCATION","LOC_CODE",locCode);
if(cnt == 0){
errCode = "VMLOC";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(locCode.length() > 0)
{
cnt=getDBRowCount(conn,"LOCATION","LOC_CODE",locCode);
if(cnt == 0)
{
errCode = "VMLOC";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("unit")){
else if(childNodeName.equalsIgnoreCase("unit"))
{
unit = checkNull(genericUtility.getColumnValue("unit", dom));
System.out.println("unit ----->>>["+unit+"]");
if(unit.length() > 0){
cnt=getDBRowCount(conn,"UOM","unit",unit);
if(cnt == 0){
errCode = "VMUNIT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(unit.length() > 0)
{
cnt=getDBRowCount(conn,"UOM","unit",unit);
if(cnt == 0)
{
errCode = "VMUNIT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("item_ser__crpolicy")){
else if(childNodeName.equalsIgnoreCase("item_ser__crpolicy"))
{
itemSerCrpolicy = checkNull(genericUtility.getColumnValue("item_ser__crpolicy", dom));
System.out.println("itemSerCrpolicy ----->>>["+itemSerCrpolicy+"]");
itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom));
if(itemSerCrpolicy.length() > 0){
cnt=getDBRowCount(conn,"ITEMSER","ITEM_SER",itemSerCrpolicy);
if(cnt == 0 && !(itemSer.equalsIgnoreCase(itemSerCrpolicy))){
errCode = "VTITEMSER1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(itemSerCrpolicy.length() > 0)
{
cnt=getDBRowCount(conn,"ITEMSER","ITEM_SER",itemSerCrpolicy);
if(cnt == 0 && !(itemSer.equalsIgnoreCase(itemSerCrpolicy)))
{
errCode = "VTITEMSER1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__ap")){
else if(childNodeName.equalsIgnoreCase("acct_code__ap"))
{
acctCodeAp = checkNull(genericUtility.getColumnValue("acct_code__ap", dom));
System.out.println("acctCodeAp---->>["+acctCodeAp+"]");
if(acctCodeAp.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeAp);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeAp);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(acctCodeAp.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeAp);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeAp);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__pr")){
else if(childNodeName.equalsIgnoreCase("acct_code__pr"))
{
acctCodePr = checkNull(genericUtility.getColumnValue("acct_code__pr", dom));
System.out.println("acctCodePr---->>["+acctCodePr+"]");
if(acctCodePr.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodePr);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodePr);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodePr.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodePr);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodePr);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__in")){
else if(childNodeName.equalsIgnoreCase("acct_code__in"))
{
acctCodeIn = checkNull(genericUtility.getColumnValue("acct_code__in", dom));
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeIn);
System.out.println("acctCodeIn---->>["+acctCodeIn+"]");
if(acctCodeIn.length() > 0){
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeIn);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeIn.length() > 0)
{
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeIn);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__ph")){
else if(childNodeName.equalsIgnoreCase("acct_code__ph"))
{
acctCodePh = checkNull(genericUtility.getColumnValue("acct_code__ph", dom));
System.out.println("acctCodePh---->>["+acctCodePh+"]");
if(acctCodePh.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodePh);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodePh);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodePh.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodePh);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodePh);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__sal")){
else if(childNodeName.equalsIgnoreCase("acct_code__sal"))
{
acctCodeSal = checkNull(genericUtility.getColumnValue("acct_code__sal", dom));
System.out.println("acctCodeSal---->>["+acctCodeSal+"]");
if(acctCodeSal.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeSal);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeSal);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeSal.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeSal);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeSal);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__frt")){
else if(childNodeName.equalsIgnoreCase("acct_code__frt"))
{
acctCodeFrt = checkNull(genericUtility.getColumnValue("acct_code__frt", dom));
System.out.println("acctCodeFrt---->>["+acctCodeFrt+"]");
if(acctCodeFrt.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeFrt);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeFrt);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeFrt.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeFrt);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeFrt);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__dis")){
else if(childNodeName.equalsIgnoreCase("acct_code__dis"))
{
acctCodeDis = checkNull(genericUtility.getColumnValue("acct_code__dis", dom));
System.out.println("acctCodeDis---->>["+acctCodeDis+"]");
if(acctCodeDis.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeDis);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeDis);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeDis.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeDis);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeDis);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__gsd")){
else if(childNodeName.equalsIgnoreCase("acct_code__gsd"))
{
acctCodeGsd = checkNull(genericUtility.getColumnValue("acct_code__gsd", dom));
System.out.println("acctCodeGsd---->>["+acctCodeGsd+"]");
if(acctCodeGsd.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeGsd);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeGsd);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(acctCodeGsd.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeGsd);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeGsd);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__sret")){
else if(childNodeName.equalsIgnoreCase("acct_code__sret"))
{
acctCodeSret = checkNull(genericUtility.getColumnValue("acct_code__sret", dom));
System.out.println("acctCodeSret---->>["+acctCodeSret+"]");
if(acctCodeSret.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeSret);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeSret);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeSret.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeSret);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeSret);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__ciss")){
else if(childNodeName.equalsIgnoreCase("acct_code__ciss"))
{
acctCodeCiss = checkNull(genericUtility.getColumnValue("acct_code__ciss", dom));
System.out.println("acctCodeCiss---->>["+acctCodeCiss+"]");
if(acctCodeCiss.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeCiss);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeCiss);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeCiss.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeCiss);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeCiss);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__adcost")){
else if(childNodeName.equalsIgnoreCase("acct_code__adcost"))
{
acctCodeAdcost = checkNull(genericUtility.getColumnValue("acct_code__adcost", dom));
System.out.println("acctCodeAdcost---->>["+acctCodeAdcost+"]");
if(acctCodeAdcost.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeAdcost);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeAdcost);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeAdcost.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeAdcost);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeAdcost);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__oh")){
else if(childNodeName.equalsIgnoreCase("acct_code__oh"))
{
acctCodeOh = checkNull(genericUtility.getColumnValue("acct_code__oh", dom));
System.out.println("acctCodeOh---->>["+acctCodeOh+"]");
if(acctCodeOh.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeOh);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeOh);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeOh.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeOh);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeOh);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__wp")){
else if(childNodeName.equalsIgnoreCase("acct_code__wp"))
{
acctCodeWp = checkNull(genericUtility.getColumnValue("acct_code__wp", dom));
System.out.println("acctCodeWp---->>["+acctCodeWp+"]");
if(acctCodeWp.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeWp);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeWp);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeWp.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeWp);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeWp);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__cogs")){
else if(childNodeName.equalsIgnoreCase("acct_code__cogs"))
{
acctCodeCogs = checkNull(genericUtility.getColumnValue("acct_code__cogs", dom));
System.out.println("acctCodeCogs---->>["+acctCodeCogs+"]");
if(acctCodeCogs.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeCogs);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeCogs);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeCogs.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeCogs);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeCogs);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__wp_rcp")){
else if(childNodeName.equalsIgnoreCase("acct_code__wp_rcp"))
{
acctCodeWpRcp = checkNull(genericUtility.getColumnValue("acct_code__wp_rcp", dom));
System.out.println("acctCodeWpRcp---->>["+acctCodeWpRcp+"]");
if(acctCodeWpRcp.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeWpRcp);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeWpRcp);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeWpRcp.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeWpRcp);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeWpRcp);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__qc_sample")){
else if(childNodeName.equalsIgnoreCase("acct_code__qc_sample"))
{
acctCodeQcSample = checkNull(genericUtility.getColumnValue("acct_code__qc_sample", dom));
System.out.println("acctCodeQcSample---->>["+acctCodeQcSample+"]");
if(acctCodeQcSample.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeQcSample);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeQcSample);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeQcSample.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeQcSample);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeQcSample);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__yld_loss")){
else if(childNodeName.equalsIgnoreCase("acct_code__yld_loss"))
{
acctCodeYldLoss = checkNull(genericUtility.getColumnValue("acct_code__yld_loss", dom));
System.out.println("acctCodeYldLoss---->>["+acctCodeYldLoss+"]");
if(acctCodeYldLoss.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeYldLoss);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeYldLoss);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeYldLoss.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeYldLoss);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeYldLoss);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("acct_code__yld_gain")){
else if(childNodeName.equalsIgnoreCase("acct_code__yld_gain"))
{
acctCodeYldGain = checkNull(genericUtility.getColumnValue("acct_code__yld_gain", dom));
System.out.println("acctCodeYldGain---->>["+acctCodeYldGain+"]");
if(acctCodeYldGain.length() > 0){
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeYldGain);
if(cnt == 0){
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeYldGain);
if(!("Y".equalsIgnoreCase(active))){
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if(acctCodeYldGain.length() > 0)
{
cnt=getDBRowCount(conn,"ACCOUNTS","ACCT_CODE",acctCodeYldGain);
if(cnt == 0)
{
errCode = "VMACCT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
active=getNameOrDescrForCode(conn, "ACCOUNTS", "ACTIVE", "ACCT_CODE", acctCodeYldGain);
if(!("Y".equalsIgnoreCase(active)))
{
errCode = "VMACCTA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__ap")){
else if(childNodeName.equalsIgnoreCase("cctr_code__ap"))
{
cctrCodeAp = checkNull(genericUtility.getColumnValue("cctr_code__ap", dom));
System.out.println("cctrCodeAp---->>["+cctrCodeAp+"]");
if(cctrCodeAp.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeAp);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeAp.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeAp);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__pr")){
else if(childNodeName.equalsIgnoreCase("cctr_code__pr"))
{
cctrCodePr = checkNull(genericUtility.getColumnValue("cctr_code__pr", dom));
System.out.println("cctrCodePr---->>["+cctrCodePr+"]");
if(cctrCodePr.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodePr);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodePr.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodePr);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__in")){
else if(childNodeName.equalsIgnoreCase("cctr_code__in"))
{
cctrCodeIn = checkNull(genericUtility.getColumnValue("cctr_code__in", dom));
System.out.println("cctrCodeIn---->>["+cctrCodeIn+"]");
if(cctrCodeIn.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeIn);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeIn.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeIn);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__ph")){
else if(childNodeName.equalsIgnoreCase("cctr_code__ph"))
{
cctrCodePh = checkNull(genericUtility.getColumnValue("cctr_code__ph", dom));
System.out.println("acctCodePr---->>["+cctrCodePh+"]");
if(cctrCodePh.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodePh);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodePh.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodePh);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__sal")){
else if(childNodeName.equalsIgnoreCase("cctr_code__sal"))
{
cctrCodeSal = checkNull(genericUtility.getColumnValue("cctr_code__sal", dom));
System.out.println("cctrCodeSal---->>["+cctrCodeSal+"]");
if(cctrCodeSal.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeSal);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeSal.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeSal);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__frt")){
else if(childNodeName.equalsIgnoreCase("cctr_code__frt"))
{
cctrCodeFrt = checkNull(genericUtility.getColumnValue("cctr_code__frt", dom));
System.out.println("cctrCodeFrt---->>["+cctrCodeFrt+"]");
if(cctrCodeFrt.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeFrt);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeFrt.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeFrt);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__dis")){
else if(childNodeName.equalsIgnoreCase("cctr_code__dis"))
{
cctrCodeDis = checkNull(genericUtility.getColumnValue("cctr_code__dis", dom));
System.out.println("cctrCodeDis---->>["+cctrCodeDis+"]");
if(cctrCodeDis.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeDis);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeDis.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeDis);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__gsd")){
else if(childNodeName.equalsIgnoreCase("cctr_code__gsd"))
{
cctrCodeGsd = checkNull(genericUtility.getColumnValue("cctr_code__gsd", dom));
System.out.println("cctrCodeGsd---->>["+cctrCodeGsd+"]");
if(cctrCodeGsd.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeGsd);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeGsd.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeGsd);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__sret")){
else if(childNodeName.equalsIgnoreCase("cctr_code__sret"))
{
cctrCodeSret = checkNull(genericUtility.getColumnValue("cctr_code__sret", dom));
System.out.println("cctrCodeSret---->>["+cctrCodeSret+"]");
if(cctrCodeSret.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeSret);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeSret.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeSret);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__ciss")){
else if(childNodeName.equalsIgnoreCase("cctr_code__ciss"))
{
cctrCodeCiss = checkNull(genericUtility.getColumnValue("cctr_code__ciss", dom));
System.out.println("cctrCodeCiss---->>["+cctrCodeCiss+"]");
if(cctrCodeCiss.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeCiss);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeCiss.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeCiss);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__adcost")){
else if(childNodeName.equalsIgnoreCase("cctr_code__adcost"))
{
cctrCodeAdcost = checkNull(genericUtility.getColumnValue("cctr_code__adcost", dom));
System.out.println("cctrCodeAdcost---->>["+cctrCodeAdcost+"]");
if(cctrCodeAdcost.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeAdcost);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeAdcost.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeAdcost);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__oh")){
else if(childNodeName.equalsIgnoreCase("cctr_code__oh"))
{
cctrCodeOh = checkNull(genericUtility.getColumnValue("cctr_code__oh", dom));
System.out.println("cctrCodeOh---->>["+cctrCodeOh+"]");
if(cctrCodeOh.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeOh);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeOh.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeOh);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__wp")){
else if(childNodeName.equalsIgnoreCase("cctr_code__wp"))
{
cctrCodeWp = checkNull(genericUtility.getColumnValue("cctr_code__wp", dom));
System.out.println("cctrCodeWp---->>["+cctrCodeWp+"]");
if(cctrCodeWp.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeWp);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeWp.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeWp);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__cogs")){
else if(childNodeName.equalsIgnoreCase("cctr_code__cogs"))
{
cctrCodeCogs = checkNull(genericUtility.getColumnValue("cctr_code__cogs", dom));
System.out.println("cctrCodeCogs---->>["+cctrCodeCogs+"]");
if(cctrCodeCogs.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeCogs);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeCogs.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeCogs);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__wp_rcp")){
else if(childNodeName.equalsIgnoreCase("cctr_code__wp_rcp"))
{
cctrCodeWpRcp = checkNull(genericUtility.getColumnValue("cctr_code__wp_rcp", dom));
System.out.println("cctrCodeWpRcp---->>["+cctrCodeWpRcp+"]");
if(cctrCodeWpRcp.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeWpRcp);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeWpRcp.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeWpRcp);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__qc_sample")){
else if(childNodeName.equalsIgnoreCase("cctr_code__qc_sample"))
{
cctrCodeQcSample = checkNull(genericUtility.getColumnValue("cctr_code__qc_sample", dom));
System.out.println("cctrCodeQcSample---->>["+cctrCodeQcSample+"]");
if(cctrCodeQcSample.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeQcSample);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeQcSample.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeQcSample);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__yld_loss")){
else if(childNodeName.equalsIgnoreCase("cctr_code__yld_loss"))
{
cctrCodeYldLoss = checkNull(genericUtility.getColumnValue("cctr_code__yld_loss", dom));
System.out.println("cctrCodeYldLoss---->>["+cctrCodeYldLoss+"]");
if(cctrCodeYldLoss.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeYldLoss);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeYldLoss.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeYldLoss);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if(childNodeName.equalsIgnoreCase("cctr_code__yld_gain")){
else if(childNodeName.equalsIgnoreCase("cctr_code__yld_gain"))
{
cctrCodeYldGain = checkNull(genericUtility.getColumnValue("cctr_code__yld_gain", dom));
System.out.println("cctrCodeYldGain---->>["+cctrCodeYldGain+"]");
if(cctrCodeYldGain.length() > 0){
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeYldGain);
if(cnt == 0){
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(cctrCodeYldGain.length() > 0)
{
cnt=getDBRowCount(conn,"COSTCTR","CCTR_CODE",cctrCodeYldGain);
if(cnt == 0)
{
errCode = "VMCCTR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
}
......@@ -909,7 +1095,7 @@ public class ItemSerIC extends ValidatorEJB implements ItemSerICLocal, ItemSerIC
}
if(cnt1 > 0)
lsApplyax = "NULLFOUND";
rs.close();
rs = null;
pstmt.close();
......@@ -1000,83 +1186,83 @@ public class ItemSerIC extends ValidatorEJB implements ItemSerICLocal, ItemSerIC
}
private int getDBRowCount(Connection conn, String table_name, String whrCondCol, String whrCondVal)
{
int count=-1;
if(conn!=null){
ResultSet rs=null;
PreparedStatement pstmt = null;
String sql="select count(1) from "+table_name+" where "+whrCondCol+" = ?";
System.out.println("SQL in getDBRowCount method : "+sql);
try
{
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,whrCondVal);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch(SQLException e)
{
System.out.println("SQL Exception In getDBRowCount method of ItemSerIC Class : "+e.getMessage());
e.printStackTrace();
}
catch(Exception ex)
int count=-1;
if(conn!=null){
ResultSet rs=null;
PreparedStatement pstmt = null;
String sql="select count(1) from "+table_name+" where "+whrCondCol+" = ?";
System.out.println("SQL in getDBRowCount method : "+sql);
try
{
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,whrCondVal);
rs = pstmt.executeQuery();
if(rs.next())
{
System.out.println("Exception In getDBRowCount method of ItemSerIC Class : "+ex.getMessage());
ex.printStackTrace();
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch(SQLException e)
{
System.out.println("SQL Exception In getDBRowCount method of ItemSerIC Class : "+e.getMessage());
e.printStackTrace();
}
catch(Exception ex)
{
System.out.println("Exception In getDBRowCount method of ItemSerIC Class : "+ex.getMessage());
ex.printStackTrace();
}
}
return count;
}
private String getNameOrDescrForCode(Connection conn, String table_name, String descr_col_name,String whrCondCol, String whrCondVal)
{
String descr = null;
if(conn!=null){
ResultSet rs=null;
PreparedStatement pstmt = null;
String sql="SELECT "+descr_col_name+" FROM "+table_name+" WHERE "+whrCondCol+" = ?";
System.out.println("SQL in getNameOrDescrForCode method : "+sql);
try
{
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,whrCondVal);
rs = pstmt.executeQuery();
if(rs.next())
{
descr = rs.getString(descr_col_name);
}
descr=descr==null ? "" : descr;
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
catch(SQLException e)
{
System.out.println("SQL Exception In getNameOrDescrForCode method of ItemSerIC Class : "+e.getMessage());
e.printStackTrace();
}
catch(Exception ex)
String descr = null;
if(conn!=null){
ResultSet rs=null;
PreparedStatement pstmt = null;
String sql="SELECT "+descr_col_name+" FROM "+table_name+" WHERE "+whrCondCol+" = ?";
System.out.println("SQL in getNameOrDescrForCode method : "+sql);
try
{
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,whrCondVal);
rs = pstmt.executeQuery();
if(rs.next())
{
System.out.println("Exception In getNameOrDescrForCode method of ItemSerIC Class : "+ex.getMessage());
ex.printStackTrace();
descr = rs.getString(descr_col_name);
}
descr=descr==null ? "" : descr;
rs.close();
rs=null;
pstmt.close();
pstmt=null;
}
catch(SQLException e)
{
System.out.println("SQL Exception In getNameOrDescrForCode method of ItemSerIC Class : "+e.getMessage());
e.printStackTrace();
}
catch(Exception ex)
{
System.out.println("Exception In getNameOrDescrForCode method of ItemSerIC Class : "+ex.getMessage());
ex.printStackTrace();
}
}
return descr;
}
private String checkNull(String input){
......@@ -1085,5 +1271,5 @@ public class ItemSerIC extends ValidatorEJB implements ItemSerICLocal, ItemSerIC
}
return input.trim();
}
}
......@@ -103,8 +103,9 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(editFlag.equalsIgnoreCase("A"))
{
/* Comment By Nasruddin 19-SEP-16
* if(editFlag.equalsIgnoreCase("A"))
{*/
if(childNodeName.equalsIgnoreCase("item_type"))
{
itemType = checkNull(genericUtility.getColumnValue("item_type", dom));
......@@ -137,7 +138,8 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
pstmt = null;
}
}
}
//}
/* Comment By Nasruddin 19-SEP-16 START
else if(childNodeName.equalsIgnoreCase("unit"))
{
unit = checkNull(genericUtility.getColumnValue("unit", dom));
......@@ -294,7 +296,7 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
pstmt.close();
pstmt = null;
}
}
} Comment By Nasruddin 19-SEP-16 END*/
else if(childNodeName.equalsIgnoreCase("route_code"))
{
routeCode = checkNull(genericUtility.getColumnValue("route_code", dom));
......
......@@ -5,7 +5,6 @@ import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
......@@ -13,9 +12,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......@@ -59,9 +56,9 @@ public class LocationMaster extends ValidatorEJB implements
public String wfValData(Document curDom, Document hdrDom, Document allDom,
String objContext, String editFlag, String xtraParams)
throws RemoteException, ITMException {
System.out
.println("####<<<<<<=======call mfg item wfValData Method=======>>>>>>>#####");
throws RemoteException, ITMException
{
System.out.println("####<<<<<<=======call mfg item wfValData Method=======>>>>>>>#####");
System.out.println(" editFlag validation===>>" + editFlag);
String userId = "";
String childNodeName = null;
......@@ -106,7 +103,8 @@ public class LocationMaster extends ValidatorEJB implements
System.out.println("Current Form No. :- " + currentFormNo);
switch (currentFormNo) {
switch (currentFormNo)
{
case 1:
System.out.println(" editFlag===>>" + editFlag);
parentNodeList = curDom.getElementsByTagName("Detail1");
......@@ -114,108 +112,114 @@ public class LocationMaster extends ValidatorEJB implements
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++) {
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if ("loc_code".equalsIgnoreCase(childNodeName)) {
if ("loc_code".equalsIgnoreCase(childNodeName))
{
//if ((childNode.getFirstChild() == null)) {
sql = "select key_flag from transetup where tran_window = 'w_location'";
sql = "select key_flag from transetup where tran_window = 'w_location'";
loc_code = checkNull(genericUtility.getColumnValue(
"loc_code", curDom));
facility_code = checkNull(genericUtility.getColumnValue(
"facility_code", curDom));
loc_code = checkNull(genericUtility.getColumnValue("loc_code", curDom));
// Comment By Nasruddin [20-SEP-16]
// facility_code = checkNull(genericUtility.getColumnValue("facility_code", curDom));
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next())
{
key_flag = rs.getString("key_flag");
}
//Changed By Nasruddin [20-sep-16]
key_flag = key_flag == null?"M":key_flag.trim();
if (((key_flag.isEmpty()) || key_flag.equalsIgnoreCase("M")) && (loc_code.isEmpty()))
{
errList.add("VMCODNULL");
errFields.add(childNodeName.toLowerCase());
break;
}
else if (key_flag.equalsIgnoreCase("A"))
{
// Changed By Nasruddin 20-SEP-16 sql
//sql = "select count(*) as COUNT from location where loc_code = ? and facility_code=?";
sql = "select count(1) as COUNT from location where loc_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loc_code.trim());
// pstmt.setString(2, facility_code.trim());
rs = pstmt.executeQuery();
if (rs.next()) {
key_flag = rs.getString("key_flag");
if (rs.next())
{
count = rs.getInt("COUNT");
}
if (((key_flag.isEmpty()) || key_flag
.equalsIgnoreCase("M"))
&& (loc_code.isEmpty())) {
errList.add("VMCODNULL");
if (count > 0)
{
errList.add("VMDUPL1");
errFields.add(childNodeName.toLowerCase());
break;
} else if (key_flag.equalsIgnoreCase("A")) {
sql = "select count(*) as COUNT from location where loc_code = ? and facility_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loc_code.trim());
pstmt.setString(2, facility_code.trim());
rs = pstmt.executeQuery();
if (rs.next()) {
count = rs.getInt("COUNT");
}
if (count > 0) {
errList.add("VMDUPL1");
errFields.add(childNodeName.toLowerCase());
break;
}
}
}
callPstRs(pstmt, rs);
callPstRs(pstmt, rs);
//}
}
else if ("site_code".equalsIgnoreCase(childNodeName)) {
if (!(childNode.getFirstChild() == null)) {
else if ("site_code".equalsIgnoreCase(childNodeName))
{
/*Comment By Nasruddin [20-SEP-16]
* if (!(childNode.getFirstChild() == null))
{
*/
site_code = checkNull(genericUtility.getColumnValue("site_code", curDom));
if(site_code != null && site_code.trim().length() > 0)
{
sql = "select count(*) as COUNT from site where site_code = ?";
site_code = checkNull(genericUtility
.getColumnValue("site_code", curDom));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, site_code.trim());
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt("COUNT");
}
if (count <= 0) {
callPstRs(pstmt, rs);
if (count <= 0)
{
errList.add("VTSITE1");
errFields.add(childNodeName.toLowerCase());
break;
}
callPstRs(pstmt, rs);
}
}
else if ("item_code".equalsIgnoreCase(childNodeName)) {
if (!(childNode.getFirstChild() == null)) {
//Changed By Nasruddin 20-SEP-16
//if (!(childNode.getFirstChild() == null))
item_code = checkNull(genericUtility.getColumnValue("item_code", curDom));
if(item_code != null && item_code.trim().length() >0)
{
sql = "select count(*) as COUNT from item where item_code = ?";
item_code = checkNull(genericUtility
.getColumnValue("item_code", curDom));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, item_code.trim());
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt("COUNT");
}
if (count <= 0) {
callPstRs(pstmt, rs);
if (count <= 0)
{
errList.add("VTITEM1");
errFields.add(childNodeName.toLowerCase());
break;
}
callPstRs(pstmt, rs);
}
}
else if ("inv_stat".equalsIgnoreCase(childNodeName)) {
/* Comment By Nasruddin [20-SEP-16] START
else if ("inv_stat".equalsIgnoreCase(childNodeName))
{
if (!(childNode.getFirstChild() == null)) {
sql = "select count(*) as COUNT from invstat where inv_stat = ?";
......@@ -240,77 +244,74 @@ public class LocationMaster extends ValidatorEJB implements
callPstRs(pstmt, rs);
}
}
else if ("site_code__own".equalsIgnoreCase(childNodeName)) {
if (!(childNode.getFirstChild() == null)) {
/* Comment By Nasruddin [20-SEP-16] END*/
else if ("site_code__own".equalsIgnoreCase(childNodeName))
{
// Changed by Nasruddin [20-SEP-16]
//if (!(childNode.getFirstChild() == null))
site_code__own = checkNull(genericUtility.getColumnValue("site_code__own", curDom));
if(site_code__own != null && site_code__own.trim().length() > 0)
{
sql = "select count(*) as COUNT from site where site_code = ?";
site_code__own = checkNull(genericUtility
.getColumnValue("site_code__own", curDom));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, site_code__own.trim());
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt("COUNT");
}
if (count <= 0) {
callPstRs(pstmt, rs);
if (count <= 0)
{
errList.add("VMSITE1");
errFields.add(childNodeName.toLowerCase());
break;
}
callPstRs(pstmt, rs);
}
}
else if ("facility_code".equalsIgnoreCase(childNodeName)) {
if (!(childNode.getFirstChild() == null)) {
else if ("facility_code".equalsIgnoreCase(childNodeName))
{
// Changed By Nasruddin [20-SEP-16]
//if (!(childNode.getFirstChild() == null))
facility_code = checkNull(genericUtility.getColumnValue("facility_code", curDom));
if( facility_code != null && facility_code.trim().length() > 0)
{
sql = "select count(*) as COUNT from facility where facility_code = ?";
facility_code = checkNull(genericUtility
.getColumnValue("facility_code", curDom));
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, facility_code.trim());
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
count = rs.getInt("COUNT");
}
if (count <= 0) {
callPstRs(pstmt, rs);
if (count <= 0)
{
errList.add("VMFACI1");
errFields.add(childNodeName.toLowerCase());
break;
}
callPstRs(pstmt, rs);
}
}
else if ("valid_upto".equalsIgnoreCase(childNodeName)) {
if (!(childNode.getFirstChild() == null)) {
valid_upto = checkNull(genericUtility
.getColumnValue("valid_upto", curDom));
eff_from = checkNull(genericUtility.getColumnValue(
"eff_from", curDom));
SimpleDateFormat sdf = new SimpleDateFormat(
genericUtility.getApplDateFormat());
System.out.println("valid_upto: " + valid_upto
+ " eff_from: " + eff_from);
else if ("valid_upto".equalsIgnoreCase(childNodeName))
{
//Changed By Nasruddin [20-SEP-16]
//if (!(childNode.getFirstChild() == null))
valid_upto = checkNull(genericUtility.getColumnValue("valid_upto", curDom));
eff_from = checkNull(genericUtility.getColumnValue("eff_from", curDom));
if(valid_upto != null && valid_upto.trim().length() > 0 && eff_from != null && eff_from.trim().length() > 0)
{
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
System.out.println("valid_upto: " + valid_upto + " eff_from: " + eff_from);
Date validUpto = sdf.parse(valid_upto);
Date effFrom = sdf.parse(eff_from);
System.out.println("validUpto: " + validUpto
+ " effFrom: " + effFrom);
System.out.println("validUpto: " + validUpto+ " effFrom: " + effFrom);
if (effFrom.after(validUpto)) {
if (effFrom.after(validUpto))
{
errList.add("VFRTODATE");
errFields.add(childNodeName.toLowerCase());
break;
......@@ -388,7 +389,7 @@ public class LocationMaster extends ValidatorEJB implements
}
errString = errStringXml.toString();
return errString;
}
}
public String cctrVal(String cctrCode, String acctCode, Connection conn) {
String sql = "", active = "", errString = "CONFIRMED";
......@@ -746,7 +747,8 @@ public class LocationMaster extends ValidatorEJB implements
}
private String checkNull(String input) {
if (input == null) {
if (input == null)
{
input = "";
}
return input;
......
......@@ -134,14 +134,17 @@ public class PackingDetIC extends ValidatorEJB implements PackingDetICLocal, Pac
if(childNodeName.equalsIgnoreCase("count_code"))
{
countCode = genericUtility.getColumnValue("count_code", dom);
/* Comment By Nasruddin 20-sep-16 START
if(countCode == null || countCode.trim().length() == 0)
{
errCode = "VMCOUNTCD ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if(countCode != null && countCode.trim().length() > 0 )
{
else Comment By Nasruddin 20-sep-16 END */
//if(countCode != null && countCode.trim().length() > 0 )
//{
sql = "select count(*) from country where count_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,countCode);
......@@ -161,7 +164,7 @@ public class PackingDetIC extends ValidatorEJB implements PackingDetICLocal, Pac
rs = null;
pstmt.close();
pstmt = null;
}
//}
}
}
......
......@@ -73,7 +73,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
String userId = "";
String sql = "";
String errorType = "";
String packCode = "";
String packCode = "", keyFalg = "";
int count = 0;
int ctr=0;
int childNodeListLength;
......@@ -109,6 +109,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
{
packCode = checkNull(genericUtility.getColumnValue("pack_code", dom));
System.out.println("Pack Code="+packCode);
/* Changed BY Nasruddin 22-SEP-16 START
if(packCode == null || packCode.trim().length() == 0)
{
errCode = "VMPACNU";
......@@ -136,6 +137,52 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt.close();
pstmt = null;
}
*/
sql = "SELECT KEY_FLAG FROM TRANSETUP WHERE TRAN_WINDOW = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,"w_packing");
rs = pstmt.executeQuery();
if(rs.next())
{
keyFalg = rs.getString("KEY_FLAG");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
keyFalg = keyFalg == null ?"M" : keyFalg.trim();
if(keyFalg.equals("M") && packCode == null || packCode.trim().length() == 0)
{
errCode = "VMCODNULL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
if(editFlag.equals("A"))
{
sql = "select count(1) from packing where pack_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,packCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count > 0)
{
errCode = "VMDUPL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
// Changed By Nasruddin 22-SEP-16 END
}
else if(childNodeName.equalsIgnoreCase("descr"))
{
......@@ -143,11 +190,40 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
System.out.println("Descr="+descr);
if(descr == null || descr.trim().length() == 0)
{
errCode = "VMPADES";
errCode = "VMDESCR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
// Changed By Nasruddin 22-SEP-16 START
else
{
count = 0;
packCode = checkNull(genericUtility.getColumnValue("pack_code", dom));
sql = "SELECT COUNT(1) FROM PACKING WHERE PACK_CODE <> ? AND DESCR = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,packCode);
pstmt.setString(2,descr);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(count > 0)
{
errCode = "VMDUPDESCR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//Changed By Nasruddin END [22-SEP-16]
}
/* Comment By Nasruddin START [22-SEP-16] START
else if(childNodeName.equalsIgnoreCase("capacity"))
{
capacity = checkNull(genericUtility.getColumnValue("capacity", dom));
......@@ -163,7 +239,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
errFields.add(childNodeName.toLowerCase());
}
}
}
}Comment By Nasruddin START [22-SEP-16] END */
else if(childNodeName.equalsIgnoreCase("unit"))
{
unit = checkNull(genericUtility.getColumnValue("unit", dom));
......@@ -196,6 +272,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt = null;
}
}
/* Comment By Nasruddin START [22-SEP-16] START
else if(childNodeName.equalsIgnoreCase("unit__dimn"))
{
unitDmn = checkNull(genericUtility.getColumnValue("unit__dimn", dom));
......@@ -222,6 +299,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt = null;
}
}
Comment By Nasruddin START [22-SEP-16] END */
else if(childNodeName.equalsIgnoreCase("unit__nwt"))
{
unitNwt = checkNull(genericUtility.getColumnValue("unit__nwt", dom));
......
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