工作上常用的tips
2017-09-21 14:43
211 查看
Date bDate = checkReportDto.getSearchBeginDate(); Date eDate = checkReportDto.getSearchEndDate(); if (bDate==null) { Calendar calendar = Calendar.getInstance();//是获取一个 Calendar对象并可以进行时间的计算 Date date = new Date(); //是创建了一个date对象,默认是utc格式的 calendar.setTime(date); calendar.add(Calendar.YEAR, -1);//把时间前推一年 bDate =calendar.getTime();//这里的bDate实际上就是获取的是去年的这个时候 } if (eDate==null) { eDate = new Date(); } if(bDate!=null) { if(eDate!=null){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String bs = sdf.format(bDate);//时间转格式 String es = sdf.format(eDate); hqlStr.append("and (t.check_date between to_date('"+bs+"','yyyy-MM-dd') and to_date('"+es+"','yyyy-MM-dd')) "); } } hqlStr.append(" order by t.check_date desc ");
String bs = sdf.format(bDate); //时间转格式
String es = sdf.format(eDate);
这里时间转格式是很重要的,不然在本地能运行,放到服务器就会报错:
调用InsReportBlh.list发生异常PreparedStatementCallback; SQL [ select count(t.id) from cohealth.t_ins_report t, cohealth.t_family_member f where t.familymember_id=f.familymember_id and t.main_idnumber=? and t.mainchild_flag=? and (t.ins_date between ? and ?) ]; ORA-01843: not a valid month
; nested exception is java.sql.SQLException: ORA-01843: not a valid month
正则写法
var reg =/^([1-9]\d{0,2})(\.\d{1,1})?$/; if (!reg.test(weightValue)) { if(Number(wei 95ea ghtValue) > 999){ alertMessage01("您已超级肥胖,改减肥了!"); }else if(Number(weightValue) > 200){ alertMessage01("您已很肥胖,改减肥了!"); }else{ alertMessage01("体重填写有误,只能输入大于0的正数或带一位小数的正数"); } return; }
Dialog设置样式
function alertMessage01(html){ $("#messageHtml").html('<b>'+html+'</b>'); var dialog = $("#dialog-message").removeClass('hide').dialog({ resizable: false, modal: true, position: { using:function(pos){ console.log(pos) var topOffset = $(this).css(pos).offset().top; if (topOffset = 0||topOffset>0) { $(this).css('top', 100); //设置样式 ! } }}, title: "<div class='widget-header widget-header-small'><h4 class='smaller'><i class='ace-icon fa fa-rss orange'></i> 消息提示</h4></div>", title_html: true, });
关于接口对接:
1.在application.properties文件中添加接口的服务器地址
2.在后台文件中引入所需要的类文件的地址
3.新建一个vo类(要引入),放从接口传来的数据并且在dto中进行封装
4.请求接口
(如果是单独的数据或者只去某条数据,就不用这么麻烦,还写循环啥的,就直接从response里面取然后set进vo中)
5.action返回
相关文章推荐
- Eclipse在工作中的一些常用设置及快捷键整理
- Java工作利器之常用工具类(一)——数字工具类-数字转汉字
- 工作太忙,好久没来啦,记个常用的角本函数
- 商务英语:外企工作邮件常用100句
- 实际工作中,Eclipse常用的快捷键
- adb常用的命令,增加工作效率
- vim工作中常用的操作
- 关于GIT的常用TIPS
- 工作中常用的工具
- 工作常用第三方框架
- 工作中常用快捷键
- 工作常用的linux/mysql/php/工具命令
- 工作中常用的gson解析
- 工作常用工具
- 工作中常用Linux命令总结
- Linux常用命令-----工作常用的
- Excel工作常用(一)-生成序列与删除空行
- Android studio常用设置-鼠标悬停时显示tips帮助
- 工作中常用到的linux命令
- 工作所用的git常用命令