Commit dc5cd898 authored by steurwadkar's avatar steurwadkar

F17ABAS001 source code commit


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106160 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f6e47871
......@@ -428,8 +428,6 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
authSEK = aesEncryption.decrypt(sek, appKeyInBytes);
System.out.println("AuthSEK = "+ aesEncryption.encodeBase64String(authSEK));
retXML += getGstr1Summary(authToken, stateCode, userName, gstinNo, periodCode, authSEK, appKeyEncryptedAndCoded, conn);
retXML += downloadGstr1Data(gstinNo, periodCode, authToken, userName, stateCode, appKeyEncryptedAndCoded, authSEK);
}
else
{
......@@ -448,7 +446,7 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
}
else if(authTokenResp.getStatus() == 500)
{
errMsg = "Message : Server error occurred at GSTN server \nResponse code : 500";
errMsg = "Message : Error occurred at GSTN server \nResponse code : 500";
errorXML = getError(errMsg, "GSTAPIERR", conn);
}
else
......@@ -457,6 +455,19 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
errMsg = "Message : "+errorJSON.getString("message")+" \nError code : "+errorJSON.getString("error_cd");
errorXML = getError(errMsg, "GSTAPIERR", conn);
}
if("GSTR1".equalsIgnoreCase(returnType))
{
if("SUBMIT".equalsIgnoreCase(action))
{
retXML += getGstr1Summary(authToken, stateCode, userName, gstinNo, periodCode, authSEK, appKeyEncryptedAndCoded, conn);
retXML += downloadGstr1Data(gstinNo, periodCode, authToken, userName, stateCode, appKeyEncryptedAndCoded, authSEK);
}
else if("FILE".equalsIgnoreCase(action))
{
retXML += getGstr1Summary(authToken, stateCode, userName, gstinNo, periodCode, authSEK, appKeyEncryptedAndCoded, conn);
}
}
valueXmlString.append("<Detail2 domID='1'>");
valueXmlString.append("<auth_token><![CDATA["+ authToken +"]]></auth_token>");
......@@ -646,6 +657,32 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
if("GSTR1".equalsIgnoreCase(returnType))
{
if("SUBMIT".equalsIgnoreCase(action))
{
sql = "SELECT COUNT(1) AS CNT FROM GST_DATA_HDR WHERE REC_TYPE = '1' AND SUBMIT_STATUS = 'T' AND PRD_CODE = ? AND SITE_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, periodCode);
pstmt.setString(2, loginSiteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
if(rs.getInt("CNT") == 0)
{
errList.add( "VTNORECSAV" );
errFields.add("returns_type");
}
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
if(rs!=null)
{
rs.close();
rs = null;
}
}
if("FILE".equalsIgnoreCase(action))
{
sql = "SELECT COUNT(1) AS CNT FROM GST_DATA_HDR WHERE REC_TYPE = '1' AND SUBMIT_STATUS = 'S' AND PRD_CODE = ? AND SITE_CODE = ?";
pstmt = conn.prepareStatement(sql);
......@@ -670,6 +707,29 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
rs.close();
rs = null;
}
sql = "SELECT COUNT(1) AS CNT FROM GST_DATA_HDR WHERE REC_TYPE = '1' AND SUBMIT_STATUS = 'R' AND PRD_CODE = ? AND SITE_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, periodCode);
pstmt.setString(2, loginSiteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
if(rs.getInt("CNT") > 0)
{
errList.add( "VTGSTFILE" );
errFields.add("returns_type");
}
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
if(rs!=null)
{
rs.close();
rs = null;
}
}
}
break;
......@@ -884,7 +944,7 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
private String downloadGstr1Data (String gstinNo, String periodCode, String authToken, String userName, String stateCode, String appKeyEncryptedAndCoded, byte[] authSek) throws ITMException
{
StringBuffer retStringBuff = new StringBuffer();
String[] gstr1Section = {"B2B","B2CL","B2CS","CDNR","AT","TXP","NIL","EXP","HSNSUM"};
String[] gstr1Section = {"B2B","B2CL","B2CS","CDNR","AT","TXP","NIL","EXP","HSNSUM","CDNUR"};
String gspAuthString = "", gspAuthSignature = "";
try
......@@ -962,6 +1022,13 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
retStringBuff.append(cdnrXML);
retStringBuff.append("</cdnr_data>");
}
else if("CDNUR".equalsIgnoreCase(action))
{
String cdnurXML = XML.toString(new JSONObject(new String(getrespJsonInBytes)));
retStringBuff.append("<cdnur_data>");
retStringBuff.append(cdnurXML);
retStringBuff.append("</cdnur_data>");
}
else if("AT".equalsIgnoreCase(action))
{
String atXML = XML.toString(new JSONObject(new String(getrespJsonInBytes)));
......@@ -1083,7 +1150,7 @@ public class GSTDataSubmitWizEJB extends ValidatorEJB implements GSTDataSubmitWi
else
{
JSONObject errorJSON = getGstr1SumryResp.getBody().getObject().getJSONObject("error");
errMsg = "Message : "+errorJSON.getString("desc")+" \nError code : "+errorJSON.getString("code");
errMsg = "Message : "+errorJSON.getString("message")+" \nError code : "+errorJSON.getString("error_cd");
retString = getError(errMsg, "GSTAPIERR", conn);
}
}
......
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