Commit fd52d7fb authored by cpatil's avatar cpatil

update code


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98346 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1e454531
......@@ -282,21 +282,32 @@ public class SuppInfoUpdIC extends ValidatorEJB implements SuppInfoUpdICLocal, S
int currentFormNo =0;
String columnValue="";
String tranId = "",suppCode ="",chqNameO ="",chqName ="",tele1O ="",tele1 ="",panNoO ="",siteCode="";
String panNo ="",exciseRefO ="",exciseRef ="",serTaxRegO ="",serTaxReg ="",taxRegO ="";
String taxReg ="",wfStatus ="",addUser = "",addTerm = "",chgUser = "",chgTerm = "";
Timestamp chgDate = null, statusDate = null, addDate = null, tranDate = null;
try
{
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDate = sdf.format(currentDate.getTime());
System.out.println("Now the date is :=> " + sysDate);
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"CHG_TERM");
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"CHG_USER");
System.out.println("chgTerm["+chgTerm+"]chgUser["+chgUser+"]xtraParams["+xtraParams+"]");
//Calendar currentDate = Calendar.getInstance();
//java.util.Date currentDate1 = new java.util.Date();
//SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
//String sysDate = sdf.format(currentDate.getTime());
//Timestamp newsysDate = java.sql.Timestamp.valueOf( sdf1.format(currentDate)+" 00:00:00.0");
//System.out.println("Now the date is :=> ["+newsysDate+"]");
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
......@@ -346,32 +357,90 @@ public class SuppInfoUpdIC extends ValidatorEJB implements SuppInfoUpdICLocal, S
System.out.println("@@@@@@@@ itm_defaultedit called @@@@@@@@");
chgTerm = getValueFromXTRA_PARAMS(xtraParams,"chgTerm");
chgUser = getValueFromXTRA_PARAMS(xtraParams,"chgUser");
// chgTerm = getValueFromXTRA_PARAMS(xtraParams,"chgTerm");
// chgUser = getValueFromXTRA_PARAMS(xtraParams,"chgUser");
System.out.println("@@@@@@@@@@@ chgTerm---"+chgTerm+"::::::::chgUser----"+chgUser+":::::");
suppCode = checkNull(genericUtility.getColumnValue("supp_code", dom));
System.out.println("@@@@@@@@ suppCode["+suppCode+"] @@@@@@@@");
sql = "select count(1) from supp_amd where supp_code = ? ";
sql = "select count(1) from supp_amd where supp_code = ? and wf_status = 'O' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,suppCode);
rs = pstmt.executeQuery();
if(rs.next())
{
// wfStatus = rs.getString("wf_status");
cnt = rs.getInt(1);
sql = " Select TRAN_ID, TRAN_DATE, SUPP_CODE, CHQ_NAME_O, CHQ_NAME, TELE1_O, TELE1, PAN_NO_O, PAN_NO, " +
" EXCISE_REF_O, EXCISE_REF, SER_TAX_REG_O, SER_TAX_REG, TAX_REG_O , TAX_REG, WF_STATUS, " +
" STATUS_DATE , ADD_DATE , ADD_USER , ADD_TERM , CHG_DATE , CHG_USER , CHG_TERM " +
" from supp_amd where supp_code = ? and wf_status = 'O' ";
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@@ cnt["+cnt+"]");
System.out.println("@@@@@@@@@openCnt["+cnt+"]");
if(!( cnt > 0 ))
{
sql = "select count(1) from supp_amd where supp_code = ? and wf_status = 'S' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,suppCode);
rs = pstmt.executeQuery();
if(rs.next())
{
// wfStatus = rs.getString("wf_status");
cnt = rs.getInt(1);
sql = " Select TRAN_ID, TRAN_DATE, SUPP_CODE, CHQ_NAME_O, CHQ_NAME, TELE1_O, TELE1, PAN_NO_O, PAN_NO, " +
" EXCISE_REF_O, EXCISE_REF, SER_TAX_REG_O, SER_TAX_REG, TAX_REG_O , TAX_REG, WF_STATUS, " +
" STATUS_DATE , ADD_DATE , ADD_USER , ADD_TERM , CHG_DATE , CHG_USER , CHG_TERM " +
" from supp_amd where supp_code = ? and wf_status = 'S' ";
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@@submitCnt["+cnt+"]");
}
if(!( cnt > 0 ))
{
sql = "select count(1) from supp_amd where supp_code = ? and wf_status = 'A' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,suppCode);
rs = pstmt.executeQuery();
if(rs.next())
{
// wfStatus = rs.getString("wf_status");
cnt = rs.getInt(1);
System.out.println("@@@@@@@@@closeCnt["+cnt+"]");
cnt = 0 ;
/*
sql = " Select TRAN_ID, TRAN_DATE, SUPP_CODE, CHQ_NAME_O, CHQ_NAME, TELE1_O, TELE1, PAN_NO_O, PAN_NO, " +
" EXCISE_REF_O, EXCISE_REF, SER_TAX_REG_O, SER_TAX_REG, TAX_REG_O , TAX_REG, WF_STATUS, " +
" STATUS_DATE , ADD_DATE , ADD_USER , ADD_TERM , CHG_DATE , CHG_USER , CHG_TERM " +
" from supp_amd where supp_code = ? and wf_status = 'A' ";
*/
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
System.out.println("@@@@@@@@@@@@ sql["+sql+"]");
System.out.println("@@@@@@@@@final Cnt["+cnt+"]");
if( cnt > 0 )
{
sql = " Select TRAN_ID, TRAN_DATE, SUPP_CODE, CHQ_NAME_O, CHQ_NAME, TELE1_O, TELE1, PAN_NO_O, PAN_NO, " +
" EXCISE_REF_O, EXCISE_REF, SER_TAX_REG_O, SER_TAX_REG, TAX_REG_O , TAX_REG, WF_STATUS, " +
" STATUS_DATE , ADD_DATE , ADD_USER , ADD_TERM , CHG_DATE , CHG_USER , CHG_TERM " +
" from supp_amd where supp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,suppCode);
rs = pstmt.executeQuery();
......@@ -405,49 +474,108 @@ public class SuppInfoUpdIC extends ValidatorEJB implements SuppInfoUpdICLocal, S
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<tran_id protect = \"1\" >").append("<![CDATA["+tranId+"]]>").append("</tran_id>");
valueXmlString.append("<tran_date protect = \"1\" >").append("<![CDATA["+tranDate+"]]>").append("</tran_date>");
valueXmlString.append("<supp_code protect = \"1\" >").append("<![CDATA["+suppCode+"]]>").append("</supp_code>");
valueXmlString.append("<chq_name protect = \"0\" >").append("<![CDATA["+chqName+"]]>").append("</chq_name>");
valueXmlString.append("<chq_name_o protect = \"1\" >").append("<![CDATA["+chqName+"]]>").append("</chq_name_o>");
if("O".equalsIgnoreCase(wfStatus))
{
String tranDateStr = genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat());
System.out.println("@@@@@@@@@@@@@tranDate["+tranDate+"]statusDateStr["+tranDateStr+"]");
String statusDateStr = genericUtility.getValidDateTimeString(statusDate,genericUtility.getApplDateFormat());
System.out.println("@@@@@@@@@@@@@statusDate["+statusDate+"]statusDateStr["+statusDateStr+"]");
String addDateStr = genericUtility.getValidDateTimeString(statusDate,genericUtility.getApplDateFormat());
System.out.println("@@@@@@@@@@@@@addDate["+addDate+"]addDateStr["+addDateStr+"]");
valueXmlString.append("<tran_id protect = \"1\" >").append("<![CDATA["+tranId+"]]>").append("</tran_id>");
valueXmlString.append("<tran_date protect = \"1\" >").append("<![CDATA["+tranDateStr+"]]>").append("</tran_date>");
valueXmlString.append("<supp_code protect = \"1\" >").append("<![CDATA["+suppCode+"]]>").append("</supp_code>");
valueXmlString.append("<chq_name protect = \"0\" >").append("<![CDATA["+chqName+"]]>").append("</chq_name>");
valueXmlString.append("<chq_name_o protect = \"1\" >").append("<![CDATA["+chqNameO+"]]>").append("</chq_name_o>");
valueXmlString.append("<tele1 protect = \"0\" >").append("<![CDATA["+tele1+"]]>").append("</tele1>");
valueXmlString.append("<tele1_o protect = \"1\" >").append("<![CDATA["+tele1O+"]]>").append("</tele1_o>");
valueXmlString.append("<pan_no protect = \"0\" >").append("<![CDATA["+panNo+"]]>").append("</pan_no>");
valueXmlString.append("<pan_no_o protect = \"1\" >").append("<![CDATA["+panNoO+"]]>").append("</pan_no_o>");
valueXmlString.append("<excise_ref protect = \"0\" >").append("<![CDATA["+exciseRef+"]]>").append("</excise_ref>");
valueXmlString.append("<excise_ref_o protect = \"1\" >").append("<![CDATA["+exciseRefO+"]]>").append("</excise_ref_o>");
valueXmlString.append("<ser_tax_reg protect = \"0\" >").append("<![CDATA["+serTaxReg+"]]>").append("</ser_tax_reg>");
valueXmlString.append("<ser_tax_reg_o protect = \"1\" >").append("<![CDATA["+serTaxRegO+"]]>").append("</ser_tax_reg_o>");
valueXmlString.append("<tax_reg protect = \"0\" >").append("<![CDATA["+taxReg+"]]>").append("</tax_reg>");
valueXmlString.append("<tax_reg_o protect = \"1\" >").append("<![CDATA["+taxRegO+"]]>").append("</tax_reg_o>");
valueXmlString.append("<wf_status protect = \"0\" >").append("<![CDATA["+wfStatus+"]]>").append("</wf_status>");
valueXmlString.append("<status_date protect = \"1\" >").append("<![CDATA["+statusDateStr+"]]>").append("</status_date>");
valueXmlString.append("<tele1 protect = \"0\" >").append("<![CDATA["+tele1+"]]>").append("</tele1>");
valueXmlString.append("<tele1_o protect = \"1\" >").append("<![CDATA["+tele1+"]]>").append("</tele1_o>");
valueXmlString.append("<add_date protect = \"1\" >").append("<![CDATA["+addDateStr+"]]>").append("</add_date>");
valueXmlString.append("<add_user protect = \"1\" >").append("<![CDATA["+addUser+"]]>").append("</add_user>");
valueXmlString.append("<add_term protect = \"1\" >").append("<![CDATA["+addTerm+"]]>").append("</add_term>");
valueXmlString.append("<pan_no protect = \"0\" >").append("<![CDATA["+panNo+"]]>").append("</pan_no>");
valueXmlString.append("<pan_no_o protect = \"1\" >").append("<![CDATA["+panNo+"]]>").append("</pan_no_o>");
valueXmlString.append("<excise_ref protect = \"0\" >").append("<![CDATA["+exciseRef+"]]>").append("</excise_ref>");
valueXmlString.append("<excise_ref_o protect = \"1\" >").append("<![CDATA["+exciseRef+"]]>").append("</excise_ref_o>");
valueXmlString.append("<chg_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</chg_date>");
valueXmlString.append("<chg_user protect = \"1\" >").append("<![CDATA["+chgUser+"]]>").append("</chg_user>");
valueXmlString.append("<chg_term protect = \"1\" >").append("<![CDATA["+chgTerm+"]]>").append("</chg_term>");
}
else if("S".equalsIgnoreCase(wfStatus))
{
String tranDateStr = genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat());
System.out.println("@@@@@@@@@@@@@tranDate["+tranDate+"]statusDateStr["+tranDateStr+"]");
String statusDateStr = genericUtility.getValidDateTimeString(statusDate,genericUtility.getApplDateFormat());
System.out.println("@@@@@@@@@@@@@statusDate["+statusDate+"]statusDateStr["+statusDateStr+"]");
String addDateStr = genericUtility.getValidDateTimeString(statusDate,genericUtility.getApplDateFormat());
System.out.println("@@@@@@@@@@@@@addDate["+addDate+"]addDateStr["+addDateStr+"]");
valueXmlString.append("<ser_tax_reg protect = \"0\" >").append("<![CDATA["+serTaxReg+"]]>").append("</ser_tax_reg>");
valueXmlString.append("<ser_tax_reg_o protect = \"1\" >").append("<![CDATA["+serTaxReg+"]]>").append("</ser_tax_reg_o>");
valueXmlString.append("<tran_id protect = \"1\" >").append("<![CDATA["+tranId+"]]>").append("</tran_id>");
valueXmlString.append("<tran_date protect = \"1\" >").append("<![CDATA["+tranDateStr+"]]>").append("</tran_date>");
valueXmlString.append("<supp_code protect = \"1\" >").append("<![CDATA["+suppCode+"]]>").append("</supp_code>");
valueXmlString.append("<tax_reg protect = \"0\" >").append("<![CDATA["+taxReg+"]]>").append("</tax_reg>");
valueXmlString.append("<tax_reg_o protect = \"1\" >").append("<![CDATA["+taxReg+"]]>").append("</tax_reg_o>");
valueXmlString.append("<chq_name protect = \"1\" >").append("<![CDATA["+chqName+"]]>").append("</chq_name>");
valueXmlString.append("<chq_name_o protect = \"1\" >").append("<![CDATA["+chqNameO+"]]>").append("</chq_name_o>");
valueXmlString.append("<wf_status protect = \"0\" >").append("<![CDATA["+wfStatus+"]]>").append("</wf_status>");
valueXmlString.append("<status_date protect = \"1\" >").append("<![CDATA["+statusDate+"]]>").append("</status_date>");
valueXmlString.append("<tele1 protect = \"1\" >").append("<![CDATA["+tele1+"]]>").append("</tele1>");
valueXmlString.append("<tele1_o protect = \"1\" >").append("<![CDATA["+tele1O+"]]>").append("</tele1_o>");
valueXmlString.append("<add_date protect = \"1\" >").append("<![CDATA["+addDate+"]]>").append("</add_date>");
valueXmlString.append("<add_user protect = \"1\" >").append("<![CDATA["+addUser+"]]>").append("</add_user>");
valueXmlString.append("<add_term protect = \"1\" >").append("<![CDATA["+addTerm+"]]>").append("</add_term>");
valueXmlString.append("<pan_no protect = \"1\" >").append("<![CDATA["+panNo+"]]>").append("</pan_no>");
valueXmlString.append("<pan_no_o protect = \"1\" >").append("<![CDATA["+panNoO+"]]>").append("</pan_no_o>");
valueXmlString.append("<excise_ref protect = \"1\" >").append("<![CDATA["+exciseRef+"]]>").append("</excise_ref>");
valueXmlString.append("<excise_ref_o protect = \"1\" >").append("<![CDATA["+exciseRefO+"]]>").append("</excise_ref_o>");
valueXmlString.append("<chg_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</chg_date>");
valueXmlString.append("<chg_user protect = \"1\" >").append("<![CDATA["+chgUser+"]]>").append("</chg_user>");
valueXmlString.append("<chg_term protect = \"1\" >").append("<![CDATA["+chgTerm+"]]>").append("</chg_term>");
valueXmlString.append("<ser_tax_reg protect = \"1\" >").append("<![CDATA["+serTaxReg+"]]>").append("</ser_tax_reg>");
valueXmlString.append("<ser_tax_reg_o protect = \"1\" >").append("<![CDATA["+serTaxRegO+"]]>").append("</ser_tax_reg_o>");
valueXmlString.append("<tax_reg protect = \"1\" >").append("<![CDATA["+taxReg+"]]>").append("</tax_reg>");
valueXmlString.append("<tax_reg_o protect = \"1\" >").append("<![CDATA["+taxRegO+"]]>").append("</tax_reg_o>");
valueXmlString.append("<wf_status protect = \"1\" >").append("<![CDATA["+wfStatus+"]]>").append("</wf_status>");
valueXmlString.append("<status_date protect = \"1\" >").append("<![CDATA["+statusDateStr+"]]>").append("</status_date>");
valueXmlString.append("<add_date protect = \"1\" >").append("<![CDATA["+addDateStr+"]]>").append("</add_date>");
valueXmlString.append("<add_user protect = \"1\" >").append("<![CDATA["+addUser+"]]>").append("</add_user>");
valueXmlString.append("<add_term protect = \"1\" >").append("<![CDATA["+addTerm+"]]>").append("</add_term>");
valueXmlString.append("<chg_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</chg_date>");
valueXmlString.append("<chg_user protect = \"1\" >").append("<![CDATA["+chgUser+"]]>").append("</chg_user>");
valueXmlString.append("<chg_term protect = \"1\" >").append("<![CDATA["+chgTerm+"]]>").append("</chg_term>");
}
}
else
{
// suppCode = checkNull(getCurrentSuppCode(dom.getElementsByTagName("Detail1").item(0)));
suppCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "entityCode" );
System.out.println("@@@@@@@@@ suppCode["+suppCode+"]");
System.out.println("@@@@@@@@@ suppCode["+suppCode+"].. new recode for supp amd....");
String keyString="",keyCol="",tranSer1="";
sql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE lower(TRAN_WINDOW) = 'w_supp_info_upd' ";
......@@ -503,10 +631,14 @@ public class SuppInfoUpdIC extends ValidatorEJB implements SuppInfoUpdICLocal, S
rs = null;
pstmt.close();
pstmt = null;
sql = " insert into supp_amd ( tran_id, supp_code , chq_name_o, tele1_o,pan_no_o,excise_ref_o,ser_tax_reg_o," +
"tax_reg_o ) values (?,?,?,?,?,?,?,? ) ";
"tax_reg_o " +
" ) values (?,?,?,?,?,?,?,? ) ";
System.out.println("sql :"+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
......@@ -525,11 +657,11 @@ public class SuppInfoUpdIC extends ValidatorEJB implements SuppInfoUpdICLocal, S
{
System.out.println("@@@@@@ rec inserted ["+cnt+"]conn.commit()");
conn.commit();
}
}
valueXmlString.append("<tran_id protect = \"1\" >").append("<![CDATA["+tranId+"]]>").append("</tran_id>");
valueXmlString.append("<tran_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</tran_date>");
......@@ -563,7 +695,9 @@ public class SuppInfoUpdIC extends ValidatorEJB implements SuppInfoUpdICLocal, S
valueXmlString.append("<chg_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</chg_date>");
valueXmlString.append("<chg_user protect = \"1\" >").append("<![CDATA["+chgUser+"]]>").append("</chg_user>");
valueXmlString.append("<chg_term protect = \"1\" >").append("<![CDATA["+chgTerm+"]]>").append("</chg_term>");
}
}
// case 1 end
valueXmlString.append("</Detail1>");
......
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