徐神武专业JAVA笔记

//转发和重定向
super.getRequest().getRequestDispatcher("/Page/InvestDataPage/docEventManage/docEventList.html").forward(super.getRequest(), super.getResponse());
super.getResponse().sendRedirect("/Manager/index.jsp")
request.getRequestDispatcher(“new.jsp”).forward(request, response);//转发到new.jsp
response.sendRedirect(“new.jsp”);//重定向到new.jsp
//Ajax
Public.PostAjax(jsondata, urlstr,callbackSuccess);Public.PostAjax(jsondata, urlstr,function callbackSuccess(result){ });

//关闭窗口
function closeWindow(){
this.window.close();
}
//返回上级页面,返回之前的页面
οnclick=“javascript:history.go(-1)”
//刷新页面
window.location.reload() ;
//返回上级页面,返回之前的页面 并刷新页面
返回上一页重载页面,本地刷新

//导出功能修改
rule.setSheetName(“平均利差”);
ExcelHelper eh = new ExcelHelper();
inputStream = eh.writeExcel(result, rule);
ExcelUtil.DownExcle(super.getResponse(), downloadFileName, inputStream);

//数据库开启表回滚
alter table TSYS_ROLE enable row movement;
//数据库表回滚
flashback table TSYS_ROLE to timestamp to_timestamp(‘2019-10-27 05:00:00’,‘yyyy-mm-dd HH24:MI:SS’);
//添加字段
alter table “INTR”.“TINFO_CCED” add (“HOLD_DATE” VARCHAR2(10 BYTE))
//添加备注
COMMENT ON COLUMN “INTR”.“TINFO_CCED”.“HOLD_DATE” IS ‘持仓截止日期’;

//登录页
http://localhost:9001/Page/loginForCas.html?account=admin
//日期工具类 DateUtils
//读取配置文件方法
public static String getProperty(String cls, String name)
{
Properties p = init(cls);;
if (p != null)
{
return p.getProperty(name);
}
return null;
}

List tcorpinfos = dataServiceInterface.getBaseService(Tcorpinfo.class).selectParam(map);

//参数接收 @RequestBody List list;
public String testGet1(@RequestParam(“paramName”) String paramName)
public String testGet2_1(@PathVariable String param1,@PathVariable String param2)

//参数JS对象数组
list.push({bondName: “李四”,bondCode: “123”,bondType: “李四”,holdAmt: “123”,holdDate: “李四”,issuerName: “123”});
list.push({bondName: “张三”,bondCode: “123”,bondType: “李四”,holdAmt: “123”,holdDate: “李四”,issuerName: “123”});

//JS对象与JSON字符串转换
JSON.stringify(list) //将对象序列化成JSON字符串
JSON.parse(list) //将字符串还原成对象

//不登录也能访问注解
@LoginCheck(check=false)

/TinfoCcedController2/insertTinfoCced /Page/Event/Sentiment/Sentiment3.html?menuid=112029//资管接口
InterfRemote.java InterfServiceImpl.java WorkFlowServiceImpl.java eureka TestRemote TestLoginController

“/Page/workflow/workViewLook/strategy.html”; $.Jalert(“请求数据出错!”); Public.alert1(“提示”,result.msg);

//页面宽度自动适应
$(window).resize(function(){
var grid_selector = “#grid-table”;
( g r i d s e l e c t o r ) . s e t G r i d W i d t h ( (grid_selector).setGridWidth( (gridselector).setGridWidth(("#RightCol").width());
});

//修改前基本信息TAB标签切换
$("#tabs li").bind(“click”, function () {
var index = $(this).index();
var divs = $("#tabs-body > div");
$(this).parent().children(“li”).attr(“class”, “tab-nav”);//将所有选项置为未选中
$(this).attr(“class”, “tab-nav-action”); //设置当前选中项为选中样式
divs.hide();//隐藏所有选中项内容
divs.eq(index).show(); //显示选中项对应内容
});

//作用是弹出一个模态对话框,mode:true,其实就是后面不能回到后面的父页面,除非关闭当前的对话框。
//在对话框后面加了一个OK关闭按钮
$(function() {
$( “#dialog-message” ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( “close” );
}
}
});
});

//加了两个按钮,一个确认,一个取消,可以分别做一些操作,其实也不限于这两个按钮,
//如果需要的话可以在下面添加任意多个按钮,实现任意多的功能
$(function() {
$( “#dialog-confirm” ).dialog({
resizable: false,
height: “auto”,
width: 400,
modal: true,
buttons: {
“Delete all items”: function() {
            //这里可以加入一些操作
$( this ).dialog( “close” );
},
Cancel: function() {
$( this ).dialog( “close” );
}
}
});
});

