bug fix
This commit is contained in:
parent
392e346e7f
commit
cee87ca6b2
|
|
@ -383,50 +383,68 @@ public class BeetlExt {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取YYYY-MM-DD HH:mm:ss格式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getTime() {
|
||||
return DateKit.getTime();
|
||||
}
|
||||
/**
|
||||
* 获取YYYY-MM-DD HH:mm:ss格式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getTime() {
|
||||
return DateKit.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取YYYY-MM-DD HH:mm:ss.SSS格式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getMsTime() {
|
||||
return DateKit.getMsTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取YYYY-MM-DD格式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDay() {
|
||||
return DateKit.getDay();
|
||||
}
|
||||
/**
|
||||
* 获取YYYY-MM-DD HH:mm:ss.SSS格式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getMsTime() {
|
||||
return DateKit.getMsTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化日期
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String formatTime(String pattern) {
|
||||
return DateKit.format(new Date(), pattern);
|
||||
}
|
||||
/**
|
||||
* 获取YYYY-MM-DD格式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDay() {
|
||||
return DateKit.getDay();
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化日期
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String formatTime(String dateStr, String pattern) {
|
||||
return DateKit.format(DateTimeKit.parse(dateStr).toDate(), pattern);
|
||||
}
|
||||
/**
|
||||
* 格式化日期
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String formatNow(String 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右键菜单
|
||||
|
|
|
|||
|
|
@ -1,23 +1,5 @@
|
|||
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.base.controller.CurdController;
|
||||
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.system.meta.factory.GenerateFactory;
|
||||
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
|
||||
@RequestMapping("/generate")
|
||||
|
|
@ -205,7 +198,8 @@ public class GenerateController extends CurdController<Generate> {
|
|||
|
||||
private void setParasAttr(String table, Map<String, Object> ps) {
|
||||
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();
|
||||
List<Map<String, Object>> attrs = new ArrayList<>();
|
||||
boolean tempDouble = false;
|
||||
|
|
@ -253,7 +247,7 @@ public class GenerateController extends CurdController<Generate> {
|
|||
}
|
||||
|
||||
private int score(ColDesc desc){
|
||||
if(tableDesc.getIdNames().contains(desc.colName)) {
|
||||
if(idNames.contains(desc.colName)) {
|
||||
return 99;
|
||||
}else if(JavaType.isInteger(desc.sqlType)) {
|
||||
return 9;
|
||||
|
|
|
|||
|
|
@ -144,15 +144,13 @@
|
|||
layer_alert("读取数据失败!", "error");
|
||||
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){
|
||||
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"){
|
||||
var src = $("#_"+x).attr("data-auto") + _model[x];
|
||||
|
|
|
|||
|
|
@ -145,15 +145,13 @@
|
|||
layer_alert("读取数据失败!", "error");
|
||||
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){
|
||||
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"){
|
||||
var src = $("#_"+x).attr("data-auto") + _model[x];
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<label class="col-sm-2 control-label no-padding-right" > 出生日期 </label>
|
||||
|
||||
<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>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<label class="col-sm-2 control-label no-padding-right" > 出生日期 </label>
|
||||
|
||||
<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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user