Commit f9cbbe82 by 陈玉兰

提交表单

parent b299d9ca
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<value>classpath:com/gaowj/business/formtable/formtableDAO.xml</value> <value>classpath:com/gaowj/business/formtable/formtableDAO.xml</value>
<value>classpath:com/gaowj/business/procdefinition/procdefinitionDAO.xml</value> <value>classpath:com/gaowj/business/procdefinition/procdefinitionDAO.xml</value>
<value>classpath:com/gaowj/business/procdefinitionmodels/procdefinitionmodelsDAO.xml</value> <value>classpath:com/gaowj/business/procdefinitionmodels/procdefinitionmodelsDAO.xml</value>
<value>classpath:com/gaowj/business/formfield/formfieldDAO.xml</value>
</list> </list>
</property> </property>
</bean> </bean>
...@@ -21,7 +22,6 @@ ...@@ -21,7 +22,6 @@
</bean> </bean>
</property> </property>
</bean> </bean>
<bean id="procdefinitionBusiness" class="com.gaowj.business.procdefinition.ProcdefinitionBusinessImpl"> <bean id="procdefinitionBusiness" class="com.gaowj.business.procdefinition.ProcdefinitionBusinessImpl">
<property name="procdefinitionDAO"> <property name="procdefinitionDAO">
<bean class="org.mybatis.spring.mapper.MapperFactoryBean"> <bean class="org.mybatis.spring.mapper.MapperFactoryBean">
...@@ -52,4 +52,13 @@ ...@@ -52,4 +52,13 @@
<property name="managementService" ref="managementService"></property> <property name="managementService" ref="managementService"></property>
</bean> </bean>
<bean id="FormfieldBusiness" class="com.gaowj.business.formfield.FormfieldBusinessImpl">
<property name="formfieldDAO">
<bean class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.gaowj.business.formfield.formfieldDAO" />
<property name="sqlSessionFactory" ref="sqlSessionFactory-test" />
</bean>
</property>
</bean>
</beans> </beans>
...@@ -1300,7 +1300,7 @@ function strToDateObj(str){ ...@@ -1300,7 +1300,7 @@ function strToDateObj(str){
else if($(this).is(":checkbox")){ else if($(this).is(":checkbox")){
var field_id = $(this).attr("name"); var field_id = $(this).attr("name");
var str=""; var str="";
$("[name="+field_id+"]:checked").each(function(){ $("[name='"+field_id+"']:checked").each(function(){
if($(this).attr("checked")){ if($(this).attr("checked")){
str += $(this).val()+","; str += $(this).val()+",";
} }
......
<%@page contentType="text/html; charset=UTF-8"%> <%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%> <%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="studentTab"> <div id="formTableTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
...@@ -8,15 +8,12 @@ ...@@ -8,15 +8,12 @@
<table id="list" style="width: 100%; height: 100%;"></table> <table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb"> <div id="tb">
<form id="formTableTab_searchForm" style="float:left"> <form id="formTableTab_searchForm" style="float:left">
是否已毕业: <input id="FIELD_STATUS" name="FIELD_STATUS" type="text" style="width: 100px" class="easyui-combobox">&nbsp;&nbsp; 姓名: <input class="easyui-textbox" id="FIELD_NAME" name="FIELD_TABLE_NAME" style="width:200px"/>&nbsp;&nbsp;
姓名: <input class="easyui-textbox" id="FIELD_NAME" name="FIELD_NAME" style="width:200px"/>&nbsp;&nbsp;
</form> </form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-advsearch',plain:true" onclick="javascript:advsearchRow()">高级查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-file',plain:true" onclick="javascript:uploadcommonBatchRow()">附件</a>
</div> </div>
<div id="detail" style="overflow:auto;"></div> <div id="detail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script> <script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<span>表名:</span> <span>表名:</span>
</td> </td>
<td style="width: 30%"> <td style="width: 30%">
<input class="easyui-textbox" id="TABLE_NAME" name="FIELD_TABLE_NAME" style="width:200px" /> <input class="easyui-textbox" id="TABLE_NAME" name="FIELD_TABLE_NAME" value="${is_row.TABLE_NAME}" style="width:200px" />
</td> </td>
<td style="width: 15%;" class="tableStyleLable"> <td style="width: 15%;" class="tableStyleLable">
<span>同步数据库状态:</span> <span>同步数据库状态:</span>
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
<span>描述:</span> <span>描述:</span>
</td> </td>
<td colspan="3"> <td colspan="3">
<input class="easyui-textbox" id="CONTENT" name="FIELD_CONTENT" style="width:570px" /> <input class="easyui-textbox" id="CONTENT" name="FIELD_CONTENT" value="${is_row.CONTENT}" style="width:570px" />
</td> </td>
</tr> </tr>
</table> </table>
<div> <div>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addLine()">新增</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addLine()">插入一行</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteLine()">删除</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteLine()">删除</a>
</div> </div>
<table id="fieldTable"> <table id="fieldTable">
</table> </table>
......
...@@ -31,5 +31,20 @@ public interface FormfieldBusiness { ...@@ -31,5 +31,20 @@ public interface FormfieldBusiness {
*/ */
void delete_form_field(List<String> list)throws BusinessException; void delete_form_field(List<String> list)throws BusinessException;
List<Map<String,Object>> list_form_field(Map<String, Object> query) throws BusinessException ; /**
* 根据tableid做删除
* @param list
* @throws BusinessException
*/
void delete_form_field_byTableid(List<String> list)throws BusinessException;
List<Map<String,Object>> list_form_field(Map<String, Object> query) throws BusinessException;
/**
* 根据tableid做查询
* @param tableid
* @return
* @throws BusinessException
*/
List<Map<String, Object>> list_form_field_byTableid(String tableid) throws BusinessException;
} }
package com.gaowj.business.formfield;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import com.gaowj.business.FormfieldBusiness;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.SessionUtil;
import com.gaowj.formtable.action.Property;
public class FormfieldBusinessImpl implements FormfieldBusiness{
private formfieldDAO formfieldDAO;
public formfieldDAO getFormfieldDAO() {
return formfieldDAO;
}
public void setFormfieldDAO(formfieldDAO formfieldDAO) {
this.formfieldDAO = formfieldDAO;
}
@Override
public void insert_form_field(Map<String, Object> entity)
throws BusinessException {
// TODO Auto-generated method stub
//动态传值插入
if (entity.get("UUID") == null) {
entity.put("UUID", java.util.UUID.randomUUID().toString());
}
if (entity.get("CREATE_TIME") == null) {
entity.put("CREATE_TIME", new Date());
}
if (entity.get("CREATE_ID") == null) {
entity.put("CREATE_ID", SessionUtil.getCode());
}
if (entity.get("UPDATE_ID") == null) {
entity.put("UPDATE_ID", SessionUtil.getCode());
}
if (entity.get("UPDATE_TIME") == null) {
entity.put("UPDATE_TIME", new Date());
}
// 动态传值插入
List<String> infoListKey = new ArrayList<String>();
List<Object> infoList = new ArrayList<Object>();
if (entity.keySet() != null) {
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
infoList.add(entity.get(str));
infoListKey.add(str);
}
entity.put("infoListKey", infoListKey);
entity.put("infoList", infoList);
}
formfieldDAO.insert_form_field(entity);
entity.clear();
}
@Override
public void update_form_field(Map<String, Object> entity)
throws BusinessException {
// TODO Auto-generated method stub
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
if(entity.keySet()!=null){
Set<String> key = entity.keySet();
Map<String, Object> param=new HashMap<String, Object>();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
Map<String, Object> updateMap = new HashMap<String, Object>();
if (StringUtils.equalsIgnoreCase("UUID",str)) continue;
updateMap.put("key", str);
updateMap.put("value", entity.get(str));
updateList.add(updateMap);
}
param.put("UUID", entity.get("UUID"));
param.put("info", updateList);
formfieldDAO.update_form_field(param);
}
}
@Override
public void delete_form_field(List<String> list) throws BusinessException {
// TODO Auto-generated method stub
formfieldDAO.delete_form_field(list);
}
@Override
public List<Map<String, Object>> list_form_field(Map<String, Object> query)
throws BusinessException {
// TODO Auto-generated method stub
return null;
}
@Override
public void delete_form_field_byTableid(List<String> list)
throws BusinessException {
// TODO Auto-generated method stub
formfieldDAO.delete_form_field_byTableid(list);
}
@Override
public List<Map<String, Object>> list_form_field_byTableid(String tableid)
throws BusinessException {
// TODO Auto-generated method stub
return formfieldDAO.list_form_field_byTableid(tableid);
}
}
package com.gaowj.business.formfield;
import java.util.List;
import java.util.Map;
import com.gaowj.business.exception.BusinessException;
public interface formfieldDAO {
void insert_form_field(Map<String, Object> entity) throws BusinessException;
void update_form_field(Map<String, Object> entity) throws BusinessException;
void delete_form_field(List<String> list) throws BusinessException;
void delete_form_field_byTableid(List<String> list) throws BusinessException;
List<Map<String, Object>> list_form_field(Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_form_field_byTableid(String tableid) throws BusinessException;
}
...@@ -6,21 +6,12 @@ ...@@ -6,21 +6,12 @@
<if test="UUID != null and UUID != ''"> <if test="UUID != null and UUID != ''">
and f.UUID = #{UUID} and f.UUID = #{UUID}
</if> </if>
<if test="TABLE_NAME != null and TABLE_NAME != ''"> <if test="TABLE_ID != null and TABLE_ID != ''">
and f.TABLE_NAME like #{TABLE_NAME_LIKE} and f.TABLE_ID = #{TABLE_ID}
</if>
<if test="CONTENT != null and CONTENT != ''">
and f.CONTENT like #{CONTENT_LIKE}
</if>
<if test="IS_DBSYNCH != null and IS_DBSYNCH != ''">
and f.IS_DBSYNCH = #{IS_DBSYNCH}
</if>
<if test="STATUS != null and STATUS != ''">
and f.STATUS = #{STATUS}
</if> </if>
</trim> </trim>
</sql> </sql>
<insert id="insert_form_table" parameterType="map"> <insert id="insert_form_field" parameterType="map">
insert into C_T_FORM_FIELD( insert into C_T_FORM_FIELD(
<trim prefix="" suffixOverrides=","> <trim prefix="" suffixOverrides=",">
<foreach collection="infoListKey" item="key"> <foreach collection="infoListKey" item="key">
...@@ -36,7 +27,7 @@ ...@@ -36,7 +27,7 @@
<![CDATA[ ) ]]> <![CDATA[ ) ]]>
</insert> </insert>
<update id="update_form_table" parameterType="map"> <update id="update_form_field" parameterType="map">
<![CDATA[ <![CDATA[
update C_T_FORM_FIELD set update C_T_FORM_FIELD set
]]> ]]>
...@@ -52,7 +43,7 @@ ...@@ -52,7 +43,7 @@
</where> </where>
</update> </update>
<delete id="delete_form_table" parameterType="list"> <delete id="delete_form_field" parameterType="list">
<![CDATA[ <![CDATA[
delete from C_T_FORM_FIELD where UUID IN delete from C_T_FORM_FIELD where UUID IN
]]> ]]>
...@@ -62,7 +53,16 @@ ...@@ -62,7 +53,16 @@
</foreach> </foreach>
</delete> </delete>
<select id="list_form_table" parameterType="map" resultType="upperCaseKeyMap"> <delete id="delete_form_field_byTableid" parameterType="list">
<![CDATA[
delete from C_T_FORM_FIELD where TABLE_ID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<select id="list_form_field" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[ <![CDATA[
select f.* select f.*
from C_T_FORM_FIELD f from C_T_FORM_FIELD f
...@@ -71,10 +71,18 @@ ...@@ -71,10 +71,18 @@
order by f.CREATE_TIME DESC order by f.CREATE_TIME DESC
</select> </select>
<select id="listCount_form_table" parameterType="map" <select id="list_form_field_byTableid" parameterType="string" resultType="upperCaseKeyMap">
<![CDATA[
select f.*
from C_T_FORM_FIELD f where f.TABLE_ID =#{TABLE_ID}
]]>
order by f.ORDER_NUM ASC
</select>
<select id="listCount_form_field" parameterType="map"
resultType="int"> resultType="int">
<![CDATA[ <![CDATA[
select count(*) c from C_T_FORM_TABLE f select count(*) c from C_T_FORM_FIELD f
]]> ]]>
<include refid="Where_Clause" /> <include refid="Where_Clause" />
</select> </select>
......
package com.gaowj.business.formfiled;
import java.util.List;
import java.util.Map;
import com.gaowj.business.FormfieldBusiness;
import com.gaowj.business.exception.BusinessException;
public class FormfieldBusinessImpl implements FormfieldBusiness{
@Override
public void insert_form_field(Map<String, Object> entity)
throws BusinessException {
// TODO Auto-generated method stub
}
@Override
public void update_form_field(Map<String, Object> entity)
throws BusinessException {
// TODO Auto-generated method stub
}
@Override
public void delete_form_field(List<String> list) throws BusinessException {
// TODO Auto-generated method stub
}
@Override
public List<Map<String, Object>> list_form_field(Map<String, Object> query)
throws BusinessException {
// TODO Auto-generated method stub
return null;
}
}
package com.gaowj.business.formfiled;
import java.util.List;
import java.util.Map;
import com.gaowj.business.exception.BusinessException;
public interface formfieldDAO {
void insert_form_table(Map<String, Object> entity) throws BusinessException;
void update_form_table(Map<String, Object> entity) throws BusinessException;
void delete_form_table(List<String> list) throws BusinessException;
List<Map<String, Object>> list_form_table(Map<String, Object> query) throws BusinessException;
}
...@@ -7,6 +7,8 @@ import java.util.List; ...@@ -7,6 +7,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import javax.xml.crypto.Data;
import org.activiti.engine.RepositoryService; import org.activiti.engine.RepositoryService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
...@@ -69,6 +71,8 @@ public class FormtableBusinessImpl implements FormtableBusiness { ...@@ -69,6 +71,8 @@ public class FormtableBusinessImpl implements FormtableBusiness {
public void update_form_table(Map<String, Object> entity) throws BusinessException { public void update_form_table(Map<String, Object> entity) throws BusinessException {
// 动态传值修改 // 动态传值修改
if (entity.keySet() != null) { if (entity.keySet() != null) {
entity.put("UPDATE_TIME", new Date());
entity.put("UPDATE_ID", SessionUtil.getCode());
convertEntity(entity); convertEntity(entity);
formtableDAO.update_form_table(entity); formtableDAO.update_form_table(entity);
} }
...@@ -83,7 +87,9 @@ public class FormtableBusinessImpl implements FormtableBusiness { ...@@ -83,7 +87,9 @@ public class FormtableBusinessImpl implements FormtableBusiness {
public Page<Map<String, Object>> list_form_table(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException { public Page<Map<String, Object>> list_form_table(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
// 计算起始记录 // 计算起始记录
int pageStart = (pageNo - 1) * pageSize; int pageStart = (pageNo - 1) * pageSize;
if(query.get("TABLE_NAME")!=null&&""!=query.get("TABLE_NAME")){
query.put("TABLE_NAME", "%"+query.get("TABLE_NAME")+"%");
}
// 获取列表 // 获取列表
List<Map<String, Object>> items = formtableDAO.list_form_table(new RowBounds(pageStart, pageSize), query); List<Map<String, Object>> items = formtableDAO.list_form_table(new RowBounds(pageStart, pageSize), query);
// 获取列表个数 // 获取列表个数
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
and f.UUID = #{UUID} and f.UUID = #{UUID}
</if> </if>
<if test="TABLE_NAME != null and TABLE_NAME != ''"> <if test="TABLE_NAME != null and TABLE_NAME != ''">
and f.TABLE_NAME like #{TABLE_NAME_LIKE} and f.TABLE_NAME like #{TABLE_NAME}
</if> </if>
<if test="CONTENT != null and CONTENT != ''"> <if test="CONTENT != null and CONTENT != ''">
and f.CONTENT like #{CONTENT_LIKE} and f.CONTENT like #{CONTENT}
</if> </if>
<if test="IS_DBSYNCH != null and IS_DBSYNCH != ''"> <if test="IS_DBSYNCH != null and IS_DBSYNCH != ''">
and f.IS_DBSYNCH = #{IS_DBSYNCH} and f.IS_DBSYNCH = #{IS_DBSYNCH}
......
...@@ -2,17 +2,46 @@ package com.gaowj.formtable.action; ...@@ -2,17 +2,46 @@ package com.gaowj.formtable.action;
public class Property { public class Property {
private Object IS_NULL; private String IS_NULL;
private String NAME; private String NAME;
private String CONTENT; private String CONTENT;
private Integer LENGTH; private Integer LENGTH;
private Integer POINT; private Integer POINT;
private String IS_KEY;
private String FIELD_DEFAULT;
private String TYPE;
private Integer ORDER_NUM;
private String UUID;
public Object getIS_NULL() { public String getIS_KEY() {
return IS_KEY;
}
public void setIS_KEY(String iS_KEY) {
IS_KEY = iS_KEY;
}
public String getFIELD_DEFAULT() {
return FIELD_DEFAULT;
}
public void setFIELD_DEFAULT(String fIELD_DEFAULT) {
FIELD_DEFAULT = fIELD_DEFAULT;
}
public String getTYPE() {
return TYPE;
}
public void setTYPE(String tYPE) {
TYPE = tYPE;
}
public String getIS_NULL() {
return IS_NULL; return IS_NULL;
} }
public void setIS_NULL(Object iS_NULL) { public void setIS_NULL(String iS_NULL) {
IS_NULL = iS_NULL; IS_NULL = iS_NULL;
} }
...@@ -48,5 +77,22 @@ public class Property { ...@@ -48,5 +77,22 @@ public class Property {
POINT = pOINT; POINT = pOINT;
} }
public Integer getORDER_NUM() {
return ORDER_NUM;
}
public void setORDER_NUM(Integer oRDER_NUM) {
ORDER_NUM = oRDER_NUM;
}
public String getUUID() {
return UUID;
}
public void setUUID(String uUID) {
UUID = uUID;
}
} }
...@@ -4,8 +4,11 @@ import java.util.HashMap; ...@@ -4,8 +4,11 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import com.alibaba.fastjson.JSON;
import com.gaowj.business.FormfieldBusiness;
import com.gaowj.business.FormtableBusiness; import com.gaowj.business.FormtableBusiness;
import com.gaowj.business.SystemOpeBusiness; import com.gaowj.business.SystemOpeBusiness;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
...@@ -52,29 +55,46 @@ public class actAction extends BasicAction { ...@@ -52,29 +55,46 @@ public class actAction extends BasicAction {
public String insertFormTable() throws BusinessException { public String insertFormTable() throws BusinessException {
FormtableBusiness business = BusinessManager.getBusiness(FormtableBusiness.class); FormtableBusiness business = BusinessManager.getBusiness(FormtableBusiness.class);
FormfieldBusiness fieldBusiness=BusinessManager.getBusiness(FormfieldBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
Map<String, Object> RE=RequestUtils.getUpdateFieldMap(request, "Form_");
jsonObject = new JSONObject(); jsonObject = new JSONObject();
try { try {
entity = QueryParamUtil.StringToDate(entity); entity = QueryParamUtil.StringToDate(entity);
//去除不要更新的字段 //去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
//新增 //新增
Map<String,Object> formTable=business.insert_form_table(entity); Map<String,Object> formTable=business.insert_form_table(entity);
//做子表的插入
Map<String, Object> param=new HashMap<String, Object>(); Map<String, Object> param=new HashMap<String, Object>();
param.put("list", LIST); for(Property property:LIST){
param.put("table_id", formTable.get("UUID")); if(property==null){
// 操作日志 continue;
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类) }
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class); if(property.getCONTENT()!=null&&""!=property.getCONTENT()){
sysbusiness.insert_logBusiness("insertStudent", "" + entity, param.put("CONTENT", property.getCONTENT());
"增加学生测试数据", (String) entity.get("UUID"), (String) entity.get("NAME"), "studentdemo1"); }
// param.put("FIELD_NAME", property.getNAME());
//更新缓存 param.put("LENGTH",property.getLENGTH() );
CacheKit.update("ehcache11", "com_gaowj_student_dataAction_listAll", business.list_form_table(null)); param.put("POINT", property.getPOINT());
// param.put("TABLE_ID", formTable.get("UUID"));
param.put("TYPE", property.getTYPE());
param.put("ORDER_NUM", property.getORDER_NUM());
if(property.getIS_NULL().equals("")){
param.put("IS_NULL",0);
}else{
param.put("IS_NULL",1);
}
if(property.getIS_KEY().equals("")){
param.put("IS_KEY", 0);
}else{
param.put("IS_KEY", 1);
}
if(property.getFIELD_DEFAULT()!=null&&""!=property.getFIELD_DEFAULT()){
param.put("FIELD_DEFAULT", property.getFIELD_DEFAULT());
}
fieldBusiness.insert_form_field(param);
}
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功")); jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败")); jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
...@@ -91,6 +111,7 @@ public class actAction extends BasicAction { ...@@ -91,6 +111,7 @@ public class actAction extends BasicAction {
public String updateFormTable() throws BusinessException { public String updateFormTable() throws BusinessException {
FormtableBusiness business = BusinessManager.getBusiness(FormtableBusiness.class); FormtableBusiness business = BusinessManager.getBusiness(FormtableBusiness.class);
FormfieldBusiness fieldBusiness=BusinessManager.getBusiness(FormfieldBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
...@@ -99,11 +120,37 @@ public class actAction extends BasicAction { ...@@ -99,11 +120,37 @@ public class actAction extends BasicAction {
//修改 //修改
entity = QueryParamUtil.StringToDate(entity); entity = QueryParamUtil.StringToDate(entity);
business.update_form_table(entity); business.update_form_table(entity);
// 操作日志 //做子表的插入
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class); Map<String, Object> param=new HashMap<String, Object>();
sysbusiness.insert_logBusiness("updateStudent", "" + entity, for(Property property:LIST){
"修改学生测试数据",(String) entity.get("UUID"), (String) entity.get("NAME"),"studentdemo1"); if(property==null){
// continue;
}
if(property.getCONTENT()!=null&&""!=property.getCONTENT()){
param.put("CONTENT", property.getCONTENT());
}
param.put("UUID", property.getUUID());
param.put("FIELD_NAME", property.getNAME());
param.put("LENGTH",property.getLENGTH() );
param.put("POINT", property.getPOINT());
param.put("TABLE_ID", entity.get("UUID"));
param.put("TYPE", property.getTYPE());
param.put("ORDER_NUM", property.getORDER_NUM());
if(property.getIS_NULL().equals("")){
param.put("IS_NULL",0);
}else{
param.put("IS_NULL",1);
}
if(property.getIS_KEY().equals("")){
param.put("IS_KEY", 0);
}else{
param.put("IS_KEY", 1);
}
if(property.getFIELD_DEFAULT()!=null&&""!=property.getFIELD_DEFAULT()){
param.put("FIELD_DEFAULT", property.getFIELD_DEFAULT());
}
fieldBusiness.update_form_field(param);
}
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功")); jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败")); jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
...@@ -120,17 +167,14 @@ public class actAction extends BasicAction { ...@@ -120,17 +167,14 @@ public class actAction extends BasicAction {
public String deleteFormTable() throws BusinessException { public String deleteFormTable() throws BusinessException {
FormtableBusiness business = BusinessManager.getBusiness(FormtableBusiness.class); FormtableBusiness business = BusinessManager.getBusiness(FormtableBusiness.class);
FormfieldBusiness fieldBusiness=BusinessManager.getBusiness(FormfieldBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
String deletekey = (String) entity.get("CODE"); String deletekey = (String) entity.get("CODE");
List<String> ListKey = QueryParamUtil.StringToList(deletekey); List<String> ListKey = QueryParamUtil.StringToList(deletekey);
try { try {
business.delete_form_table(ListKey); business.delete_form_table(ListKey);
// 操作日志 fieldBusiness.delete_form_field_byTableid(ListKey);
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteStudent", "" + ListKey,
"删除学生测试数据", deletekey, "多个流水号","studentdemo1");
//
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功")); jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败")); jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
...@@ -139,4 +183,15 @@ public class actAction extends BasicAction { ...@@ -139,4 +183,15 @@ public class actAction extends BasicAction {
return "json"; return "json";
} }
public String listTableFile()throws BusinessException{
FormfieldBusiness fieldBusiness=BusinessManager.getBusiness(FormfieldBusiness.class);
String tableId = RequestUtils.getString(request, "UUID");
List<Map<String, Object>> list=fieldBusiness.list_form_field_byTableid(tableId);
String result=JSON.toJSONString(list);
jsonObject.put("listfield", result);
return "json";
}
} }
package com.gaowj.formtable.action; package com.gaowj.formtable.action;
import java.util.List;
import java.util.Map;
import com.gaowj.business.FormfieldBusiness;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException; import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.RequestUtils;
public class viewAction extends BasicAction { public class viewAction extends BasicAction {
...@@ -15,6 +21,8 @@ public class viewAction extends BasicAction { ...@@ -15,6 +21,8 @@ public class viewAction extends BasicAction {
} }
public String formtableTabDetail() throws BusinessException{ public String formtableTabDetail() throws BusinessException{
Map<String,Object> query = RequestUtils.getUpdateFieldMapUtf8(request, RequestUtils.UPDATEDATAFIELDPREFIX);
request.setAttribute("is_row", query);
return "formtableTabDetail"; return "formtableTabDetail";
} }
......
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