CgformButtonSqlEntity cbsUpdate = cgformButtonSqlService.getCgformButtonSqlByCodeFormId("update", cgFormHead.getId());
buttonSqlMap.put("update", cbsUpdate==null?new String[]{}:cbsUpdate.getCgbSqlStr().replaceAll("(\r\n|\r|\n|\n\r)", "").split(";"));
CgformButtonSqlEntity cbsDelete = cgformButtonSqlService.getCgformButtonSqlByCodeFormId("delete", cgFormHead.getId());
buttonSqlMap.put("delete", cbsDelete==null?new String[]{}:cbsDelete.getCgbSqlStr().replaceAll("(\r\n|\r|\n|\n\r)", "").split(";"));
//JS增强-列表
CgformEnhanceJsEntity listJs = cgformEnhanceJsService.getCgformEnhanceJsByTypeFormId("list", cgFormHead.getId());
CgformEnhanceJsEntity listJsCopy = null;
try{
listJsCopy = listJs.deepCopy();
}catch (Exception e) {
logger.debug(e.getMessage());
}
//JS增强-表单
CgformEnhanceJsEntity formJs = cgformEnhanceJsService.getCgformEnhanceJsByTypeFormId("form", cgFormHead.getId());
CgformEnhanceJsEntity formJsCopy = null;
try{
formJsCopy = formJs.deepCopy();
}catch (Exception e) {
logger.debug(e.getMessage());
}
//将js中带有online字段名的 转换成java命名
for(CgFormFieldEntity field : cgFormHead.getColumns()){
String fieldName = field.getFieldName();
if(listJsCopy!=null){
listJsCopy.setCgJsStr(listJsCopy.getCgJsStr().replace(fieldName, JeecgReadTable.formatField(fieldName)));
}
if(formJsCopy!=null){
formJsCopy.setCgJsStr(formJsCopy.getCgJsStr().replace(fieldName, JeecgReadTable.formatField(fieldName)));
}
}
generateEntity.setButtons(buttons);
generateEntity.setButtonSqlMap(buttonSqlMap);
generateEntity.setCgFormHead(cgFormHead);