b6d3f853de643a7dce0d2c7237186d3f32b95b4b.svn-base 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package xin.glue.ui.B.common;
  2. import java.util.List;
  3. import com.posdata.glue.context.PosContext;
  4. import com.posdata.glue.dao.PosGenericDao;
  5. import com.posdata.glue.dao.PosJdbcDao;
  6. import com.posdata.glue.dao.manager.PosQueryDefinition;
  7. import com.posdata.glue.dao.manager.PosQueryManagerImpl;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. public class SaveModifyHistory
  10. {
  11. public static boolean writeLog(PosGenericDao dao, String interfaceID , String status , String queryId
  12. , List params , String pgmID ,String userName )
  13. {
  14. try {
  15. PosQueryManagerImpl queryManager = (PosQueryManagerImpl)PosContext.getBeanFactory().getBeanObject("queryManager");
  16. PosQueryDefinition query = queryManager.getQueryDefinition(queryId);
  17. PosParameter param = new PosParameter();
  18. String paramValue = "";
  19. param.setValueParamter(0, interfaceID);//界面ID
  20. param.setValueParamter(1, status);//U、D
  21. param.setValueParamter(2, query.getQueryStatement());//执行SQL
  22. int count = params.size();
  23. for (int i=0; i<count; i++)
  24. paramValue += "P" + i + ": " + params.get(i) + " ";
  25. param.setValueParamter(3, paramValue);//参数
  26. param.setValueParamter(4, pgmID);//程序ID
  27. param.setValueParamter(5, userName);//操作人
  28. dao.insert("UIB.COMMON_01.INSERT", param);
  29. } catch (Exception e) {
  30. e.printStackTrace();
  31. return false;
  32. }
  33. return true;
  34. }
  35. }