Advertisement
dahomee_69

SendWFRegHosInv

Dec 21st, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 37.64 KB | None | 0 0
  1. package gosi.business.batch.socialinsurance.occupationalhazards.injury.controller;
  2.  
  3.  
  4. //gosi.business.batch.socialinsurance.occupationalhazards.injury.controller.ServiceController
  5. import gosi.common.batch.util.BatchProcessController;
  6.  
  7. import gosi.common.batch.util.GOSIBatchConstants;
  8. import gosi.common.batch.util.GOSIBatchException;
  9. import gosi.common.batch.util.beans.BatchRestart;
  10. import gosi.common.batch.util.GOSIBatchUtilities;
  11. import gosi.common.batch.util.GOSIBatchSQL;
  12. import gosi.common.batch.util.BatchComponentDAOFactory;
  13. import gosi.common.batch.util.GOSIBatchErrorMessages;
  14.  
  15. import java.sql.PreparedStatement;
  16. import java.sql.SQLException;
  17. import java.util.ArrayList;
  18. import java.util.GregorianCalendar;
  19. import java.util.HashMap;
  20. import java.sql.Timestamp;
  21.  
  22.  
  23. import gosi.business.batch.socialinsurance.occupationalhazards.injury.beans.RegHospInvoiceHeaderBean;
  24.  
  25. import gosi.business.batch.socialinsurance.occupationalhazards.injury.beans.TreatmentHeaderBean;
  26. import gosi.business.batch.socialinsurance.occupationalhazards.injury.beans.TreatmentServiceBean;
  27.  
  28. import gosi.business.batch.socialinsurance.occupationalhazards.common.beans.OHBatchConstants;
  29. import gosi.business.batch.socialinsurance.occupationalhazards.common.beans.OHBatchUtilities;
  30.  
  31. import gosi.database.batch.socialinsurance.occupationalhazards.injury.dao.SendWFRegHosInvDAO;
  32. import gosi.common.batch.workflow.beans.BatchWorkflowParamBean;
  33.  
  34. import gosi.common.reports.beans.BatchReportConstants;
  35. import gosi.common.reports.util.ReportInterfaceUtility;
  36.  
  37.  
  38.  
  39.  
  40. public class SendWFRegHosInvController extends BatchProcessController
  41. {
  42.        
  43.     String selectInvoiceHeaderDetails   = null;    
  44.     String selectInjuryListDetails  = null;
  45.     String selectTreatmentServiceList   = null;
  46.     String selectExistDuplicateRecordByInjuryId = null;
  47.     String selectExistDuplicateRecordByDisAssmtId   = null;
  48.     String updateTreatmentService   = null;
  49.    
  50.    
  51.     PreparedStatement psSelectInvoiceHeaderDetailsDAO   = null;    
  52.     PreparedStatement psSelectInjuryListDetailsDAO  = null;
  53.     PreparedStatement psSelectTreatmentServiceListDAO   = null;
  54.     PreparedStatement psSelectExistDuplicateRecordByInjuryIdDAO = null;
  55.     PreparedStatement psSelectExistDuplicateRecordByDisAssmtIdDAO   = null;
  56.     PreparedStatement psUpdateTreatmentServiceDAO   = null;
  57.    
  58.    
  59.     ReportInterfaceUtility reportInterfaceUtility =  null;
  60.    
  61.        
  62.     long requestId = 0;
  63.     SendWFRegHosInvDAO sendWFRegHosInvDAO = null;
  64.     Timestamp currentDate=new Timestamp(System.currentTimeMillis());
  65.  
  66.  
  67.  
  68.    
  69.     private BatchRestart restart =  getBatchRestartInLastRun();
  70.    
  71.     //Batch parameters
  72.     String fileName = "";
  73.     String fileType= "";
  74.  
  75.     short fileNameParamValue=(short)1001;
  76.  
  77.     Long systemId =  new Long(getUserCode());
  78.    
  79.    
  80.     int noOfRequests =0;
  81.     /**
  82.      * @roseuid
  83.      * @J2EE_METHOD  --  GenerateRegHospitalInvoiceController
  84.      *
  85.      */
  86.    public SendWFRegHosInvController(String batchId,byte batchFlag)
  87.    throws GOSIBatchException
  88.    {
  89.         super(batchId,batchFlag);
  90.         System.out.println("Inside constructor:batchId:"+batchId);
  91.    }
  92.  
  93.  
  94.  
  95.    public boolean invokeBatchService()
  96.    throws GOSIBatchException
  97.    {
  98.    
  99.         try
  100.         {
  101.             System.out.println("|-----------invokeBatchService-------------|");
  102.            
  103.             long startTime=System.currentTimeMillis();
  104.        
  105.             selectInvoiceHeaderDetails = GOSIBatchSQL.getSqlString("OHZ_026_SQL_1001");
  106.             System.out.println("OHZ_026_SQL_1001:"+selectInvoiceHeaderDetails);
  107.             psSelectInvoiceHeaderDetailsDAO = getConnection().prepareStatement( selectInvoiceHeaderDetails   );
  108.            
  109.             selectInjuryListDetails = GOSIBatchSQL.getSqlString("OHZ_026_SQL_1002");
  110.             System.out.println("OHZ_026_SQL_1002:"+selectInjuryListDetails);
  111.             psSelectInjuryListDetailsDAO = getConnection().prepareStatement( selectInjuryListDetails     );
  112.            
  113.             selectTreatmentServiceList = GOSIBatchSQL.getSqlString("OHZ_026_SQL_1003");
  114.             System.out.println("OHZ_026_SQL_1003:"+selectTreatmentServiceList);
  115.             psSelectTreatmentServiceListDAO = getConnection().prepareStatement( selectTreatmentServiceList   );
  116.            
  117.             selectExistDuplicateRecordByInjuryId = GOSIBatchSQL.getSqlString("OHZ_026_SQL_1004");
  118.             System.out.println("OHZ_026_SQL_1004:"+selectExistDuplicateRecordByInjuryId);
  119.             psSelectExistDuplicateRecordByInjuryIdDAO = getConnection().prepareStatement( selectExistDuplicateRecordByInjuryId   );
  120.            
  121.             selectExistDuplicateRecordByDisAssmtId = GOSIBatchSQL.getSqlString("OHZ_026_SQL_1005");
  122.             System.out.println("OHZ_026_SQL_1005:"+selectExistDuplicateRecordByDisAssmtId);
  123.             psSelectExistDuplicateRecordByDisAssmtIdDAO = getConnection().prepareStatement( selectExistDuplicateRecordByDisAssmtId   );
  124.            
  125.             updateTreatmentService = GOSIBatchSQL.getSqlString("OHZ_026_SQL_1006");
  126.             System.out.println("OHZ_026_SQL_1006:"+updateTreatmentService);
  127.             psUpdateTreatmentServiceDAO = getConnection().prepareStatement( updateTreatmentService   );
  128.            
  129.             sendWFRegHosInvDAO = (SendWFRegHosInvDAO)BatchComponentDAOFactory.
  130.                         getBatchDAOInstance(getBatchMaster(),
  131.                         getBatchErrorList(),
  132.                         getBatchError(),
  133.                         getConnection(),
  134.                         OHBatchConstants.SEND_WORKFLOW_REG_HOSP_INVOICE_DAO);
  135.            
  136.             reportInterfaceUtility =
  137.                 new ReportInterfaceUtility(
  138.                 BatchReportConstants.CMN_LETTER_GEN_SERVICEID,
  139.                 getBatchMaster(),
  140.                 getBatchErrorList(),
  141.                 getBatchError(),
  142.                 getConnection(),
  143.                 getBatchParamList());
  144.  
  145.             //Checking the batchFlah to process only error or all records
  146.             //Note :- Workflow Batch does not require the restsrt keys
  147.             //in the last run.
  148.             //In normal cases if the restart keys are not
  149.             //null Process Component need process the records from that
  150.             //Point
  151.            
  152.             if(getBatchFlag()==GOSIBatchConstants.PROCESS_ONLY_ERROR_RECORDS)
  153.             {
  154.                 //processOnlyErrorRecords();
  155.             }
  156.             else
  157.             {
  158.                 //processOnlyErrorRecords();
  159.                 processAllRecords();
  160.             }
  161.            
  162.             long endTime=System.currentTimeMillis();
  163.             long totalTime=(endTime-startTime)/1000;
  164.             System.out.println("|-----------StratBatchTime*------------|");
  165.             System.out.println(currentDate);
  166.             System.out.println("|-----------EndBatchTime*------------|");
  167.             System.out.println(new Timestamp(System.currentTimeMillis()));
  168.             System.out.println("|-----------BatchTakeTime*------------|");
  169.             System.out.println("Time required for batch run in minute :"+totalTime/60);
  170.            
  171.             System.out.println("Time required for batch run :"+totalTime);
  172.  
  173.             System.out.println("|-----------invokeBatchService*------------|");
  174.        
  175.         }
  176.         catch(GOSIBatchException ge)
  177.         {
  178.             updateBatchRunStatus(false);
  179.             rollBack();
  180.             throw ge;
  181.         }
  182.         catch(Exception e)
  183.         {
  184.             updateBatchRunStatus(false);
  185.             rollBack();
  186.             new GOSIBatchException(e,
  187.                     this.getClass().toString(),
  188.                     "invokeBatchService",
  189.                     getBatchMaster(),
  190.                     getBatchError(),
  191.                     getBatchErrorList(),
  192.                     GOSIBatchConstants.
  193.                     WORKFLOW_HISTORY_LOOP_ONE,
  194.                     GOSIBatchConstants.SEVERITY_ONE,
  195.                     "CMN_001_ERR_1001");
  196.         }
  197.         finally
  198.         {
  199.  
  200.            
  201.             GOSIBatchUtilities.cleanUp( psSelectInvoiceHeaderDetailsDAO);
  202.             GOSIBatchUtilities.cleanUp( psSelectInjuryListDetailsDAO);            
  203.             GOSIBatchUtilities.cleanUp( psSelectTreatmentServiceListDAO);
  204.             GOSIBatchUtilities.cleanUp( psUpdateTreatmentServiceDAO);
  205.             GOSIBatchUtilities.cleanUp(getConnection());
  206.         }        
  207.         return getBatchRunStatus();    
  208.    }
  209.    
  210.     /**
  211.      * @
  212.      * @J2EE_METHOD  --  processOnlyErrorRecords
  213.      *
  214.      */
  215.    private void processOnlyErrorRecords()
  216.    throws GOSIBatchException
  217.    {
  218.         int loopCount=1;      
  219.        
  220.  
  221.         try
  222.         {
  223.             System.out.println("|-----------processOnlyErrorRecords-------------|");
  224.            
  225.             System.out.println("|-----------processOnlyErrorRecords*------------|");
  226.         }
  227.         catch(Exception e)
  228.         {
  229.             updateBatchRunStatus(false);
  230.             rollBack();
  231.             new GOSIBatchException(e,
  232.             this.getClass().toString(),
  233.             "processOnlyErrorRecords",
  234.             getBatchMaster(),
  235.             getBatchError(),
  236.             getBatchErrorList(),
  237.             loopCount,
  238.             GOSIBatchConstants.SEVERITY_ONE,
  239.             "CMN_001_ERR_1000");
  240.         }
  241.        
  242.    }
  243.     /**
  244.      * @
  245.      * @J2EE_METHOD  --  processOnlyErrorRecords
  246.      *
  247.      */
  248.      private void processAllRecords()
  249.         throws GOSIBatchException
  250.     {
  251.         System.out.println("|-----------processAllRecords------------|");
  252.         System.out.println("Inside process all records" );                  
  253.         Long hospitalCode=null;
  254.         noOfRequests =  getNoOfRequests();
  255.         int loopCount=1;      
  256.         int numOfRecordsInserted=0 ;
  257.         ArrayList invoiceHeaderList = null;  
  258.  
  259.     //  location has to be retrieved from ?
  260.        
  261.        
  262.         try
  263.         {
  264.             /*int restartRun=0;
  265.             if(restart!=null)
  266.             {
  267.                 if(restart.getRestartKeys()!=null)
  268.                 {
  269.                     restartRun=1;
  270.                 }  
  271.             }  */
  272.            
  273.                 // Start Business Validation
  274.  
  275.             // get list of files
  276.            
  277.             invoiceHeaderList=getInvoiceHeaderDetails(psSelectInvoiceHeaderDetailsDAO);
  278.            
  279.             for (int j=0;j<invoiceHeaderList.size();j++)
  280.             {
  281.                 RegHospInvoiceHeaderBean invoiceHeaderBean =(RegHospInvoiceHeaderBean)invoiceHeaderList.get(j);
  282.                 hospitalCode=invoiceHeaderBean.getHospitalCode();
  283.                 int month=OHBatchUtilities.getMonth(invoiceHeaderBean.getInvoiceDateStr());
  284.                 int year=OHBatchUtilities.getYear(invoiceHeaderBean.getInvoiceDateStr());
  285.                 Timestamp stDate=invoiceHeaderBean.getStartDate();
  286.                 String endDateStr=OHBatchUtilities.getMonthEndDate(OHBatchUtilities.getDateStr(stDate, "G"));
  287.                 Timestamp endDate=OHBatchUtilities.getGregDate(endDateStr, "G");
  288.                 Timestamp maxUploadMonthDate=invoiceHeaderBean.getMaxUploadedMonthDate();
  289.                 System.out.println("=============================================================== \t \t \t \t Invoice Month/Year : "+month+"/"+year+" for hospitalCode:"+hospitalCode +" \t \t \t \t ====================================================================");
  290.                 System.out.println();
  291.                
  292.                 ArrayList injuryList=getInjuryDetailsThatDoNotHaveWF(psSelectInjuryListDetailsDAO,hospitalCode,month,year);
  293.                 System.out.println("\t\t *************************************************************************************** \t the list of injuryList size is : "+injuryList.size() + "\t **************************************************************************");
  294.                 System.out.println();
  295.                 //GOSIBatchUtilities.cleanUp( psUpdateTreatmentServiceDAO);
  296.                 for(int x=0;x<injuryList.size();x++)
  297.                 {
  298.                     TreatmentHeaderBean trmtBean=(TreatmentHeaderBean)injuryList.get(x);
  299.                     int differentDate=GOSIBatchUtilities.getDateDifference(maxUploadMonthDate, trmtBean.getMaxTrmtDate());
  300.                     String maxDateStr=OHBatchUtilities.getDateStr(trmtBean.getMaxTrmtDate(), "G");
  301.                     String lastServiceDateStr=OHBatchUtilities.getDateStr(trmtBean.getMaxTrmtDate(), "G");
  302.                     psSelectTreatmentServiceListDAO.setLong(1, trmtBean.getTrmtServiceHdrId());
  303.                     psSelectTreatmentServiceListDAO.setShort(2, OHBatchConstants.TRMT_SRVC_STS_PENDING_WORKFLOW_ENTRY);
  304.                     psSelectTreatmentServiceListDAO.setShort(3, OHBatchConstants.TRMT_SRVC_STS_PENDING_WORKFLOW_ENTRY_RECORRECTED);
  305.                     ArrayList trmtServiceDetForInjuryList=sendWFRegHosInvDAO.getTrmrServiceList(psSelectTreatmentServiceListDAO);
  306.                    
  307.                     Boolean isAllServiceReCorrected=true;
  308.                    
  309.                     for (int a=0;a<trmtServiceDetForInjuryList.size();a++){
  310.                         if(((TreatmentServiceBean)trmtServiceDetForInjuryList.get(a)).getTrmtSrvcStatus().equals(OHBatchConstants.TRMT_SRVC_STS_PENDING_WORKFLOW_ENTRY))
  311.                         {
  312.                             isAllServiceReCorrected=false;
  313.                             break;
  314.                         }
  315.                     }
  316.                        
  317.                     Boolean createWorkflow=false;
  318.                    
  319.                     if (!trmtBean.getInvoiceStatus().equals(OHBatchConstants.REG_HOSP_INVC_PENDING_DATA_ENTRY))
  320.                     {
  321.                         createWorkflow=true;
  322.                     }
  323.                     else if (differentDate>OHBatchConstants.MAX_DIFFERENT_DATE_TO_CREATE_WORKFLOW_TREATMETN_SERVICE)
  324.                     {
  325.                         if(!isAllServiceReCorrected || !trmtBean.getIsHaveErrorInEClaim())
  326.                             createWorkflow=true;
  327.                        
  328.                     }
  329.                     else if (endDate.equals(trmtBean.getMaxTrmtDate()))
  330.                     {
  331.                         if(!isAllServiceReCorrected || !trmtBean.getIsHaveErrorInEClaim())
  332.                             createWorkflow=true;
  333.                        
  334.                     }
  335.                     else if (trmtBean.getInjuryId()!=null && trmtBean.getLastServiceDate()!=null && trmtBean.getMaxTrmtDate().equals(trmtBean.getLastServiceDate()))
  336.                     {
  337.                         //case injury Or Complication
  338.                         if(!isAllServiceReCorrected || !trmtBean.getIsHaveErrorInEClaim())
  339.                             createWorkflow=true;
  340.                        
  341.                     }
  342.                    
  343.                     System.out.println("\t\t\t "+(trmtBean.getDisAssmtId()!=null?("disability id :"+trmtBean.getDisAssmtId()):("injuryid :"+trmtBean.getInjuryId()))+", max Trmt date : "+OHBatchUtilities.getDateStr(trmtBean.getMaxTrmtDate(),"G")+" , Max Upload Month Date :"+maxUploadMonthDate+" , differentDate :"+differentDate +" endDateStr : "+endDateStr);
  344.                     System.out.println("\t\t\t getInvoiceStatus : " +trmtBean.getInvoiceStatus() +" ,getIsHaveErrorInEClaim : " +trmtBean.getIsHaveErrorInEClaim()+" ,getLastServiceDate : " +OHBatchUtilities.getDateStr(trmtBean.getLastServiceDate(),"G")+" ,  trmtServiceDetForInjuryList size is : "+trmtServiceDetForInjuryList.size() +", createWorkflow : "+createWorkflow+" \t\t");
  345.                
  346.                     if(createWorkflow)
  347.                     {
  348.                         // create for loop to insure each workflow have just only less or equals 900 treatment Service
  349.                         int index =0;
  350.                         int maxSize =0;
  351.                         do
  352.                         {
  353.                             System.out.println("trmtServiceDetForInjuryList size :"+trmtServiceDetForInjuryList.size());
  354.                             System.out.println("MAX_TRMT_SERVICE_IN_WORKFLOW :"+OHBatchConstants.MAX_TRMT_SERVICE_IN_WORKFLOW);
  355.                             System.out.println("before index :"+index);
  356.                             System.out.println("before maxSize :"+maxSize);
  357.                            
  358.  
  359.                             index=maxSize;
  360.                             if(trmtServiceDetForInjuryList.size()<=(maxSize+OHBatchConstants.MAX_TRMT_SERVICE_IN_WORKFLOW))
  361.                             {
  362.                                 maxSize=trmtServiceDetForInjuryList.size();
  363.                             }
  364.                             else
  365.                             {
  366.                                 maxSize+=OHBatchConstants.MAX_TRMT_SERVICE_IN_WORKFLOW;
  367.                             }
  368.                             System.out.println("after index will be :"+index);
  369.                             System.out.println("after maxSize will be  :"+maxSize);
  370.                            
  371.                             Long workflowId =GOSIBatchUtilities.getPrimaryKey("TRMTSRVCWRKFLOID",getUserCode());
  372.                             System.out.println("new workflowId:"+workflowId);
  373.                             for (int z=index;z<maxSize;z++)
  374.                             {
  375.                                 TreatmentServiceBean trtmService = (TreatmentServiceBean)trmtServiceDetForInjuryList.get(z);
  376.                                 String trmtCode=trtmService.getSFDACode()!=null?trtmService.getSFDACode():trtmService.getTrmtCode();
  377.                                 int hour=Integer.parseInt(trtmService.getTrmtTimeHr());
  378.                                 int min=Integer.parseInt(trtmService.getTrmtTimeMin());
  379.                                 int pmAp=trtmService.getTrmtTimeAmPm().intValue();
  380.                                 Boolean isExistDuplicateRecord=false;
  381.                                 String caseId="";
  382.                                 if (trmtBean.getInjuryId()!=null)
  383.                                 {
  384.                                     caseId="injury id :"+trmtBean.getInjuryId();
  385.                                     isExistDuplicateRecord=isExistDuplicateRecord(psSelectExistDuplicateRecordByInjuryIdDAO,
  386.                                             trmtBean.getInjuryId(),trmtCode,trtmService.getTrmtDateGreg(),hour,min,pmAp,trtmService.getTrmtServiceDetId());
  387.                                 }
  388.                                 else
  389.                                 {
  390.                                     caseId="DisAssmtId id :"+trmtBean.getDisAssmtId();
  391.                                     isExistDuplicateRecord=isExistDuplicateRecord(psSelectExistDuplicateRecordByDisAssmtIdDAO,
  392.                                             trmtBean.getDisAssmtId(),trmtCode,trtmService.getTrmtDateGreg(),hour,min,pmAp,trtmService.getTrmtServiceDetId());
  393.                                 }
  394.                             //  Check if Exist Duplicate
  395.                                 if(isExistDuplicateRecord)
  396.                                 {
  397.                                     System.err.println("err duplicate treatment Service for "+caseId+" On Treatment Or Medicine Code :"+trmtCode+
  398.                                             " which getTrmtServiceHdrId :"+trtmService.getTrmtServiceHdrId()+" And  TrmtServiceDetId :"+trtmService.getTrmtServiceDetId());
  399.                                     throw new Exception();
  400.                                 }
  401.                                
  402.                                 trtmService.setTrmtSrvcStatus(OHBatchConstants.TRMT_SRVC_STS_ENTERED);
  403.                                 trtmService.setTrmtSrvcWrkfloId(workflowId);
  404.                                 sendWFRegHosInvDAO.updateTreatmentService(trtmService, psUpdateTreatmentServiceDAO);
  405.                                
  406.                             } // end for loop of each service
  407.                            
  408.                             BatchWorkflowParamBean workflowParamBean = new BatchWorkflowParamBean();
  409.                             workflowParamBean.setCompletedStepShortName ("ADD_TRMT_SRVC");
  410.                             workflowParamBean.setKeyVal1(trmtBean.getSocInsNumber().toString());
  411.                             workflowParamBean.setKeyVal2(GOSIBatchUtilities.getDateFullString(trmtBean.getInjuryDate()));
  412.                             workflowParamBean.setRecordDescription  (String.format(GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_001"),
  413.                                     (getMonthName(month,true) +" - "+ year))+" " + trmtBean.getSocInsNumber().toString());
  414.                             workflowParamBean.setDestinationLoactionId(trmtBean.getFieldOffice().shortValue());
  415.                             workflowParamBean.setRoutingCriterion(GOSIBatchConstants.COMPLETED);
  416.                             // PrimaryKey is the WORKFLOWID
  417.                             //  WORKFLOWID FROM T_TRMTSERVICESDET TABLE  
  418.                             workflowParamBean.setPrimaryKey (workflowId.toString());
  419.                             System.out.println("\t\t\t PrimaryKey----"+workflowParamBean.getPrimaryKey());
  420.                             GOSIBatchUtilities.startBatchWorkflow(workflowParamBean,getConnection());
  421.                             sendWFRegHosInvDAO.executeBatchStatment(psUpdateTreatmentServiceDAO);
  422.                            
  423.                         }while(maxSize<trmtServiceDetForInjuryList.size());
  424.                        
  425.                     } // end if createWorkflow
  426.                     System.out.println();
  427.                     System.out.println("\t\t *********************************************************************************************************************************************************************************************************");
  428.                     System.out.println();
  429.                 } // end for injury List
  430.                 System.out.println();
  431.                 System.out.println("=================================================================================================================================================================================================================================================================== \n \n \n ");
  432.                 System.out.println();
  433.                 System.out.println();
  434.                 System.out.println();
  435.             }
  436.                
  437.                
  438.          
  439.             updateBatchRunStatus (true);
  440.             endOfProcess();
  441.             System.out.println("|-----------processAllRecords*------------|");
  442.         }
  443.         catch(GOSIBatchException ge)
  444.         {
  445.            System.out.println("controller:processAllRecords:"+ge);
  446.            ge.printStackTrace();
  447.            rollBack();
  448.            updateBatchRunStatus(false);
  449.             throw ge;
  450.         }
  451.         catch(Exception e)
  452.         {
  453.             System.out.println("controller:processAllRecords:"+e);
  454.             updateBatchRunStatus(false);
  455.             e.printStackTrace();
  456.             rollBack();
  457.             new GOSIBatchException(e,
  458.                                 this.getClass().toString(),
  459.                                 "processAllRecords",
  460.                                 getBatchMaster(),
  461.                                 getBatchError(),
  462.                                 getBatchErrorList(),
  463.                                 loopCount,
  464.                                 GOSIBatchConstants.SEVERITY_ONE,
  465.                                 "CMN_001_ERR_1001");
  466.         }
  467.        
  468.    }
  469.    
  470.      /**
  471.          *  getRegHosInvHdrList ()
  472.          *
  473.          *  @param psSelectRegHosInvoiceHdrDAO, Long , GregorianCalendar
  474.          *  @return get list of invoice header that related with the month of file
  475.          */
  476.      private HashMap getRegHosInvHdrList(PreparedStatement psSelectRegHosInvoiceHdrDAO, Long hospitalCode ,
  477.              GregorianCalendar calendar) throws GOSIBatchException
  478.      {
  479.          int i =0;
  480.          HashMap regHosInvHdrList=null;
  481.     //   System.out.println ("Start getRegHosInvHdrList");
  482.          try
  483.          {
  484.             psSelectRegHosInvoiceHdrDAO.setLong(++i, hospitalCode);
  485.             psSelectRegHosInvoiceHdrDAO.setTimestamp(++i, new Timestamp(calendar.getTime().getTime()));
  486.             psSelectRegHosInvoiceHdrDAO.setShort(++i, OHBatchConstants.REG_HOSP_INVC_PENDING_DATA_ENTRY);
  487.             regHosInvHdrList=sendWFRegHosInvDAO.getRegHosInvHdrList(psSelectRegHosInvoiceHdrDAO);
  488.          }
  489.          catch (GOSIBatchException ge)
  490.          {
  491.              updateBatchRunStatus (false);
  492.              rollBack();
  493.              throw   ge;
  494.          }
  495.          catch (Exception e)
  496.          {
  497.              updateBatchRunStatus (false);
  498.              rollBack();
  499.              new GOSIBatchException (e,
  500.                      this.getClass().toString(),
  501.                      "getRegHosInvHdrList",
  502.                      getBatchMaster(),
  503.                      getBatchError(),
  504.                      getBatchErrorList(),
  505.                      OHBatchConstants.LOOP_ONE,
  506.                      GOSIBatchConstants.SEVERITY_ONE,
  507.              "CMN_001_ERR_1001");
  508.          }
  509.         // System.out.println ("End getRegHosInvHdrList");
  510.  
  511.          return regHosInvHdrList;
  512.      }
  513.      
  514.      /**
  515.          *  getRegHosInvDetList ()
  516.          *
  517.          *  @param psSelectTrmtServiceHdrDAO, Long , GregorianCalendar
  518.          *  @return get list of All invoice details and Treatment Header that related with the month of file
  519.          */
  520.      private HashMap getRegHosInvDetList(PreparedStatement psSelectTrmtServiceHdrDAO, Long hospitalCode ,
  521.              GregorianCalendar calendar) throws GOSIBatchException
  522.      {
  523.          int i =0;
  524.          HashMap regHosInvDetList=null;
  525.          //System.out.println ("Start getRegHosInvHdrList");
  526.          try
  527.          {
  528.             psSelectTrmtServiceHdrDAO.setShort(++i, OHBatchConstants.WFS_SRVC_ENTERED_BY_BATCH);
  529.             psSelectTrmtServiceHdrDAO.setShort(++i, OHBatchConstants.TRMT_SRVC_STS_ENTERED);
  530.             psSelectTrmtServiceHdrDAO.setLong(++i, hospitalCode);
  531.             psSelectTrmtServiceHdrDAO.setTimestamp(++i, new Timestamp(calendar.getTime().getTime()));
  532.             psSelectTrmtServiceHdrDAO.setShort(++i, OHBatchConstants.REG_HOSP_INVC_PENDING_DATA_ENTRY);
  533.             regHosInvDetList=sendWFRegHosInvDAO.getRegHosInvDetList(psSelectTrmtServiceHdrDAO);
  534.          }
  535.          catch (GOSIBatchException ge)
  536.          {
  537.              updateBatchRunStatus (false);
  538.              rollBack();
  539.              throw   ge;
  540.          }
  541.          catch (Exception e)
  542.          {
  543.              updateBatchRunStatus (false);
  544.              rollBack();
  545.              new GOSIBatchException (e,
  546.                      this.getClass().toString(),
  547.                      "getRegHosInvDetList",
  548.                      getBatchMaster(),
  549.                      getBatchError(),
  550.                      getBatchErrorList(),
  551.                      OHBatchConstants.LOOP_ONE,
  552.                      GOSIBatchConstants.SEVERITY_ONE,
  553.              "CMN_001_ERR_1001");
  554.          }
  555.          //System.out.println ("End getRegHosInvDetList");
  556.  
  557.          return regHosInvDetList;
  558.      }
  559.      
  560.      /**
  561.          *  getInjuryDetails ()
  562.          *
  563.          *  @param psSelectInjuryListDetailsDAO, String
  564.          *  @return get list of All Injury details that entered in the file
  565.          */
  566.      private ArrayList getInjuryDetails(PreparedStatement psSelectInjuryListDetailsDAO,
  567.              String fileUploadInfoId, Long hospitalcode,int month , int year ) throws GOSIBatchException
  568.      {
  569.          int i =0;
  570.          ArrayList injuryList=null;
  571.          //System.out.println ("Start getInjuryDetails");
  572.          try
  573.          {
  574.              psSelectInjuryListDetailsDAO.setString(++i, fileUploadInfoId);
  575.              psSelectInjuryListDetailsDAO.setLong(++i, hospitalcode);
  576.              psSelectInjuryListDetailsDAO.setInt(++i, month);
  577.              psSelectInjuryListDetailsDAO.setInt(++i, year);
  578.              injuryList=sendWFRegHosInvDAO.getInjuryDetails(psSelectInjuryListDetailsDAO);
  579.          }
  580.          catch (GOSIBatchException ge)
  581.          {
  582.              updateBatchRunStatus (false);
  583.              rollBack();
  584.              throw   ge;
  585.          }
  586.          catch (Exception e)
  587.          {
  588.              updateBatchRunStatus (false);
  589.              rollBack();
  590.              new GOSIBatchException (e,
  591.                      this.getClass().toString(),
  592.                      "getInjuryDetails",
  593.                      getBatchMaster(),
  594.                      getBatchError(),
  595.                      getBatchErrorList(),
  596.                      OHBatchConstants.LOOP_ONE,
  597.                      GOSIBatchConstants.SEVERITY_ONE,
  598.              "CMN_001_ERR_1001");
  599.          }
  600.          //System.out.println ("End getInjuryDetails");
  601.  
  602.          return injuryList;
  603.      }
  604.      /**
  605.          *  getFileUploadInfoList ()
  606.          *
  607.          *  @param psSelectFileUploadInfoDAO
  608.          *  @return List of Invoice that status is pending entery
  609.          */
  610.      private ArrayList getInvoiceHeaderDetails(PreparedStatement psSelectInvoiceHeaderDetailsDAO) throws GOSIBatchException
  611.      {
  612.          int i =0;
  613.          ArrayList invoiceList=null;
  614.          //System.out.println ("Start getInvoiceHeaderDetails");
  615.          try
  616.          {
  617.              invoiceList=sendWFRegHosInvDAO.getInvoiceHeaderDetails(psSelectInvoiceHeaderDetailsDAO);
  618.          }
  619.          catch (GOSIBatchException ge)
  620.          {
  621.              updateBatchRunStatus (false);
  622.              rollBack();
  623.              throw   ge;
  624.          }
  625.          catch (Exception e)
  626.          {
  627.              updateBatchRunStatus (false);
  628.              rollBack();
  629.              new GOSIBatchException (e,
  630.                      this.getClass().toString(),
  631.                      "getFileUploadInfoList",
  632.                      getBatchMaster(),
  633.                      getBatchError(),
  634.                      getBatchErrorList(),
  635.                      OHBatchConstants.LOOP_ONE,
  636.                      GOSIBatchConstants.SEVERITY_ONE,
  637.              "CMN_001_ERR_1001");
  638.          }
  639.          //System.out.println ("End getInvoiceHeaderDetails");
  640.  
  641.          return invoiceList;
  642.      }
  643.      /**
  644.          *  getInjuryDetailsThatDoNotHaveWF ()
  645.          *
  646.          *  @param psSelectInjuryListDetailsDAO, String
  647.          *  @return get list of All Injury details that entered in the file
  648.          */
  649.      private ArrayList getInjuryDetailsThatDoNotHaveWF(PreparedStatement psSelectInjuryListDetailsDAO,Long hospitalcode,int month , int year ) throws GOSIBatchException
  650.      {
  651.          int i =0;
  652.          ArrayList injuryList=null;
  653.          try
  654.          {
  655.              psSelectInjuryListDetailsDAO.setLong(++i, hospitalcode);
  656.              psSelectInjuryListDetailsDAO.setInt(++i, month);
  657.              psSelectInjuryListDetailsDAO.setInt(++i, year);
  658.              psSelectInjuryListDetailsDAO.setLong(++i, hospitalcode);
  659.              psSelectInjuryListDetailsDAO.setInt(++i, month);
  660.              psSelectInjuryListDetailsDAO.setInt(++i, year);
  661.              psSelectInjuryListDetailsDAO.setShort(++i, OHBatchConstants.EXTN_SICKLEAVE_STS_APPROVED);
  662.              psSelectInjuryListDetailsDAO.setLong(++i, hospitalcode);
  663.              psSelectInjuryListDetailsDAO.setInt(++i, month);
  664.              psSelectInjuryListDetailsDAO.setInt(++i, year);
  665.              injuryList=sendWFRegHosInvDAO.getInjuryDetails(psSelectInjuryListDetailsDAO);
  666.          }
  667.          catch (GOSIBatchException ge)
  668.          {
  669.              updateBatchRunStatus (false);
  670.              rollBack();
  671.              throw   ge;
  672.          }
  673.          catch (Exception e)
  674.          {
  675.              updateBatchRunStatus (false);
  676.              rollBack();
  677.              e.printStackTrace();
  678.              new GOSIBatchException (e,
  679.                      this.getClass().toString(),
  680.                      "getInjuryDetailsThatDoNotHaveWF",
  681.                      getBatchMaster(),
  682.                      getBatchError(),
  683.                      getBatchErrorList(),
  684.                      OHBatchConstants.LOOP_ONE,
  685.                      GOSIBatchConstants.SEVERITY_ONE,
  686.              "CMN_001_ERR_1001");
  687.          }
  688.          //System.out.println ("End getInjuryDetailsThatDoNotHaveWF");
  689.  
  690.          return injuryList;
  691.      }
  692.      /**
  693.          *   isExistDuplicateRecord()
  694.          *
  695.          *  @param psSelectExistDuplicateRecord,Long , String , Timestamp , int , int
  696.          *  @return true if Exist Duplicate Record  else return false;
  697.          */
  698.      private Boolean  isExistDuplicateRecord (PreparedStatement  psSelectExistDuplicateRecord
  699.              , Long Id , String treatmentOrMedicineCode , Timestamp trmtDateGreg , int hour , int minute , int AmOrPm,Long trmtServiceDetId ) throws GOSIBatchException
  700.      {
  701.          int i =0;
  702.          Boolean isExistDuplicateRecord=false;
  703.          //System.out.println ("Start isExistDuplicateRecord");
  704.          try
  705.          {     
  706.             psSelectExistDuplicateRecord.setLong(++i, Id);
  707.             psSelectExistDuplicateRecord.setShort(++i, OHBatchConstants.TRMT_SRVC_STS_CANCELLED);
  708.             psSelectExistDuplicateRecord.setString(++i,treatmentOrMedicineCode);
  709.             psSelectExistDuplicateRecord.setString(++i,treatmentOrMedicineCode);
  710.             psSelectExistDuplicateRecord.setTimestamp(++i, trmtDateGreg);
  711.             psSelectExistDuplicateRecord.setInt(++i, hour);
  712.             psSelectExistDuplicateRecord.setInt(++i, minute);
  713.             psSelectExistDuplicateRecord.setInt(++i, AmOrPm);
  714.             psSelectExistDuplicateRecord.setLong(++i, trmtServiceDetId);
  715.             isExistDuplicateRecord=sendWFRegHosInvDAO.isExistDuplicateRecordDAO(psSelectExistDuplicateRecord);
  716.          }
  717.          catch (GOSIBatchException ge)
  718.          {
  719.              updateBatchRunStatus (false);
  720.              rollBack();
  721.              throw   ge;
  722.          }
  723.          catch (Exception e)
  724.          {
  725.              updateBatchRunStatus (false);
  726.              rollBack();
  727.              e.printStackTrace();
  728.              new GOSIBatchException (e,
  729.                      this.getClass().toString(),
  730.                      "isExistDuplicateRecord",
  731.                      getBatchMaster(),
  732.                      getBatchError(),
  733.                      getBatchErrorList(),
  734.                      OHBatchConstants.LOOP_ONE,
  735.                      GOSIBatchConstants.SEVERITY_ONE,
  736.              "CMN_001_ERR_1001");
  737.          }
  738.         // System.out.println ("End isExistDuplicateRecord");
  739.  
  740.          return isExistDuplicateRecord;
  741.      }
  742.      public String getMonthName (int month ,Boolean isArabic)throws GOSIBatchException{
  743.             String monthName="";
  744.             switch (month)
  745.             {
  746.             case 1:
  747.             {
  748.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_051", isArabic);
  749.                 break;
  750.             }
  751.             case 2:
  752.             {
  753.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_052", isArabic);
  754.                 break;
  755.             }
  756.             case 3:
  757.             {
  758.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_053", isArabic);
  759.                 break;
  760.             }
  761.             case 4:
  762.             {
  763.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_054", isArabic);
  764.                 break;
  765.             }
  766.             case 5:
  767.             {
  768.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_055", isArabic);
  769.                 break;
  770.             }
  771.             case 6:
  772.             {
  773.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_056", isArabic);
  774.                 break;
  775.             }
  776.             case 7:
  777.             {
  778.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_057", isArabic);
  779.                 break;
  780.             }
  781.            
  782.             case 8:
  783.             {
  784.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_058", isArabic);
  785.                 break;
  786.             }
  787.             case 9:
  788.             {
  789.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_059", isArabic);
  790.                 break;
  791.             }
  792.             case 10:
  793.             {
  794.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_060", isArabic);
  795.                 break;
  796.             }
  797.             case 11:
  798.             {
  799.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_061", isArabic);
  800.                 break;
  801.             }
  802.             case 12:
  803.             {
  804.                 monthName=GOSIBatchErrorMessages.getErrorDesc("OHZ_022_ERR_062", isArabic);
  805.                 break;
  806.             }
  807.             }
  808.            
  809.             return monthName;
  810.         }
  811.  
  812.    
  813.      /**
  814.          * @METHOD NAME              : rollBack
  815.          * @INFORMATION              : rollBack excuted records from DB.
  816.          * @PARAM                    :
  817.          * @RETURN                   : void
  818.          * @EXCEPTION                :
  819.          * @LAST MODIFIED BY         :
  820.          * @LAST MODIFIED DATE       :
  821.          **/
  822.         private void rollBack()
  823.         {
  824.             try
  825.             {
  826.                 getConnection().rollback();
  827.             }
  828.             catch (SQLException e)
  829.             {
  830.                 e.printStackTrace();
  831.             }
  832.            
  833.         }
  834.  
  835.      
  836.     }
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843. # SQL STATEMENT FOR THIS BATCH:
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  1#
  851.  
  852. /* Formatted on 21/12/16 02:50:25 م (QP5 v5.185.11230.41888) */
  853.   SELECT H.HOSPITALCODE, H.STARTDATE, maxDate.maxDate
  854.     FROM    (  SELECT H.HOSPITALCODE, H.STARTDATE
  855.                  FROM T_REGHOSPINVOICEHDR H
  856.                       LEFT JOIN T_REGHOSPINVOICEDET D
  857.                          ON D.INVOICEHEADERID = H.INVOICEHEADERID
  858.                       LEFT JOIN T_TRMTSERVICESHDR TH
  859.                          ON TH.INVOICEDETAILSID = D.INVOICEDETAILSID
  860.                       LEFT JOIN T_TRMTSERVICESDET TD
  861.                          ON TD.TRMTSERVICEHDRID = TH.TRMTSERVICEHDRID
  862.                 WHERE     H.BATCHPROCESSED IS NOT NULL
  863.                       AND H.INVOICESTATUS <> 1004
  864.                       AND TD.TRMTSRVCWRKFLOID IS NULL
  865.              GROUP BY H.HOSPITALCODE, H.STARTDATE) H
  866.          LEFT JOIN
  867.             (  SELECT U.MAPPINGKEY,
  868.                       U.MONTH,
  869.                       U.YEAR,
  870.                       MAX (R.TRMTDATE) maxdate
  871.                  FROM    T_REGHOSPINVOICEFILE r
  872.                       LEFT JOIN
  873.                          T_FILEUPLOADINFO u
  874.                       ON u.FILEUPLOADINFOID = r.FILEID
  875.              GROUP BY U.MAPPINGKEY, U.MONTH, U.YEAR) maxDate
  876.          ON     maxDate.MAPPINGKEY = H.HOSPITALCODE
  877.             AND maxDate.month = TO_CHAR (H.STARTDATE, 'MM')
  878.             AND maxDate.year = TO_CHAR (H.STARTDATE, 'YYYY')
  879. ORDER BY H.STARTDATE ASC
  880.  
  881.  2#
  882.  
  883. /* Formatted on 21/12/16 02:50:28 م (QP5 v5.185.11230.41888) */
  884. SELECT A.*,
  885.        O.LASTSERVICEDATE,
  886.        J.INJURYDATE,
  887.        M.SESSIONDATE,
  888.        NVL (M.SOCINSNUMBER, J.SOCINSNUMBER) AS SOCINSNUMBER,
  889.        HAVEERROR.CASEID
  890.   FROM (  SELECT H.FIELDOFFICE,
  891.                  H.INVOICESTATUS,
  892.                  TH.TRMTSERVICEHDRID,
  893.                  TH.INJURYID,
  894.                  TH.DISASSMTID,
  895.                  TH.INVOICEDETAILSID,
  896.                  MAX (TD.TRMTDATE) MAXDATE
  897.             FROM T_REGHOSPINVOICEHDR H
  898.                  LEFT JOIN T_REGHOSPINVOICEDET D
  899.                     ON D.INVOICEHEADERID = H.INVOICEHEADERID
  900.                  LEFT JOIN T_TRMTSERVICESHDR TH
  901.                     ON TH.INVOICEDETAILSID = D.INVOICEDETAILSID
  902.                  LEFT JOIN T_TRMTSERVICESDET TD
  903.                     ON TD.TRMTSERVICEHDRID = TH.TRMTSERVICEHDRID
  904.            WHERE     H.BATCHPROCESSED IS NOT NULL
  905.                  AND TD.TRMTSRVCWRKFLOID IS NULL
  906.                  AND TH.TRMTSERVICEHDRID IS NOT NULL
  907.                  AND H.HOSPITALCODE = ?
  908.                  AND H.INVOICESTATUS <> 1004
  909.                  AND TO_CHAR (H.STARTDATE, 'MM') = ?
  910.                  AND TO_CHAR (H.STARTDATE, 'YYYY') = ?
  911.         GROUP BY H.FIELDOFFICE,
  912.                  H.INVOICESTATUS,
  913.                  TH.TRMTSERVICEHDRID,
  914.                  TH.INJURYID,
  915.                  TH.DISASSMTID,
  916.                  TH.INVOICEDETAILSID) A
  917.        LEFT JOIN (SELECT DISTINCT INJURYID, O.LASTSERVICEDATE
  918.                     FROM T_OHSICKLEAVE O
  919.                    WHERE     O.HOSPITALCODE = ?
  920.                          AND O.MONTH = ?
  921.                          AND O.YEAR = ?
  922.                          AND O.STATUS = ?) O
  923.           ON A.INJURYID = O.INJURYID
  924.        LEFT JOIN T_INJURY J
  925.           ON A.INJURYID = J.INJURYID
  926.        LEFT JOIN T_MBAPPOINTMENT M
  927.           ON A.DISASSMTID = M.SCHEDULEID
  928.        LEFT JOIN (SELECT DISTINCT
  929.                          SOCINSNUMBER, SUBSTR (OHCASEID, 2) AS CASEID
  930.                     FROM T_REGHOSPINVOICEFILE
  931.                    WHERE     FILEID IN
  932.                                 (SELECT FILEUPLOADINFOID
  933.                                    FROM T_FILEUPLOADINFO F
  934.                                   WHERE     F.FILETYPE = 1121
  935.                                         AND F.MAPPINGKEY = ?
  936.                                         AND F.MONTH = ?
  937.                                         AND F.YEAR = ?
  938.                                         AND F.FILESTATUS NOT IN
  939.                                                (1001, 1002, 1005))
  940.                          AND TRMTSERVICEDETID IS NULL
  941.                          AND TRIM (ERRORCODE) NOT IN
  942.                                 ('OHZ_022_ERR_002',
  943.                                  'OHZ_022_ERR_003',
  944.                                  'OHZ_022_ERR_005',
  945.                                  'OHZ_022_ERR_006',
  946.                                  'OHZ_022_ERR_015',
  947.                                  'OHZ_022_ERR_070',
  948.                                  'OHZ_022_ERR_072',
  949.                                  'OHZ_022_ERR_073')) HAVEERROR
  950.           ON HAVEERROR.CASEID = NVL (M.SCHEDULEID, J.INJURYID)
  951.  
  952.  3#
  953.  
  954. /* Formatted on 21/12/16 02:50:32 م (QP5 v5.185.11230.41888) */
  955.   SELECT *
  956.     FROM    T_TRMTSERVICESHDR TH
  957.          LEFT JOIN
  958.             T_TRMTSERVICESDET TD
  959.          ON TD.TRMTSERVICEHDRID = TH.TRMTSERVICEHDRID
  960.    WHERE     TH.TRMTSERVICEHDRID = ?
  961.          AND TD.TRMTSRVCWRKFLOID IS NULL
  962.          AND TD.TRMTSRVCSTATUS IN (?, ?)
  963. ORDER BY NVL (TD.SFDACODE, TD.ICD10TRMTDIAGNOSISCODE), TD.TRMTDATE ASC
  964.  
  965.  
  966.  4#
  967.  
  968. /* Formatted on 21/12/16 02:50:36 م (QP5 v5.185.11230.41888) */
  969. SELECT TD.TRMTSERVICEDETID
  970.   FROM    T_TRMTSERVICESHDR TH
  971.        JOIN
  972.           T_TRMTSERVICESDET TD
  973.        ON     TH.TRMTSERVICEHDRID = TD.TRMTSERVICEHDRID
  974.           AND (TH.INJURYID = ?)
  975.           AND TD.TRMTSRVCSTATUS <> ?
  976.           AND (TD.ICD10TRMTDIAGNOSISCODE = ? OR TD.SFDACODE = ?)
  977.           AND TD.TRMTDATE = ?
  978.           AND TD.TRMTTIMEHR = ?
  979.           AND TD.TRMTTIMEMIN = ?
  980.           AND TD.TRMTTIMEAMPM = ?
  981.           AND TRMTSERVICEDETID <> ?
  982.  5#  
  983.  
  984. /* Formatted on 21/12/16 02:50:38 م (QP5 v5.185.11230.41888) */
  985. SELECT TD.TRMTSERVICEDETID
  986.   FROM    T_TRMTSERVICESHDR TH
  987.        JOIN
  988.           T_TRMTSERVICESDET TD
  989.        ON     TH.TRMTSERVICEHDRID = TD.TRMTSERVICEHDRID
  990.           AND (TH.DISASSMTID = ?)
  991.           AND TD.TRMTSRVCSTATUS <> ?
  992.           AND (TD.ICD10TRMTDIAGNOSISCODE = ? OR TD.SFDACODE = ?)
  993.           AND TD.TRMTDATE = ?
  994.           AND TD.TRMTTIMEHR = ?
  995.           AND TD.TRMTTIMEMIN = ?
  996.           AND TD.TRMTTIMEAMPM = ?
  997.           AND TRMTSERVICEDETID <> ?
  998.  6#
  999.  
  1000. /* Formatted on 21/12/16 02:50:41 م (QP5 v5.185.11230.41888) */
  1001. UPDATE T_TRMTSERVICESDET
  1002.    SET TRMTSRVCSTATUS = ?,
  1003.        TRMTSRVCWRKFLOID = ?,
  1004.        LASTMODIFIEDBY = ?,
  1005.        LASTMODIFIEDTIMESTAMP = ?
  1006.  WHERE TRMTSERVICEDETID = ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement