bug fix
This commit is contained in:
parent
392e346e7f
commit
cee87ca6b2
|
|
@ -383,50 +383,68 @@ public class BeetlExt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取YYYY-MM-DD HH:mm:ss格式
|
* 获取YYYY-MM-DD HH:mm:ss格式
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getTime() {
|
public String getTime() {
|
||||||
return DateKit.getTime();
|
return DateKit.getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取YYYY-MM-DD HH:mm:ss.SSS格式
|
* 获取YYYY-MM-DD HH:mm:ss.SSS格式
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getMsTime() {
|
public String getMsTime() {
|
||||||
return DateKit.getMsTime();
|
return DateKit.getMsTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取YYYY-MM-DD格式
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getDay() {
|
|
||||||
return DateKit.getDay();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 格式化日期
|
* 获取YYYY-MM-DD格式
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String formatTime(String pattern) {
|
public String getDay() {
|
||||||
return DateKit.format(new Date(), pattern);
|
return DateKit.getDay();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 格式化日期
|
* 格式化日期
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String formatTime(String dateStr, String pattern) {
|
public String formatNow(String pattern) {
|
||||||
return DateKit.format(DateTimeKit.parse(dateStr).toDate(), pattern);
|
return DateKit.format(new Date(), pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化日期
|
||||||
|
* @param date yyyy-MM-dd HH:mm:ss
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String formatTime(Date date) {
|
||||||
|
if(isEmpty(date)) return "";
|
||||||
|
return DateKit.format(date, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化日期
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String formatTime(Date date, String pattern) {
|
||||||
|
return DateKit.format(date, pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化日期
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String formatTime(String dateStr, String pattern) {
|
||||||
|
return DateKit.format(DateTimeKit.parse(dateStr).toDate(), pattern);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取grid右键菜单
|
* 获取grid右键菜单
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,5 @@
|
||||||
package com.smallchill.system.controller;
|
package com.smallchill.system.controller;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.beetl.sql.core.JavaType;
|
|
||||||
import org.beetl.sql.core.SQLManager;
|
|
||||||
import org.beetl.sql.core.annotatoin.Table;
|
|
||||||
import org.beetl.sql.core.db.ColDesc;
|
|
||||||
import org.beetl.sql.core.db.TableDesc;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
|
|
||||||
import com.smallchill.core.annotation.Json;
|
import com.smallchill.core.annotation.Json;
|
||||||
import com.smallchill.core.base.controller.CurdController;
|
import com.smallchill.core.base.controller.CurdController;
|
||||||
import com.smallchill.core.beetl.BeetlMaker;
|
import com.smallchill.core.beetl.BeetlMaker;
|
||||||
|
|
@ -33,6 +15,17 @@ import com.smallchill.core.toolbox.kit.StrKit;
|
||||||
import com.smallchill.core.toolbox.support.Convert;
|
import com.smallchill.core.toolbox.support.Convert;
|
||||||
import com.smallchill.system.meta.factory.GenerateFactory;
|
import com.smallchill.system.meta.factory.GenerateFactory;
|
||||||
import com.smallchill.system.model.Generate;
|
import com.smallchill.system.model.Generate;
|
||||||
|
import org.beetl.sql.core.JavaType;
|
||||||
|
import org.beetl.sql.core.SQLManager;
|
||||||
|
import org.beetl.sql.core.annotatoin.Table;
|
||||||
|
import org.beetl.sql.core.db.ColDesc;
|
||||||
|
import org.beetl.sql.core.db.TableDesc;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/generate")
|
@RequestMapping("/generate")
|
||||||
|
|
@ -205,7 +198,8 @@ public class GenerateController extends CurdController<Generate> {
|
||||||
|
|
||||||
private void setParasAttr(String table, Map<String, Object> ps) {
|
private void setParasAttr(String table, Map<String, Object> ps) {
|
||||||
SQLManager sm = Blade.dao();
|
SQLManager sm = Blade.dao();
|
||||||
final TableDesc tableDesc = sm.getMetaDataManager().getTable(table);
|
TableDesc tableDesc = sm.getMetaDataManager().getTable(table);
|
||||||
|
final Set<String> idNames = tableDesc.getIdNames();
|
||||||
Set<String> cols = tableDesc.getCols();
|
Set<String> cols = tableDesc.getCols();
|
||||||
List<Map<String, Object>> attrs = new ArrayList<>();
|
List<Map<String, Object>> attrs = new ArrayList<>();
|
||||||
boolean tempDouble = false;
|
boolean tempDouble = false;
|
||||||
|
|
@ -253,7 +247,7 @@ public class GenerateController extends CurdController<Generate> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int score(ColDesc desc){
|
private int score(ColDesc desc){
|
||||||
if(tableDesc.getIdNames().contains(desc.colName)) {
|
if(idNames.contains(desc.colName)) {
|
||||||
return 99;
|
return 99;
|
||||||
}else if(JavaType.isInteger(desc.sqlType)) {
|
}else if(JavaType.isInteger(desc.sqlType)) {
|
||||||
return 9;
|
return 9;
|
||||||
|
|
|
||||||
|
|
@ -144,15 +144,13 @@
|
||||||
layer_alert("读取数据失败!", "error");
|
layer_alert("读取数据失败!", "error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$("input, textarea").bind("focus", function(){
|
||||||
|
var _name = $(this).attr("name").replace("token_", "");
|
||||||
|
$(this).attr("name", _name);
|
||||||
|
$("#form_token").val(1);
|
||||||
|
});
|
||||||
for(var x in _model){
|
for(var x in _model){
|
||||||
var $x = $("#_" + x);
|
var $x = $("#_" + x);
|
||||||
if($x.is("input") || $x.is("textarea")){
|
|
||||||
$x.bind("focus", function(){
|
|
||||||
var _name = $(this).attr("name").replace("token_", "");
|
|
||||||
$(this).attr("name", _name);
|
|
||||||
$("#form_token").val(1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_model[x] != null && $x.attr("data-type") == "image"){
|
if(_model[x] != null && $x.attr("data-type") == "image"){
|
||||||
var src = $("#_"+x).attr("data-auto") + _model[x];
|
var src = $("#_"+x).attr("data-auto") + _model[x];
|
||||||
|
|
|
||||||
|
|
@ -145,15 +145,13 @@
|
||||||
layer_alert("读取数据失败!", "error");
|
layer_alert("读取数据失败!", "error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$("input, textarea").bind("focus", function(){
|
||||||
|
var _name = $(this).attr("name").replace("token_", "");
|
||||||
|
$(this).attr("name", _name);
|
||||||
|
$("#form_token").val(1);
|
||||||
|
});
|
||||||
for(var x in _model){
|
for(var x in _model){
|
||||||
var $x = $("#_" + x);
|
var $x = $("#_" + x);
|
||||||
if($x.is("input") || $x.is("textarea")){
|
|
||||||
$x.bind("focus", function(){
|
|
||||||
var _name = $(this).attr("name").replace("token_", "");
|
|
||||||
$(this).attr("name", _name);
|
|
||||||
$("#form_token").val(1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_model[x] != null && $x.attr("data-type") == "image"){
|
if(_model[x] != null && $x.attr("data-type") == "image"){
|
||||||
var src = $("#_"+x).attr("data-auto") + _model[x];
|
var src = $("#_"+x).attr("data-auto") + _model[x];
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<label class="col-sm-2 control-label no-padding-right" > 出生日期 </label>
|
<label class="col-sm-2 control-label no-padding-right" > 出生日期 </label>
|
||||||
|
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="text" id="birthday" name="BLADE_USER.BIRTHDAY" value="${user.birthday!}" placeholder="请选择日期" class="form-control" />
|
<input type="text" id="birthday" name="BLADE_USER.BIRTHDAY" value="${func.formatTime(user.birthday!)}" placeholder="请选择日期" class="form-control" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<label class="col-sm-2 control-label no-padding-right" > 出生日期 </label>
|
<label class="col-sm-2 control-label no-padding-right" > 出生日期 </label>
|
||||||
|
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="text" id="birthday" name="BLADE_USER.BIRTHDAY" disabled value="${user.birthday!}" placeholder="暂无日期" data-date-format="yyyy-mm-dd" class="form-control" />
|
<input type="text" id="birthday" name="BLADE_USER.BIRTHDAY" disabled value="${func.formatTime(user.birthday!)}" placeholder="暂无日期" data-date-format="yyyy-mm-dd" class="form-control" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user