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; ...@@ -5,15 +5,12 @@ import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
......
...@@ -104,16 +104,18 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou ...@@ -104,16 +104,18 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
/* Comment By Nasruddin [16-sep-19] START
if(childNodeName.equalsIgnoreCase("dist_route")) if(childNodeName.equalsIgnoreCase("dist_route"))
{ {
distRoute = checkNull(genericUtility.getColumnValue("dist_route", dom)); distRoute = checkNull(genericUtility.getColumnValue("dist_route", dom));
//if(distRoute == null || distRoute.trim().length() == 0) //if(distRoute == null || distRoute.trim().length() == 0)
//{ //{
// errCode = "VTDISRTBK"; // errCode = "VTDISRTBK";
// errList.add(errCode); // errList.add(errCode);
// errFields.add(childNodeName.toLowerCase()); // errFields.add(childNodeName.toLowerCase());
//} //}
if(editFlag.equalsIgnoreCase("A") && distRoute != null && distRoute.trim().length() > 0) if(editFlag.equalsIgnoreCase("A") && distRoute != null && distRoute.trim().length() > 0)
{ {
...@@ -136,30 +138,32 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou ...@@ -136,30 +138,32 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} }
else if(childNodeName.equalsIgnoreCase("descr")) else if(childNodeName.equalsIgnoreCase("descr"))
{ {
descr = checkNull(genericUtility.getColumnValue("descr", dom)); descr = checkNull(genericUtility.getColumnValue("descr", dom));
if(descr == null || descr.trim().length() == 0) if(descr == null || descr.trim().length() == 0)
{ {
errCode = "VMDESCR"; errCode = "VMDESCR";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} } Comment By Nasruddin [16-sep-19] END */
else if(childNodeName.equalsIgnoreCase("stan_code__fr")) if(childNodeName.equalsIgnoreCase("stan_code__fr"))
{ {
StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom)); StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeFrom == null || StanCodeFrom.trim().length() == 0) if(StanCodeFrom == null || StanCodeFrom.trim().length() == 0)
{ {
errCode = "VMSTANCOD "; errCode = "VMSTANCOD ";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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 = ?"; sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -184,13 +188,15 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou ...@@ -184,13 +188,15 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
else if(childNodeName.equalsIgnoreCase("stan_code__to")) else if(childNodeName.equalsIgnoreCase("stan_code__to"))
{ {
StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom)); StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeTo == null || StanCodeTo.trim().length() == 0) if(StanCodeTo == null || StanCodeTo.trim().length() == 0)
{ {
errCode = "VMSTANCOD "; errCode = "VMSTANCOD ";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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 = ?"; sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -257,13 +263,15 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou ...@@ -257,13 +263,15 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
if(childNodeName.equalsIgnoreCase("stan_code__fr")) if(childNodeName.equalsIgnoreCase("stan_code__fr"))
{ {
StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom)); StanCodeFrom = checkNull(genericUtility.getColumnValue("stan_code__fr", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeFrom == null || StanCodeFrom.trim().length() == 0) if(StanCodeFrom == null || StanCodeFrom.trim().length() == 0)
{ {
errCode = "VMSTANCOD "; errCode = "VMSTANCOD ";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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 = ?"; sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -288,13 +296,14 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou ...@@ -288,13 +296,14 @@ public class DistributionRouteIC extends ValidatorEJB implements DistributionRou
else if(childNodeName.equalsIgnoreCase("stan_code__to")) else if(childNodeName.equalsIgnoreCase("stan_code__to"))
{ {
StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom)); StanCodeTo = checkNull(genericUtility.getColumnValue("stan_code__to", dom));
/* Comment By Nasruddin [16-sep-19] Start
if(StanCodeTo == null || StanCodeTo.trim().length() == 0) if(StanCodeTo == null || StanCodeTo.trim().length() == 0)
{ {
errCode = "VMSTANCOD "; errCode = "VMSTANCOD ";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }Comment By Nasruddin [16-sep-19] End */
else if(StanCodeTo != null && StanCodeTo.trim().length() > 0) if(StanCodeTo != null && StanCodeTo.trim().length() > 0)
{ {
sql = "select count(*) from station where stan_code = ?"; sql = "select count(*) from station where stan_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
......
...@@ -112,7 +112,8 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr ...@@ -112,7 +112,8 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
/* Comment By Nasruddin khan Start [16/SEP/16] Start
if(childNodeName.trim().equalsIgnoreCase("item_ser")) if(childNodeName.trim().equalsIgnoreCase("item_ser"))
{ {
itemSer = genericUtility.getColumnValue("item_ser", dom); itemSer = genericUtility.getColumnValue("item_ser", dom);
...@@ -125,7 +126,8 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr ...@@ -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); scCode = genericUtility.getColumnValue("sc_code", dom);
if(scCode != null && scCode.trim().length() > 0) if(scCode != null && scCode.trim().length() > 0)
...@@ -167,7 +169,10 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr ...@@ -167,7 +169,10 @@ public class DiststrgIC extends ValidatorEJB implements DiststrgICLocal, Diststr
scCode = genericUtility.getColumnValue("sc_code", dom); scCode = genericUtility.getColumnValue("sc_code", dom);
itemSer = genericUtility.getColumnValue("ls_item_ser", 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 = ? "; sql = "select count(1) from disc_apr_strg where item_ser = ? and sc_code = ? and eff_from = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
......
...@@ -75,120 +75,166 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe ...@@ -75,120 +75,166 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe
//Changes and Commented By Bhushan on 13-06-2016 :END //Changes and Commented By Bhushan on 13-06-2016 :END
conn.setAutoCommit(false); conn.setAutoCommit(false);
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, userId); userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, userId);
if (objContext != null && objContext.trim().length() > 0) { if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
switch (currentFormNo) { switch (currentFormNo)
{
case 1: case 1:
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength(); childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++) { for (ctr = 0; ctr < childNodeLength; ctr++)
{
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("agent_code")) { if (childNodeName.equalsIgnoreCase("agent_code"))
{
System.out.println(":::childNodeName" + childNodeName); System.out.println(":::childNodeName" + childNodeName);
String agentCode = genericUtility.getColumnValue("agent_code", dom); String agentCode = genericUtility.getColumnValue("agent_code", dom);
agentCode = agentCode == null ? "" : agentCode.trim(); agentCode = agentCode == null ? "" : agentCode.trim();
System.out.println("::: agentCode" + agentCode); System.out.println("::: agentCode" + agentCode);
if(agentCode.length() <= 0){ if(agentCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("agent_code", "VTAGENTB", userId); errString = itmdbAccessEJB.getErrorString("agent_code", "VTAGENTB", userId);
break; break;
} }
else{ else
if(editFlag.equalsIgnoreCase("A")){ {
if(editFlag.equalsIgnoreCase("A"))
{
int count = 0; int count = 0;
sql = "select count(*) as count from ins_agent where agent_code = ? "; sql = "select count(*) as count from ins_agent where agent_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, agentCode); pstmt.setString(1, agentCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next())
{
count = rs.getInt("count"); 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){ if(count > 0){
errString = itmdbAccessEJB.getErrorString("agent_code", "VDIAC", userId); errString = itmdbAccessEJB.getErrorString("agent_code", "VDIAC", userId);
break; break;
} }
} }
} }
} }
if (childNodeName.equalsIgnoreCase("count_code")) { if (childNodeName.equalsIgnoreCase("count_code"))
{
System.out.println(":::childNodeName" + childNodeName); System.out.println(":::childNodeName" + childNodeName);
String countCode = genericUtility.getColumnValue("count_code", dom); String countCode = genericUtility.getColumnValue("count_code", dom);
/* Changed By Nasruddin [16-SEP-16] START
countCode = countCode == null ? "" : countCode.trim(); countCode = countCode == null ? "" : countCode.trim();
System.out.println("::: countCode" + countCode); System.out.println("::: countCode" + countCode);
if(countCode.length() <= 0){ if(countCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("count_code", "VTCOUNTB", userId); errString = itmdbAccessEJB.getErrorString("count_code", "VTCOUNTB", userId);
break; break;
} }
else{ else Changed By Nasruddin [16-SEP-16] END*/
int count = 0; if( countCode != null && countCode.trim().length() > 0)
sql = "select count(*) as count from country where count_code = ? "; {
pstmt = conn.prepareStatement(sql); int count = 0;
pstmt.setString(1, countCode); sql = "select count(*) as count from country where count_code = ? ";
rs = pstmt.executeQuery(); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, countCode);
if(rs.next()){ rs = pstmt.executeQuery();
count = rs.getInt("count");
} if(rs.next()){
if(count <= 0){ count = rs.getInt("count");
errString = itmdbAccessEJB.getErrorString("count_code", "VTCONTCD1", userId); }
break; 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); System.out.println(":::childNodeName" + childNodeName);
String stanCode = genericUtility.getColumnValue("stan_code", dom); String stanCode = genericUtility.getColumnValue("stan_code", dom);
/* Changed By Nasruddin [16/SEP/16] START
stanCode = stanCode == null ? "" : stanCode.trim(); stanCode = stanCode == null ? "" : stanCode.trim();
System.out.println("::: stanCode" + stanCode); System.out.println("::: stanCode" + stanCode);
if(stanCode.length() <= 0){ if(stanCode.length() <= 0)
{
errString = itmdbAccessEJB.getErrorString("stan_code", "VTSTATB", userId); errString = itmdbAccessEJB.getErrorString("stan_code", "VTSTATB", userId);
break; break;
} }
else{ else
int count = 0; {
sql = "select count(*) as count from station where stan_code = ? "; int count = 0;
pstmt = conn.prepareStatement(sql); sql = "select count(*) as count from station where stan_code = ? ";
pstmt.setString(1, stanCode); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); pstmt.setString(1, stanCode);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt("count"); if(rs.next()){
} count = rs.getInt("count");
if(count <= 0){ }
errString = itmdbAccessEJB.getErrorString("stan_code", "VMSTANINVD", userId); if(count <= 0){
break; 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); System.out.println(":::childNodeName" + childNodeName);
String suppCode = genericUtility.getColumnValue("supp_code__ins", dom); String suppCode = genericUtility.getColumnValue("supp_code__ins", dom);
suppCode = suppCode == null ? "" : suppCode.trim(); //Changed By Nasruddin [16-SEP-16]
System.out.println("::: stanCode" + suppCode); if(suppCode != null && suppCode.trim().length() > 0)
{
int count = 0; int count = 0;
sql = "select count(*) as count from insurance where supp_code__ins = ? "; sql = "select count(*) as count from insurance where supp_code__ins = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCode); pstmt.setString(1, suppCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next())
count = rs.getInt("count"); {
} count = rs.getInt("count");
if(count <= 0){ }
errString = itmdbAccessEJB.getErrorString("supp_code__ins", "VTNINSSUPP", userId); if(count <= 0)
break; {
} errString = itmdbAccessEJB.getErrorString("supp_code__ins", "VTNINSSUPP", userId);
/*else{ break;
}
}
/*else{
GenValidate gV = new GenValidate(); GenValidate gV = new GenValidate();
String result = gV.generalValidate(dom, "supp_code__ins", "w_insurance_agent"); String result = gV.generalValidate(dom, "supp_code__ins", "w_insurance_agent");
if(result.trim().length() <= 0 && result == ""){ if(result.trim().length() <= 0 && result == ""){
...@@ -198,9 +244,9 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe ...@@ -198,9 +244,9 @@ public class InsuranceAgentIC extends ValidatorEJB implements InsuranceAgentICRe
errString = itmdbAccessEJB.getErrorString("supp_code__ins", "VTNINSSUPP", userId); errString = itmdbAccessEJB.getErrorString("supp_code__ins", "VTNINSSUPP", userId);
} }
}*/ }*/
} }
} }
} }
}catch (Exception e) }catch (Exception e)
{ {
......
This diff is collapsed.
...@@ -136,7 +136,6 @@ public class ItemLot extends ValidatorEJB implements ItemLotLocal,ItemLotRemote ...@@ -136,7 +136,6 @@ public class ItemLot extends ValidatorEJB implements ItemLotLocal,ItemLotRemote
pstmt = null; pstmt = null;
} }
}//end of for }//end of for
int errListSize = errList.size(); int errListSize = errList.size();
int cnt = 0; int cnt = 0;
String errFldName = null; String errFldName = null;
......
...@@ -130,8 +130,10 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC ...@@ -130,8 +130,10 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
if (childNodeName.equalsIgnoreCase("item_code")) if (childNodeName.equalsIgnoreCase("item_code"))
{ {
itemCode=this.genericUtility.getColumnValue("item_code", dom); 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 = ?"; sql = "select count(*) from item where item_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -153,15 +155,16 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC ...@@ -153,15 +155,16 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}else /*}else
{ //{
errCode = "VMITEMCD1"; errCode = "VMITEMCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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); lotNofrom=this.genericUtility.getColumnValue("lot_no__from", dom);
if (lotNofrom == null || lotNofrom.trim().length() == 0 ) if (lotNofrom == null || lotNofrom.trim().length() == 0 )
...@@ -183,7 +186,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC ...@@ -183,7 +186,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} } //Changed By Nasruddin 19-SEP-16 END*/
else if (childNodeName.equalsIgnoreCase("unit__pack")) else if (childNodeName.equalsIgnoreCase("unit__pack"))
{ {
unitPack=checkNull(this.genericUtility.getColumnValue("unit__pack", dom)); unitPack=checkNull(this.genericUtility.getColumnValue("unit__pack", dom));
...@@ -209,7 +212,8 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC ...@@ -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); siteCodeMfg=this.genericUtility.getColumnValue("site_code__mfg", dom);
if (siteCodeMfg == null || siteCodeMfg.trim().length() == 0 ) if (siteCodeMfg == null || siteCodeMfg.trim().length() == 0 )
...@@ -272,6 +276,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC ...@@ -272,6 +276,7 @@ public class ItemLotPackSizeIC extends ValidatorEJB implements ItemLotPackSizeIC
} }
} }
Comment By Nasruddin 19-SEP-16 END*/
else if (childNodeName.equalsIgnoreCase("net_weight")) else if (childNodeName.equalsIgnoreCase("net_weight"))
{ {
netWeight=checkDoubleNull(this.genericUtility.getColumnValue("net_weight", dom)); netWeight=checkDoubleNull(this.genericUtility.getColumnValue("net_weight", dom));
......
...@@ -80,6 +80,9 @@ implements ItemMnfrICLocal, ItemMnfrICRemote ...@@ -80,6 +80,9 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
String siteCode = ""; String siteCode = "";
String suppCodeMnfr = ""; String suppCodeMnfr = "";
String refSer = ""; String refSer = "";
String sql = "";
String itemCode = "";
String LockGroup = "";
int ctr = 0; int ctr = 0;
int currentFormNo = 0; int currentFormNo = 0;
int cnt = 0; int cnt = 0;
...@@ -128,8 +131,10 @@ implements ItemMnfrICLocal, ItemMnfrICRemote ...@@ -128,8 +131,10 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
if (childNodeName.equalsIgnoreCase("supp_code__mnfr")) if (childNodeName.equalsIgnoreCase("supp_code__mnfr"))
{ {
suppCodeMnfr=checkNull(this.genericUtility.getColumnValue("supp_code__mnfr", dom)); suppCodeMnfr=checkNull(this.genericUtility.getColumnValue("supp_code__mnfr", dom));
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "site_code")); /* Changed By Nasruddin [19-SEP-16] START
if (suppCodeMnfr != null && suppCodeMnfr.trim().length() > 0 ) * siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "site_code"));
* if (suppCodeMnfr != null && suppCodeMnfr.trim().length() > 0 )
{ {
errCode = finCommon.isSupplier(siteCode, suppCodeMnfr, refSer, conn); errCode = finCommon.isSupplier(siteCode, suppCodeMnfr, refSer, conn);
...@@ -138,9 +143,83 @@ implements ItemMnfrICLocal, ItemMnfrICRemote ...@@ -138,9 +143,83 @@ implements ItemMnfrICLocal, ItemMnfrICRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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>"); valueXmlString.append("</Detail1>");
break; break;
......
...@@ -18,6 +18,7 @@ import org.w3c.dom.NodeList; ...@@ -18,6 +18,7 @@ import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
//import ibase.webitm.utility.GenericUtility; //import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -119,8 +120,10 @@ public class ItemRegNoIC extends ValidatorEJB implements ItemRegNoICLocal, ItemR ...@@ -119,8 +120,10 @@ public class ItemRegNoIC extends ValidatorEJB implements ItemRegNoICLocal, ItemR
pstmt.close(); pstmt.close();
pstmt = null; 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); itemCode = genericUtility.getColumnValue("item_code", dom);
if(itemCode == null || itemCode.trim().length() == 0) if(itemCode == null || itemCode.trim().length() == 0)
...@@ -139,7 +142,8 @@ public class ItemRegNoIC extends ValidatorEJB implements ItemRegNoICLocal, ItemR ...@@ -139,7 +142,8 @@ public class ItemRegNoIC extends ValidatorEJB implements ItemRegNoICLocal, ItemR
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }Comment By Nasruddin 19-SEP-16 [END]*/
} }
int errListSize = errList.size(); int errListSize = errList.size();
cnt = 0; cnt = 0;
......
...@@ -100,8 +100,9 @@ public class ItemSerChange extends ValidatorEJB implements ItemSerChangeLocal,It ...@@ -100,8 +100,9 @@ public class ItemSerChange extends ValidatorEJB implements ItemSerChangeLocal,It
if(childNodeName.equalsIgnoreCase("item_ser")) if(childNodeName.equalsIgnoreCase("item_ser"))
{ {
itemSer = genericUtility.getColumnValue("item_ser", dom); 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); itemSerOld = genericUtility.getColumnValue("item_ser__old", dom);
sql = "select count(*) from itemser where item_ser = ?"; sql = "select count(*) from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -128,7 +129,7 @@ public class ItemSerChange extends ValidatorEJB implements ItemSerChangeLocal,It ...@@ -128,7 +129,7 @@ public class ItemSerChange extends ValidatorEJB implements ItemSerChangeLocal,It
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} //}
} }
else if(childNodeName.equalsIgnoreCase("eff_date")) else if(childNodeName.equalsIgnoreCase("eff_date"))
{ {
......
...@@ -103,8 +103,9 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp ...@@ -103,8 +103,9 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if(editFlag.equalsIgnoreCase("A")) /* Comment By Nasruddin 19-SEP-16
{ * if(editFlag.equalsIgnoreCase("A"))
{*/
if(childNodeName.equalsIgnoreCase("item_type")) if(childNodeName.equalsIgnoreCase("item_type"))
{ {
itemType = checkNull(genericUtility.getColumnValue("item_type", dom)); itemType = checkNull(genericUtility.getColumnValue("item_type", dom));
...@@ -137,7 +138,8 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp ...@@ -137,7 +138,8 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
pstmt = null; pstmt = null;
} }
} }
} //}
/* Comment By Nasruddin 19-SEP-16 START
else if(childNodeName.equalsIgnoreCase("unit")) else if(childNodeName.equalsIgnoreCase("unit"))
{ {
unit = checkNull(genericUtility.getColumnValue("unit", dom)); unit = checkNull(genericUtility.getColumnValue("unit", dom));
...@@ -294,7 +296,7 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp ...@@ -294,7 +296,7 @@ public class ItemTypeIC extends ValidatorEJB implements ItemTypeICLocal, ItemTyp
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} } Comment By Nasruddin 19-SEP-16 END*/
else if(childNodeName.equalsIgnoreCase("route_code")) else if(childNodeName.equalsIgnoreCase("route_code"))
{ {
routeCode = checkNull(genericUtility.getColumnValue("route_code", dom)); routeCode = checkNull(genericUtility.getColumnValue("route_code", dom));
......
...@@ -134,14 +134,17 @@ public class PackingDetIC extends ValidatorEJB implements PackingDetICLocal, Pac ...@@ -134,14 +134,17 @@ public class PackingDetIC extends ValidatorEJB implements PackingDetICLocal, Pac
if(childNodeName.equalsIgnoreCase("count_code")) if(childNodeName.equalsIgnoreCase("count_code"))
{ {
countCode = genericUtility.getColumnValue("count_code", dom); countCode = genericUtility.getColumnValue("count_code", dom);
/* Comment By Nasruddin 20-sep-16 START
if(countCode == null || countCode.trim().length() == 0) if(countCode == null || countCode.trim().length() == 0)
{ {
errCode = "VMCOUNTCD "; errCode = "VMCOUNTCD ";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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 = ?"; sql = "select count(*) from country where count_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,countCode); pstmt.setString(1,countCode);
...@@ -161,7 +164,7 @@ public class PackingDetIC extends ValidatorEJB implements PackingDetICLocal, Pac ...@@ -161,7 +164,7 @@ public class PackingDetIC extends ValidatorEJB implements PackingDetICLocal, Pac
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} //}
} }
} }
......
...@@ -73,7 +73,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca ...@@ -73,7 +73,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
String userId = ""; String userId = "";
String sql = ""; String sql = "";
String errorType = ""; String errorType = "";
String packCode = ""; String packCode = "", keyFalg = "";
int count = 0; int count = 0;
int ctr=0; int ctr=0;
int childNodeListLength; int childNodeListLength;
...@@ -109,6 +109,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca ...@@ -109,6 +109,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
{ {
packCode = checkNull(genericUtility.getColumnValue("pack_code", dom)); packCode = checkNull(genericUtility.getColumnValue("pack_code", dom));
System.out.println("Pack Code="+packCode); System.out.println("Pack Code="+packCode);
/* Changed BY Nasruddin 22-SEP-16 START
if(packCode == null || packCode.trim().length() == 0) if(packCode == null || packCode.trim().length() == 0)
{ {
errCode = "VMPACNU"; errCode = "VMPACNU";
...@@ -136,6 +137,52 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca ...@@ -136,6 +137,52 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt.close(); pstmt.close();
pstmt = null; 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")) else if(childNodeName.equalsIgnoreCase("descr"))
{ {
...@@ -143,11 +190,40 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca ...@@ -143,11 +190,40 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
System.out.println("Descr="+descr); System.out.println("Descr="+descr);
if(descr == null || descr.trim().length() == 0) if(descr == null || descr.trim().length() == 0)
{ {
errCode = "VMPADES"; errCode = "VMDESCR";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); 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")) else if(childNodeName.equalsIgnoreCase("capacity"))
{ {
capacity = checkNull(genericUtility.getColumnValue("capacity", dom)); capacity = checkNull(genericUtility.getColumnValue("capacity", dom));
...@@ -163,7 +239,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca ...@@ -163,7 +239,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} }Comment By Nasruddin START [22-SEP-16] END */
else if(childNodeName.equalsIgnoreCase("unit")) else if(childNodeName.equalsIgnoreCase("unit"))
{ {
unit = checkNull(genericUtility.getColumnValue("unit", dom)); unit = checkNull(genericUtility.getColumnValue("unit", dom));
...@@ -196,6 +272,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca ...@@ -196,6 +272,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt = null; pstmt = null;
} }
} }
/* Comment By Nasruddin START [22-SEP-16] START
else if(childNodeName.equalsIgnoreCase("unit__dimn")) else if(childNodeName.equalsIgnoreCase("unit__dimn"))
{ {
unitDmn = checkNull(genericUtility.getColumnValue("unit__dimn", dom)); unitDmn = checkNull(genericUtility.getColumnValue("unit__dimn", dom));
...@@ -222,6 +299,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca ...@@ -222,6 +299,7 @@ public class PackingMasterIC extends ValidatorEJB implements PackingMasterICLoca
pstmt = null; pstmt = null;
} }
} }
Comment By Nasruddin START [22-SEP-16] END */
else if(childNodeName.equalsIgnoreCase("unit__nwt")) else if(childNodeName.equalsIgnoreCase("unit__nwt"))
{ {
unitNwt = checkNull(genericUtility.getColumnValue("unit__nwt", dom)); 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