Commit 5c31b139 authored by 雍欢's avatar 雍欢

将表单设计器前端资源整合进平台

parent 4a3df56d
......@@ -251,8 +251,10 @@ public class BuildPageDetailFile implements BuildFilerInter {
//生成js文件
String detailTableName=paraDetail.getTableName();
paraDetail.setTableName(detailTableName.toLowerCase());
paraDetail.setBtnNames(new String[]{"新增行","删除行","保存行","启用行","禁用行"});
paraDetail.setBtnMethodNames(new String[]{"addRow","deleteRow","saveRow","enableRow","disableRow"});
//paraDetail.setBtnNames(new String[]{"新增行","删除行","保存行","启用行","禁用行"});
//paraDetail.setBtnMethodNames(new String[]{"addRow","deleteRow","saveRow","enableRow","disableRow"});
paraDetail.setBtnNames(new String[]{"新增行","删除行","保存行"});
paraDetail.setBtnMethodNames(new String[]{"addRow","deleteRow","saveRow"});
// BuildPageJSFile buildStringBuffer=new BuildPageJSFile(paraDetail);
if (buildPageJSFile==null){
buildPageJSFile=new BuildPageJSFile();
......
......@@ -174,7 +174,7 @@ public class BuildPageJSFile implements BuildFilerInter {
sb.append(" }");
sb.append(Constant.SYSMBOL_LINE);
if (isDetail){ //是明细页面的js
if (isDetail){ //是明细页面的js 添加字段效验的
Utils.composeDetailCheckFunction(paraForm,mainTableFields,sb);
}
......@@ -457,7 +457,11 @@ public class BuildPageJSFile implements BuildFilerInter {
sb.append("},");
}
sb.append("{display: '状态', name: 'status', width: 50, minWidth: 40, align:\"left\",")
.append("render: function (item) {return UICtrl.getStatusInfo(item.status);}}");
.append("render: function (item) { ")
.append(" if ($('#procId').val()!=\"\") { ")
.append(" return UICtrl.getApproveStatusInfo(item.status);")
.append(" } else { ")
.append(" return UICtrl.getStatusInfo(item.status);} } }");
if (hideCols.size()>0){
sb.append(",");
}
......
......@@ -53,7 +53,7 @@ public class DeleteRowButtonResult implements ButtonTypeInter {
.append(" }");
sb.append(" if (ids!=''){")
.append(" param={ids:ids};")
.append(" $('#").append(btnAttr.getParentEntityName()).append("Form').ajaxSubmit({ ")
.append(" $('##submitForm').ajaxSubmit({ ")
.append(" url: web_app.name + (url),")
.append(" param:param, ")
.append(" success: function (data) {")
......
......@@ -48,7 +48,7 @@ public class SaveRowButtonResult implements ButtonTypeInter {
sb.append("?maiTab=").append(btnAttr.getParentEntityName())
.append("&subTab=").append(btnAttr.getEntityName())
.append("&formId='+"+"$(\"#formId\").val()")
.append("+'&id='+"+"$(\"#id\").val()");
.append("+'&mid='+"+"$(\"#id\").val()");
sb.append(";");
//sb.append(" if (id && id.length > 0) ");
......@@ -61,7 +61,8 @@ public class SaveRowButtonResult implements ButtonTypeInter {
sb.append(";");
*/
sb.append(" $('#").append(btnAttr.getParentEntityName()).append("Form').ajaxSubmit({ ")
// sb.append(" $('#").append(btnAttr.getParentEntityName()).append("Form').ajaxSubmit({ ")
sb.append(" $('#submitForm').ajaxSubmit({ ") //表单有流程 则formName只能是submitForm
.append(" url: web_app.name + (url),");
sb.append(" param:param, ");
sb.append(" success: function (data) {")
......@@ -69,16 +70,55 @@ public class SaveRowButtonResult implements ButtonTypeInter {
.append(" refreshFlag = true;")
//避免明细表修改后保存后提示 数据已经改变,关闭后数据丢失的提示
.append(" ").append(btnAttr.getEntityName()).append("GridManager.isDataChanged=false;")
.append(" if (data.result==\"success\") { ")
.append(" if (data.result==\"success\") { ");
//.append(" reload").append(Utils.toUpperCaseFirstOne(btnAttr.getEntityName())).append("Grid();")
.append(" }")
sb.append("var ids=data.backIDs; var bid=ids.split(',');")
.append("var rows = smsOrderDetailGridManager.rows;")
.append("for (var i = 0,r = rows.length-1; i < r; i++) {")
.append(" rows[i].id = bid[i];")
.append("} ")
.append(btnAttr.getEntityName()).append("GridManager.reRender();");
sb.append(" }")
// sb.append(" _self.close();");
.append(" }")
.append(" });")
.append(" return true;")
.append(" }");
.append(" } ");
sb.append(" ");
sb.append(Constant.SYSMBOL_LINE);
//如果是表单 带有流程 ,需要重新实现 保存主表的方法
sb.append("function doSave").append(Utils.toUpperCaseFirstOne(btnAttr.getParentEntityName())).append("(grid){");
sb.append(" var _self = this;");
sb.append(" var id = getId();");
if (btnAttr.getIsForm()==1){ //是表单生成器 则调用统一的添加方法
sb.append(" var url= '/dataManage/saveDataRecord.ajax';");
sb.append(" if (grid==1) { url+='?btntype=1'; } ");
sb.append(" $('#submitForm').ajaxSubmit({"); //发起流程 必须固定表单名称为submitForm
} else {
sb.append(" var url = '/").append(Utils.toLowerCaseFirstOne(btnAttr.getEntityName()))
.append("/save").append(Utils.toUpperCaseFirstOne(btnAttr.getEntityName())).append(".ajax';");
// sb.append(" $('#").append(Utils.toLowerCaseFirstOne(btnAttr.getEntityName())).append("Form').ajaxSubmit({");
sb.append(" $('#submitForm').ajaxSubmit({");
}
sb.append(" url: web_app.name +url,");
sb.append(" success: function (data) {");
sb.append(" $(\"#id\").val(data);");
sb.append(" if (grid&&grid!=\"\") {UICtrl.addGridRow(eval(grid),{id:''} );}");
//sb.append(" reload").append(Utils.toUpperCaseFirstOne(btnAttr.getEntityName())).append("Grid();");
//sb.append(" refreshFlag = true;");
//sb.append(" _self.close();");
sb.append(" }");
sb.append(" });");
sb.append(" }");
sb.append(Constant.SYSMBOL_LINE);
list.add(sb.toString());
// list.add(Integer.toString(fieldAttributes.getCurrCols()));
return list;
......
......@@ -31,10 +31,10 @@ public class UpdateButtonResult implements ButtonTypeInter {
sb.append(" ");
sb.append(" function doShowUpdateDialog(id) {");
Random random=new Random(3);
//Random random=new Random(3);
sb.append(" if ($('#procId').val()!=\"\") { ");
sb.append("UICtrl.addTabItem({ ");
sb.append(" tabid: 'edit").append(btnAttributes.getEntityName()).append(random.nextInt()).append("',");
sb.append(" tabid: 'edit").append(btnAttributes.getEntityName()).append("'+id,");
sb.append(" text: \"编辑"+btnAttributes.getFormName()+"\",");
sb.append(" url: web_app.name+'/dataManage/addDataRecord.job?procId='+$('#procId').val()");
sb.append("+'&formNo='+$('#formNo').val()");
......
......@@ -47,7 +47,7 @@ public interface DataRecordApplication {
Map<String, Object> queryDataRecordDetail(DataRecordQueryRequest queryRequest);
//保存明细数据
String saveDataRecordDetail(DataRecordQueryRequest queryRequest, List <String> hiddenFieldList,List<PubDataRecord> detailData);
Map<String,Object> saveDataRecordDetail(DataRecordQueryRequest queryRequest, List <String> hiddenFieldList,List<PubDataRecord> detailData);
//查询明细表中 检索SQL返回的隐藏字段
List<Map<String, Object>> queryHiddenFieldBySearchSQL(DataRecordQueryRequest queryRequest);
......
package com.huigou.uasp.data.application;
import com.huigou.uasp.bpm.managment.domain.model.ProcDefinition;
public interface DataRecordByFlowApplication {
String PROCESS_DEFINITION_KEY = "leave";
// Leave loadLeaveById(String id);
//在审批过程中 根据业务ID 获取流程定义信息(表单编号)
ProcDefinition getFormNoByBizid(String bizId);
}
......@@ -672,12 +672,13 @@ public class DataRecordApplicationImpl extends BaseApplication implements DataRe
//保存明细数据
@Override
@Transactional
public String saveDataRecordDetail(DataRecordQueryRequest queryRequest,List <String> hiddenFieldList,List<PubDataRecord> detailData) {
public Map<String,Object> saveDataRecordDetail(DataRecordQueryRequest queryRequest,List <String> hiddenFieldList,List<PubDataRecord> detailData) {
Assert.hasText(queryRequest.getId(), Constant.ID_NOT_BLANK);
// String mainTable = queryRequest.getMaiTab();//commonDataService.getTableName(queryRequest.getFormId());
String maiTable=CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE,queryRequest.getMaiTab()); //转成下划线
String subTable = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, queryRequest.getSubTab());//转成下划线
String sql = "",backStr="success";
String sql = "",backStr="success",backIDs="";
Map <String,Object>backmap=new HashMap<String,Object>();
try {
//查询字段名称
queryRequest.setMaiTab(maiTable); //带下划线
......@@ -693,7 +694,7 @@ public class DataRecordApplicationImpl extends BaseApplication implements DataRe
List<Map<String, Object>> datas = new ArrayList<Map<String, Object>>();
String parentId = queryRequest.getId();
String columns = Utils.getDataFields(fieldList, "fieldCode");
//System.out.println("parentId==============="+queryRequest.getId());
//添加隐藏的列(获取第一列的)
// Map <String,Object>hiddMap=detailData.get(0).getHiddField();//如果是第一行乌
//for (Map.Entry<String,Object> entry:hiddMap.entrySet()) {
......@@ -718,12 +719,13 @@ public class DataRecordApplicationImpl extends BaseApplication implements DataRe
String dbrq=this.commonUtilApplication.queryDBCurrentDate();
String id ="",back="";
boolean isAdded=false;
for (PubDataRecord detail : detailData) {
map = Utils.dataValueTransfer(fieldList, detail);
map.putAll(detail.getHiddField()); //添加隐藏列的值
datas = new ArrayList<Map<String, Object>>();
id = Utils.createUuid();
if ("2".equals(queryRequest.getSaveMode())){ //是存储过程方式 只将明细数据存入临时表
// back=callDetailProcedure(subTable,parentId,id);
map.put("parentId", parentId);
......@@ -750,30 +752,40 @@ public class DataRecordApplicationImpl extends BaseApplication implements DataRe
if (hiddenFieldList.contains("created_by_name")){
map.put("created_by_name", operator.getPersonMemberName());
}
//System.out.println("ss==detail=size======"+detailData.size()+"==="+detail.getId());
map.put("parent_id", parentId);
if (!StringUtils.isEmpty(detail.getId())) { //更新明细
id = detail.getId();
map.put("id", detail.getId());
datas.add(map);
sql = String.format("update %s set %s where id = ?", subTable, ComUtils.getMultiUpdateColumnSqlByList(fieldList, columns));
//System.out.println("ss==update detail======="+sql);
this.sqlExecutorDao.batchUpdate(sql, ComUtils.convertListMapToListObjects(datas, columns + ",id"));
} else { //新增明细
map.put("parent_id", parentId);
// map.put("parent_id", parentId);
map.put("status", 1);
map.put("id", id);
//System.out.println("ss==detail=add======"+parentId);
// datas.add(map);
sql = ComUtils.getMultiInsertSqlByList(subTable, map, columns + ",status,id,parent_id");
//System.out.println("ss==detail=add======"+sql);
this.sqlExecutorDao.executeUpdate(sql);
}
if (!"".equals(backIDs)){
backIDs+=",";
}
backIDs+=id;
}
}
backmap.put("backIDs",backIDs);
} catch (Exception ex) {
System.out.println("sql:="+sql);backStr="failure";
System.out.println("sql:="+sql);backStr="failure:"+ex.getMessage();
throw new ApplicationException("保存明细表数据错误:" + ex.getMessage());
// ex.printStackTrace();
}
return backStr;
backmap.put("result",backStr);
return backmap;
}
//如果配置了存储过程方式,调用明细表存储过程处理
......
......@@ -387,7 +387,8 @@ public class DataManageController extends CommonController {
SafFormslist form = this.safFormslistRepository.findOne(queryRequest.getFormId());
List<PubDataRecord> detailData = sdo.getList("detailData", PubDataRecord.class);
queryRequest.setId(sdo.getString("mid").toString());//主表ID
//System.out.println("saveRowDetail================="+detailData.get(0).getField1()+"=pid="+sdo.getString("mid").toString()+"==="+detailData.get(0).getId());
// 存在数据字典的 将值字段 转换到保存的字段
List<PubDataRecord> newDetailData = new ArrayList<PubDataRecord>();
List<Object> listold = sdo.getList("detailData");
......@@ -451,9 +452,10 @@ public class DataManageController extends CommonController {
}
Map<String, Object> data = new HashMap<String, Object>();
if (!StringUtils.isEmpty(sdo.getString("id"))) { //主表ID存在
String backStr = this.dataRecordApplication.saveDataRecordDetail(queryRequest, hiddenFieldList, newDetailData);
data.put("result", backStr);
if (!StringUtils.isEmpty(sdo.getString("id"))&&newDetailData.size()>0) { //主表ID存在
//System.out.println("s-====================="+newDetailData.size()+"=="+newDetailData.get(0).getId());
data = this.dataRecordApplication.saveDataRecordDetail(queryRequest, hiddenFieldList, newDetailData);
//data.put("result", backStr);
}
return toResult(data);
}
......
......@@ -60,7 +60,7 @@ public interface SafFormslistApplication {
/*
* 是否生成页面文件
*/
void needGenerateFile(SafFormsQueryRequest queryRequest);
String needGenerateFile(String formNo);
//查询单值的属性
// List<Map<String, Object>> queryDataRecordSingleFields(SafFormsQueryRequest queryRequest);
......
......@@ -19,6 +19,7 @@ import com.huigou.uasp.form.domain.query.SafFormsQueryRequest;
import com.huigou.uasp.form.repository.*;
import com.huigou.uasp.meta.domain.model.MetaData;
import com.huigou.uasp.meta.repository.MetaDataRepository;
import com.huigou.uasp.model.application.impl.DbTableService;
import com.huigou.uasp.model.domain.query.DbTablesQueryRequest;
import com.huigou.uasp.util.Constant;
import com.huigou.uasp.util.Utils;
......@@ -57,8 +58,8 @@ private FormButtonsRepository formButtonsRepository;
@Autowired
private FormAttributeRepository formAttributeRepository;
//@Autowired
//private ProcDefinitionRespository procDefinitionRespository;
@Autowired
private DbTableService dbTableService;
@Autowired
private MetaDataRepository metaDataRepository;
......@@ -760,12 +761,14 @@ public void deleteSyfFormsByIds(List<String> ids) {
}
return map;
}
/*
* 生成页面文件
* queryRequest:需要参数formNo
*/
public void needGenerateFile(SafFormsQueryRequest queryRequest) {
public String needGenerateFile(String formNo) {
String backStr="";
String webPath = this.getClass().getClassLoader().getResource("/").getPath();
webPath = webPath.substring(1, webPath.length() - 16);
webPath += pagePath;
......@@ -773,7 +776,7 @@ public void deleteSyfFormsByIds(List<String> ids) {
if (!file.exists()){
file.mkdir();
}
SafFormslist safFormslist=this.safFormslistRepository.findOne(queryRequest.getId());
SafFormslist safFormslist=this.safFormslistRepository.findByFormNo(formNo).get(0);
webPath+=safFormslist.getFormNo();
file=new File(webPath);
if (!file.exists()){
......@@ -781,8 +784,13 @@ public void deleteSyfFormsByIds(List<String> ids) {
}
String tableName=commonUtilApplication.getTablesByFormId(safFormslist.getId(),1);
tableName=tableName.split(",")[0]; //取第一个主表
queryRequest.setTableName(tableName.toUpperCase());
String pageName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, queryRequest.getTableName()); //转驼峰法
// queryRequest.setTableName(tableName.toUpperCase());
SafFormsQueryRequest queryRequest=new SafFormsQueryRequest();
queryRequest.setId(safFormslist.getId());
queryRequest.setTableName(tableName.toUpperCase());
queryRequest.setFormNo(formNo);
String pageName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL,tableName); //转驼峰法
String filePathName = webPath + "/" + pageName + ".jsp";
file = new File(filePathName);
......@@ -792,10 +800,14 @@ public void deleteSyfFormsByIds(List<String> ids) {
}
if (!file.exists()) {
StringBuffer sb = new StringBuffer("");
List <String>hiddenField=new ArrayList<String>(); //默认隐藏字段
// hiddenField.add("id");
// hiddenField.add("formId");
System.out.println("safFormslist.getPublished()==="+safFormslist.getPublished());
//主表添加流程所需要的字段
if (safFormslist.getPublished()==null||(safFormslist.getPublished()!=null&&safFormslist.getPublished()==0)) {
dbTableService.addProcessFields(tableName);
}
ParamFormVO paraForm = this.getFieldAttributes(queryRequest);
DbTablesQueryRequest dbqueryRequest=new DbTablesQueryRequest();
......@@ -834,16 +846,9 @@ public void deleteSyfFormsByIds(List<String> ids) {
paraForm.setBtnMethodNames(btnMethodNames);
}
// 查询当前表单是否挂流程
// String sql="select * from WF_PROCDEF t where t.node_kind_id='proc' and t.form_no='"+safFormslist.getFormNo()+"'";
// List<?> proclist=this.generalRepository.queryByNativeSql(sql,new HashMap<String, Object>());
/* ProcDefinition procDefinition = this.procDefinitionRespository.findOne(((root, query, cb) ->
cb.and(cb.equal(root.get("formNo"), safFormslist.getFormNo()),
cb.equal(root.get("nodeKindId"), "proc"))
));
if (procDefinition!=null){
paraForm.setProcDefinition(procDefinition);
}*/
try {
StringBuffer sb = new StringBuffer("");
BuildPageDetailFile buildPageDetailFile = new BuildPageDetailFile();
sb = buildPageDetailFile.generateContents(paraForm,tableName);
buildPageDetailFile.generateFile(filePathName, sb);
......@@ -855,17 +860,24 @@ public void deleteSyfFormsByIds(List<String> ids) {
buildTypeClass.getBuildClass(Constant.BUILD_PAGEJS).generateFile(paraForm,null);
Thread.sleep(1000);
if (safFormslist.getPublished()==null||(safFormslist.getPublished()!=null&&safFormslist.getPublished()==0)) {
safFormslist.setPublished(1);
this.safFormslistRepository.saveAndFlush(safFormslist);
}
} catch (Exception e) {
backStr=e.getMessage();
e.printStackTrace();
}
}
return backStr;
}
/**
* 拼装数据对象属性
*
* @param queryRequest
* @param queryRequest: formId、formNo 、tableName
* @return
*/
public ParamFormVO getFieldAttributes(SafFormsQueryRequest queryRequest) {
......
......@@ -192,6 +192,7 @@ public String previewEditForm(){
//加载表单编辑页面
public String loadSyfFormsDetail() {
String id = getSDO().getString("id");
this.putAttribute("openval",1);
if (StringUtils.isEmpty(id)) {
return forward("syfFormsDetail");
}else {
......@@ -875,10 +876,11 @@ public String queryTableProperty(){
String tableName=sdo.getString("tableName"); //主表名称
SafFormsQueryRequest formQueryRequest=sdo.toQueryRequest(SafFormsQueryRequest.class);;
// String pageName=CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL,tableName);
formQueryRequest.setTableName(tableName);
safFormsApplication.needGenerateFile(formQueryRequest);
return toResult(backStr);
//formQueryRequest.setTableName(tableName);
backStr=safFormsApplication.needGenerateFile(formQueryRequest.getFormNo());
Map <String,Object>map=new HashMap<String,Object>();
map.put("result",backStr);
return toResult(map);
}
//代码生成器-->组装参数对象
......
......@@ -102,6 +102,16 @@ public class SafFormslist extends AbstractEntity {
this.saveMode = saveMode;
}
@Column(name = "published", length = 10)
public Integer published;
public Integer getPublished() {
return published;
}
public void setPublished(Integer published) {
this.published = published;
}
/**
* 模板内容clob
*/
......
......@@ -61,7 +61,7 @@ public interface DbTablesApplication {
List<Map<String, Object>> querySelectedMetaLists(DbTablesQueryRequest queryRequest);
//模型发布
Map<String, Object> publishToModelRecordTable(DbTablesQueryRequest queryRequest);
Map<String, Object> publishToModelRecordTable(String tableId,String hasProcess);
/**
* 删除模型分类
......
......@@ -268,18 +268,25 @@ public class DbTablesApplicationImpl extends BaseApplication implements DbTables
*/
@Override
@Transactional
public Map<String, Object> publishToModelRecordTable(DbTablesQueryRequest queryRequest) {
//parameter: tableId 、 (hasProcess=1表示有流程的)
public Map<String, Object> publishToModelRecordTable(String tableId,String hasProcess) {
Map<String, Object> map = new HashMap<String, Object>();
String backStr = "";
String tableName = this.dbTableService.getTableName(queryRequest.getTableId());
String tableName = this.dbTableService.getTableName(tableId);
try {
DbTablesQueryRequest queryRequest=new DbTablesQueryRequest();
queryRequest.setId(tableId);
queryRequest.setTableId(tableId);
queryRequest.setTableName(tableName);
queryRequest.setHasProcess(hasProcess);
List<Map<String, Object>> fieldList = this.queryModelRecordSingleFields(queryRequest);
if (fieldList.size() == 0) {
map.put("result", Constant.NOT_ATTRIBUTE_MODEL);
return map;
}
String[] fieldContent = dbTableService.composizeFieldContent(fieldList, "1"); //组装主表
String[] fieldContent = dbTableService.composizeFieldContent(fieldList,queryRequest.getHasProcess());
backStr = this.dbTableService.createTable(tableName, fieldContent[0], fieldContent[1]);
if (!"".equals(backStr)) {
map.put("result", backStr);
......@@ -338,14 +345,14 @@ public class DbTablesApplicationImpl extends BaseApplication implements DbTables
// backStr=synchrionData(queryRequest.getModelId(),tableName,multsFieldList,attrCodes);
//}
map.put("result", backStr);
} catch (Exception ex) {
backStr = ex.getMessage();
ex.printStackTrace();
}
map.put("result", backStr);
return map;
}
//
// para :tableName
//@Override
public List<Map<String, Object>> queryModelRecordSingleFields(DbTablesQueryRequest queryRequest) {
Map<String, Object> mapData = new HashMap<String, Object>();
......
......@@ -289,11 +289,11 @@ public class DataBaseSettingsController extends CommonController{
public String publishToModelRecordTable(){
Map<String, Object> data =new HashMap<String, Object>();
SDO sdo = this.getSDO();
String modelId=sdo.getString("tableId");
//List<MdmModelRecord> list=this.mdmModelRecordRepository.findById(modelId);
String tableId=sdo.getString("tableId");System.out.println("==tableId========="+tableId);
//List<MdmModelRecord> list=this.dmdmModelRecordRepository.findById(modelId);
DbTablesQueryRequest queryRequest = sdo.toQueryRequest(DbTablesQueryRequest.class);
data=this.dbTablesApplication.publishToModelRecordTable(queryRequest);
Object map = data.get("result");
data=this.dbTablesApplication.publishToModelRecordTable(tableId,"0");
// Object map = data.get("result");
/* if (map == null || "".equals(map)) {
MdmModelRecord mdmModelRecord = this.mdmModelRecordApplication.loadMdmModelRecord(modelId);
mdmModelRecord.setPublished(1);
......
......@@ -28,6 +28,8 @@ public class DbTablesQueryRequest extends CodeAndNameQueryRequest{
private Integer isHidden;
private String hasProcess; //启用流程的
public String getId() {
return id;
}
......@@ -101,8 +103,13 @@ public class DbTablesQueryRequest extends CodeAndNameQueryRequest{
public void setIsHidden(Integer isHidden) {
this.isHidden = isHidden;
}
public String getHasProcess() {
return hasProcess;
}
public void setHasProcess(String hasProcess) {
this.hasProcess = hasProcess;
}
}
......@@ -598,33 +598,36 @@ public class ComUtils {
String itStr = String.format(" into %s(%s) values (%s)", tableName,columns,"%s");
StringBuffer intoSql = new StringBuffer();
String[] columnNames = columns.split(",");
//for(Map<String,Object> map : datas){
String sql ="";
try {
//for(Map<String,Object> map : datas){
StringBuffer valuesSql = new StringBuffer();
for(String key : columnNames){
// String realKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, key);
for (String key : columnNames) {
// String realKey = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, key);
//String realKey = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, key).toUpperCase();
String value = MapUtils.getString(map,key,"");
if(key.equalsIgnoreCase("id")){
if (map.get("id")!=null&&!"".equals(map.get("id").toString())){
valuesSql.append(String.format(",'%s'", value));
String value = MapUtils.getString(map, key, "");
if (key.equalsIgnoreCase("id")) {
if (map.get("id") != null && !"" .equals(map.get("id").toString())) {
valuesSql.append(String.format(",'%s'", value));
} else {
valuesSql.append(",sys_guid()");
valuesSql.append(",sys_guid()");
}
}else if(key.equalsIgnoreCase("created_date")||key.equalsIgnoreCase("fillin_date")){
} else if (key.equalsIgnoreCase("created_date") || key.equalsIgnoreCase("fillin_date")) {
valuesSql.append(",sysdate");
}else if (value.startsWith("to_date(")){ //日期格式值 去掉单引号
} else if (value.startsWith("to_date(")) { //日期格式值 去掉单引号
valuesSql.append(String.format(",%s", value));
}else{
value=value.replace("'", "''");
} else {
value = value.replace("'", "''");
valuesSql.append(String.format(",'%s'", value));
}
}
intoSql.append(String.format(itStr, valuesSql.substring(1)));
//}
String sql = String.format("insert all %s select * from dual", intoSql.toString());
//}
sql = String.format("insert all %s select * from dual", intoSql.toString());
}catch (Exception ex){
ex.printStackTrace();
}
return sql.toString();
}
......
......@@ -16,7 +16,7 @@
<pattern>/common/OPpermission.jsp*</pattern>
<pattern>/common/TaskExecutionList.jsp*</pattern>
<pattern>/common/TaskContext.jsp*</pattern>
<pattern>/formdesign/form-making/index.html*</pattern>
<pattern>/formDesign/forwardFormMaking.do*</pattern>
</excludes>
<decorator name="printable" page="printable.jsp"/>
<!-- 创建一个名为main的装饰器,该装饰器页面为main.jsp,用于装饰pattern指定的URL的所有页面-->
......
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.huigou.context.ContextUtil" %>
<%@ page import="com.huigou.util.Constants" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="/WEB-INF/JSTLFunction.tld" prefix="f" %>
<%
String token = (String) ContextUtil.getSession().getAttribute(Constants.CSRF_TOKEN);
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "No-cache");
response.setDateHeader("Expires", -1);
response.setHeader("Cache-Control", "No-store");
String serverHost = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();
String basePath = serverHost + request.getContextPath();
request.setAttribute("basePath", basePath);
%>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel="shortcut icon" href=favicon.ico>
<link rel=stylesheet href=http://at.alicdn.com/t/font_1869570_2qzt87owi9d.css>
<title></title>
<meta name=description content="Form designer based on Vue, makes form development simple and efficient">
<script type="application/javascript">
var basePath = '${basePath}';
</script>
<style>html, body {
height: 100%;
}
#app {
height: 100%;
position: relative;
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.lds-roller {
display: inline-block;
position: relative;
width: 64px;
height: 64px;
}
.lds-roller div {
animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
transform-origin: 32px 32px;
}
.lds-roller div:after {
content: " ";
display: block;
position: absolute;
width: 6px;
height: 6px;
border-radius: 50%;
background: #409EFF;
margin: -3px 0 0 -3px;
}
.lds-roller div:nth-child(1) {
animation-delay: -0.036s;
}
.lds-roller div:nth-child(1):after {
top: 50px;
left: 50px;
}
.lds-roller div:nth-child(2) {
animation-delay: -0.072s;
}
.lds-roller div:nth-child(2):after {
top: 54px;
left: 45px;
}
.lds-roller div:nth-child(3) {
animation-delay: -0.108s;
}
.lds-roller div:nth-child(3):after {
top: 57px;
left: 39px;
}
.lds-roller div:nth-child(4) {
animation-delay: -0.144s;
}
.lds-roller div:nth-child(4):after {
top: 58px;
left: 32px;
}
.lds-roller div:nth-child(5) {
animation-delay: -0.18s;
}
.lds-roller div:nth-child(5):after {
top: 57px;
left: 25px;
}
.lds-roller div:nth-child(6) {
animation-delay: -0.216s;
}
.lds-roller div:nth-child(6):after {
top: 54px;
left: 19px;
}
.lds-roller div:nth-child(7) {
animation-delay: -0.252s;
}
.lds-roller div:nth-child(7):after {
top: 50px;
left: 14px;
}
.lds-roller div:nth-child(8) {
animation-delay: -0.288s;
}
.lds-roller div:nth-child(8):after {
top: 45px;
left: 10px;
}
@keyframes lds-roller {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}</style>
<script>window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-145160307-3');</script>
<link href=${basePath}/formdesign/form-making/css/app.css rel=preload as=style>
<link href=${basePath}/formdesign/form-making/css/chunk-vendors.css rel=preload as=style>
<link href=${basePath}/formdesign/form-making/js/app.js rel=preload as=script>
<link href=${basePath}/formdesign/form-making/js/chunk-vendors.js rel=preload as=script>
<link href=${basePath}/formdesign/form-making/css/chunk-vendors.css rel=stylesheet>
<link href=${basePath}/formdesign/form-making/css/app.css rel=stylesheet>
</head>
<body>
<input type="hidden" id="csrfTokenElement" value="<%=token%>"/>
<input type="hidden" id="formNo" value="<%=request.getParameter("formno")%>">
<div id=app>
<div style="height: 100%; width: 100%; display: flex; justify-content: center; align-items: center;">
<div class=lds-roller>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>
<script src=${basePath}/formdesign/form-making/js/chunk-vendors.js></script>
<script src=${basePath}/formdesign/form-making/js/app.js></script>
</body>
</html>
\ No newline at end of file
......@@ -246,7 +246,8 @@ function doSaveFormData() {
//跳转表单设计 页面
function formDesign(id, formno, name) {
var _url = "http://localhost:8088/huigou/formdesign/form-making/index.html?formno=" + formno;
var _url = web_app.name + "/formDesign/forwardFormMaking.do?formno=" + formno;
//var _url = 'http://127.0.0.1:8080/index.html?formno=' + formno;
// _url="http://www.baidu.com";
//document.getElementById('frame_form_edit').src = _url;
//alert(_url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment