Commit 96febeb8 authored by prane's avatar prane

bug fixes of mrp report related and sql excecution on some condition

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@202778 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 932eb748
...@@ -5536,6 +5536,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5536,6 +5536,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("SQL Det File Name:::::" //System.out.println("SQL Det File Name:::::"
//+ sqlFileNameDet); //+ sqlFileNameDet);
//BaseLogger.log( "9", null, null, "SQL Det File Name:::::"+sqlFileNameDet); //BaseLogger.log( "9", null, null, "SQL Det File Name:::::"+sqlFileNameDet);
}
if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle")) if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle"))
{ {
//String adpDetQueryOriginal = readFile(sqlFileNameDet+ "Oracle.sql"); //String adpDetQueryOriginal = readFile(sqlFileNameDet+ "Oracle.sql");
...@@ -5788,7 +5789,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5788,7 +5789,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmt = null; pstmt = null;
} }
} //}
//Pavan R on 09/oct/17 end //Pavan R on 09/oct/17 end
//System.out.println("@@@@@@3934:outside itemCodeTo["+itemCodeTo+"]isBomReplace["+isBomReplace+"]adpElement.getItemCode()["+adpElement.getItemCode()+"]"); //System.out.println("@@@@@@3934:outside itemCodeTo["+itemCodeTo+"]isBomReplace["+isBomReplace+"]adpElement.getItemCode()["+adpElement.getItemCode()+"]");
...@@ -5799,6 +5800,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5799,6 +5800,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement.setDemand(dueDate, bomReplaceDemand, " ", " "); adpElement.setDemand(dueDate, bomReplaceDemand, " ", " ");
} }
*/ */
BaseLogger.log("0",null,null,"Populate Demand completed...................."+demandSupplyList);
} catch (SQLException se) } catch (SQLException se)
{ {
//System.out.println("SQLException :RunMRPPrcEJB : populateDemandSupply(ADPElement).." + se.getMessage()); //System.out.println("SQLException :RunMRPPrcEJB : populateDemandSupply(ADPElement).." + se.getMessage());
...@@ -14351,9 +14353,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -14351,9 +14353,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
catch (Exception e) catch (Exception e)
{ {
//System.out.println("Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":"); //System.out.println("Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":");
BaseLogger.log("0", null, null, "Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":"); BaseLogger.log("0", null, null, "Exception :RunMRPPrc :write2XSL():" + e.getMessage() + ":");
e.printStackTrace(); //e.printStackTrace();
throw new ITMException(e); //throw new ITMException(e);
mrpOutputLocation = CommonConstants.JBOSSHOME + File.separator +"mrpexcel"+File.separator;//Pavan R 26Jun2019 [to take default output location if not found]
BaseLogger.log("0", null, null, "mrp_output_location not found in ibase.xml:: default mrpOutputLocation::"+mrpOutputLocation);
} }
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
String curTime = (new java.text.DecimalFormat("0000")).format(cal.get(Calendar.YEAR)) + (new java.text.DecimalFormat("00")).format(cal.get(Calendar.MONTH) + 1) + (new java.text.DecimalFormat("00")).format(cal.get(Calendar.DAY_OF_MONTH)) + (new java.text.DecimalFormat("00")).format(cal.get(Calendar.HOUR_OF_DAY)) + (new java.text.DecimalFormat("00")).format(cal.get(Calendar.MINUTE)); String curTime = (new java.text.DecimalFormat("0000")).format(cal.get(Calendar.YEAR)) + (new java.text.DecimalFormat("00")).format(cal.get(Calendar.MONTH) + 1) + (new java.text.DecimalFormat("00")).format(cal.get(Calendar.DAY_OF_MONTH)) + (new java.text.DecimalFormat("00")).format(cal.get(Calendar.HOUR_OF_DAY)) + (new java.text.DecimalFormat("00")).format(cal.get(Calendar.MINUTE));
...@@ -15609,13 +15613,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -15609,13 +15613,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
BaseLogger.log("2", null, null, "@@@@ chgUser["+chgUser+"]empCode["+empCode+"]emailId["+emailId+"]"); BaseLogger.log("2", null, null, "@@@@ chgUser["+chgUser+"]empCode["+empCode+"]emailId["+emailId+"]");
if( emailId == null || emailId.trim().length() == 0 ) if( emailId == null || emailId.trim().length() == 0 )
{ {
sql = " select email_id_of from employee where emp_code = ? "; sql = " select email_id_off from employee where emp_code = ? ";
pStmt = conn.prepareStatement(sql); pStmt = conn.prepareStatement(sql);
pStmt.setString(1, empCode); pStmt.setString(1, empCode);
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
emailId = checkNull(rs.getString("email_id_of")); emailId = checkNull(rs.getString("email_id_off"));
} }
rs.close(); rs.close();
rs = null; rs = null;
...@@ -15662,7 +15666,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -15662,7 +15666,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String rptArgName = ""; String rptArgName = "";
String argValue = ""; String argValue = "";
Document xmlDom = genericUtility.parseString(xmlString); Document xmlDom = genericUtility.parseString(xmlString);
DBAccessEJB dbAccess = new DBAccessEJB();
String loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
UserInfoBean userInfo = dbAccess.createUserInfo(loginCode);
siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode"); siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
if(reportArgs != null && reportArgs.trim().length() > 0) if(reportArgs != null && reportArgs.trim().length() > 0)
...@@ -15713,10 +15719,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -15713,10 +15719,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
|| "TEXT".equalsIgnoreCase(reportType) || "ODS".equalsIgnoreCase(reportType) || "EXCEL(XLSX)".equalsIgnoreCase(reportType)) || "TEXT".equalsIgnoreCase(reportType) || "ODS".equalsIgnoreCase(reportType) || "EXCEL(XLSX)".equalsIgnoreCase(reportType))
{ {
BaseLogger.log("3", null, null, "@V@ Report extention found :- ["+reportType+"]"); BaseLogger.log("3", null, null, "@V@ Report extention found :- ["+reportType+"]");
XSDParser xsdParser = new XSDParser(reportName); //XSDParser xsdParser = new XSDParser(reportName);
XSDParser xsdParser = new XSDParser(reportName, userInfo);
ArgumentHandler argObj = new ArgumentHandler(xsdParser); ArgumentHandler argObj = new ArgumentHandler(xsdParser);
argObj.init(); argObj.init();
JasperReportGenerator jasperReport= new JasperReportGenerator(); //JasperReportGenerator jasperReport= new JasperReportGenerator();
JasperReportGenerator jasperReport= new JasperReportGenerator(userInfo);
TreeMap argMap = jasperReport.createArgMap(argumentString); TreeMap argMap = jasperReport.createArgMap(argumentString);
argMap.put("report_save_type", reportType); argMap.put("report_save_type", reportType);
......
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