var dialog = $("#dialog-addIndex").removeClass(‘hide’).dialog({
modal: true,
width:650,
height:400,
title: “

新增指标
”,
title_html: true,
buttons: [{
text: “保存”,
“class”: “btn btn-primary btn-xs”,
click: function(){
debugger;
saveFinancialIndicators(this.id);
}
}, {
text: “取消”,
“class”: “btn btn-xs”,
click: function(){
$(this).dialog(“close”);
}
}]
});

//每过0.1秒访问(执行)一次initUploadify方法;
window.setTimeout(initUploadify,100);

//输出每个 li 元素的文本:
$(“button”).click(function(){
KaTeX parse error: Expected '}', got 'EOF' at end of input: …tion(){ alert((this).text())
});
});

var data1 = $("#form").serialize(); //序列化参数拼接的字符串
         
var data2 = $("#form").serializeArray(); //序列化数组
         
var data3 = $("#form").serializeJson(); //序列化json

//后台返回弹框 super.write(“”);
//后台返回弹框
Public.confirm(“提示”,result.msg,function (){
window.close();
});

//JQgred 按条件设置展示内容颜色
function formatterCvalue2(cellvalue, options, rowObject){
if(rowObject.o_CODE==qCode){
var label=""+cellvalue+"";
return label;
}else{
return cellvalue;
}
}

//JQgred from表单编辑不跳转页面设置 editurl:‘clientArray’,(防止敲回车报错);
//去掉空格 . t r i m ( .trim( .trim(("#BaseQuarter").val());

//不可编辑, 只读
disabled=“disabled” readonly=“readonly”

//表单中文参数乱码处理
if(oRegion != null && oRegion != “”){
oRegion = java.net.URLDecoder.decode(oRegion, “UTF-8”);
}

//读取pdf文件
super.getResponse().setContentType(“application/pdf”);
File file = null;
try{
String strPdfPath = fileName;
file = new File(strPdfPath);
if(file.exists()){
DataOutputStream temps = new DataOutputStream(super.getResponse().getOutputStream());
DataInputStream in = new DataInputStream(new FileInputStream(strPdfPath));
byte[] b = new byte[2048];
while((in.read(b))!=-1){
temps.write(b);
temps.flush();
}
in.close();
temps.flush();
}else{
System.out.print(strPdfPath + “文件不存在”);
}
}catch(Exception e){
System.out.println(e.getMessage());
}finally{
if(file!=null&&“Y”.equals(enabled)) file.delete();
}

//获取系统参数;
ISysParamService sysParamService=(ISysParamService)SpringContextUtils.getBean(“sysParamServiceImpl”);
sysParamService.selectValueByKey(“defaultIndus”);

//采用BaseService类操作数据库数据,实现增删改查;
DataServiceInterface dataServiceInterface; dataServiceInterface.getBaseService(TPoolhld.class).deleteParam(param1);

//错误提示
e.printStackTrace();
//判断字符串非空
StringUtils.isNotBlank(str);

//根据2个参数获取日期(年份和季度报,半年报,年报);
String BaseDate = DateTimeConvert.convertYearQuarterToEndDateString(BaseYear, BaseQuarter);

//oracle数据库导入dmp
imp intr/ibms@127.0.0.1:1521/zjnpdb file=“D:\shuju.dmp” ignore=y full = y;

//InputStreamReader+BufferedReader读取字符串 , InputStreamReader类是从字节流到字符流的桥梁

//IO流逐行读取文件内容
private static String readString(){
//int len=0;
StringBuffer str=new StringBuffer("");
File file=new File(FILE_IN);
try {
FileInputStream is=new FileInputStream(file);
InputStreamReader isr= new InputStreamReader(is);
BufferedReader in= new BufferedReader(isr);
String line=null;
while( (line=in.readLine())!=null ){
//处理换行符的问题,部分文件不需要处理换行符问题
//if(len != 0){
//str.append("\r\n"+line);
//}else{
str.append(line);
//}
//len++;
}
in.close();
is.close();
} catch (IOException e) {
e.printStackTrace();
}
return str.toString();
}

//服务器操作 su - oracle; ls; sqlplus / as sysdba; select * from dba-users

//赋DBA权限 grant dba to 用户名; //删除DBA权限 revoke dba from user_Name;

//神SQL //查询所有表记录数;
select ‘select ‘’’||table_name||’’’,count(*) from ‘||table_name ||’ union ’ from user_tables;

//jar包赋权限 chmod 775 ratingweb-0.0.1-SNAPSHOT.jar 查看进程 ps -ef|grep java 杀死进程 kill -9 进程号

//本地启动jar包 java -jar ratingweb.jar
nohup java -jar -Xmx2048m -Xms2048m ratingweb-0.0.1-SNAPSHOT.jar -Dport=9001 -Daddress=172.32.6.119 &

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值