Commit 5b52f90e by 周王清

通知公告修改

parent 2bee77eb
...@@ -45,11 +45,11 @@ var ls_ywlx = 'YBYW'; ...@@ -45,11 +45,11 @@ var ls_ywlx = 'YBYW';
* 备注:需更改 * 备注:需更改
**/ **/
//定义grid列表 //定义grid列表
var ls_title="友情链接"; var ls_title="快速链接";
var is_column = [ [ var is_column = [ [
{field : 'TITLE',title : '标题',width : 380,align : 'center'}, {field : 'TITLE',title : '标题',width : 380,align : 'left', halign:'center'},
{field : 'RELEASE_TIME',title : '发布时间',width : 120,align : 'center'}, {field : 'RELEASE_TIME',title : '发布时间',width : 120,align : 'center'},
{field : 'CREATE_ID',title : '创建人员',width : 100,align : 'center'}, {field : 'CREATE_USER_NAME',title : '创建人员',width : 100,align : 'center'},
{field : 'CREATE_TIME',title : '创建时间',width : 120,align : 'center'} {field : 'CREATE_TIME',title : '创建时间',width : 120,align : 'center'}
] ]; ] ];
//列表加载完成回调 //列表加载完成回调
...@@ -174,7 +174,7 @@ function deleteRow(index){ ...@@ -174,7 +174,7 @@ function deleteRow(index){
$.messager.confirm('提示', '确定删除?', function(r) { $.messager.confirm('提示', '确定删除?', function(r) {
if (r) { if (r) {
var v_query = {}; var v_query = {};
v_query.UUID = code; v_query.FIELD_CODE = code;
var v_result = noticeModule.act.removeNoticeInfo(v_query); var v_result = noticeModule.act.removeNoticeInfo(v_query);
$.messager.alert('提示',v_result.VALUE); $.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload'); $('#list').datagrid('reload');
...@@ -209,7 +209,7 @@ function deleteBatchRow(){ ...@@ -209,7 +209,7 @@ function deleteBatchRow(){
$.messager.confirm('提示', '确定删除?', function(r) { $.messager.confirm('提示', '确定删除?', function(r) {
if (r) { if (r) {
var v_query = {}; var v_query = {};
v_query.UUID = code; v_query.FIELD_CODE = code;
var v_result = noticeModule.act.removeNoticeInfo(v_query); var v_result = noticeModule.act.removeNoticeInfo(v_query);
$.messager.alert('提示',v_result.VALUE); $.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload'); $('#list').datagrid('reload');
......
...@@ -5,27 +5,19 @@ ...@@ -5,27 +5,19 @@
<input type="hidden" name="FIELD_USER_ID" id="USER_ID" value="${is_row.USER_ID}" /> <input type="hidden" name="FIELD_USER_ID" id="USER_ID" value="${is_row.USER_ID}" />
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;"> <table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr> <tr>
<td style="width: 15%;" class="tableStyleLable"><span>标题:</span> <td style="width: 15%;" class="tableStyleLable"><span>标题:</span></td>
</td>
<td style="width: 85%"> <td style="width: 85%">
<input class="easyui-textbox" data-options="required:true" id="TITLE" name="FIELD_TITLE" style="width:300px" /> <input class="easyui-textbox" data-options="required:true" id="TITLE" name="FIELD_TITLE" style="width:300px" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width: 15%;" class="tableStyleLable"><span>正文:</span> <td style="width: 15%;" class="tableStyleLable"><span>正文:</span></td>
</td>
<td style="width: 85%"> <td style="width: 85%">
<script id="TEXT" name="FIELD_TEXT" type="text/plain"> <script id="TEXT" name="FIELD_TEXT" type="text/plain">
</script> </script>
</td> </td>
</tr> </tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>发布时间:</span>
</td>
<td style="width: 85%">
<input class="easyui-datetimebox" data-options="required:true" id="RELEASE_TIME" name="FIELD_RELEASE_TIME" style="width:150px" />
</td>
</tr>
</table> </table>
</form> </form>
\ No newline at end of file
package com.jw.app.business; package com.jw.app.business;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -12,6 +13,6 @@ public interface NoticeBusiness { ...@@ -12,6 +13,6 @@ public interface NoticeBusiness {
Map<String, Object> save_notice(Map<String, Object> info) throws BusinessException; Map<String, Object> save_notice(Map<String, Object> info) throws BusinessException;
void delete_notice(String uuid) throws BusinessException; void delete_notice(List<String> list) throws BusinessException;
} }
...@@ -37,7 +37,7 @@ public class NoticeBusinessImpl implements NoticeBusiness { ...@@ -37,7 +37,7 @@ public class NoticeBusinessImpl implements NoticeBusiness {
if (query.get("USER_ID") == null || "".equals(query.get("USER_ID"))) { if (query.get("USER_ID") == null || "".equals(query.get("USER_ID"))) {
// 默认查询当前登陆人 // 默认查询当前登陆人
query.put("USER_ID", SessionUtil.getEmid()); query.put("USER_ID", SessionUtil.getCode());
} }
// 计算起始记录 // 计算起始记录
...@@ -61,12 +61,14 @@ public class NoticeBusinessImpl implements NoticeBusiness { ...@@ -61,12 +61,14 @@ public class NoticeBusinessImpl implements NoticeBusiness {
info.put("UUID", UUID.randomUUID().toString()); info.put("UUID", UUID.randomUUID().toString());
if (info.get("USER_ID") == null || "".equals(info.get("USER_ID"))) { if (info.get("USER_ID") == null || "".equals(info.get("USER_ID"))) {
// 如果没有传USER_ID过来,则使用当前登录人id // 如果没有传USER_ID过来,则使用当前登录人id
info.put("USER_ID", SessionUtil.getEmid()); info.put("USER_ID", SessionUtil.getCode());
} }
info.put("CREATE_ID", SessionUtil.getEmid()); info.put("CREATE_ID", SessionUtil.getCode());
info.put("CREATE_TIME", new Date()); info.put("CREATE_TIME", new Date());
info.put("UPDATE_ID", SessionUtil.getEmid()); info.put("UPDATE_ID", SessionUtil.getCode());
info.put("UPDATE_TIME", new Date()); info.put("UPDATE_TIME", new Date());
info.put("RELEASE_TIME", new Date());
List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>();
for (String k : info.keySet()) { for (String k : info.keySet()) {
Map<String, Object> field = new HashMap<String, Object>(); Map<String, Object> field = new HashMap<String, Object>();
...@@ -100,9 +102,7 @@ public class NoticeBusinessImpl implements NoticeBusiness { ...@@ -100,9 +102,7 @@ public class NoticeBusinessImpl implements NoticeBusiness {
} }
@Override @Override
public void delete_notice(String uuid) throws BusinessException { public void delete_notice(List<String> list) throws BusinessException {
for (String u : uuid.split(",")) { noticeDAO.delete_notice(list);
noticeDAO.delete_notice(u);
}
} }
} }
...@@ -18,5 +18,5 @@ public interface noticeDAO { ...@@ -18,5 +18,5 @@ public interface noticeDAO {
void update_notice(Map<String, Object> info) throws BusinessException; void update_notice(Map<String, Object> info) throws BusinessException;
void delete_notice(String uuid) throws BusinessException; void delete_notice(List<String> list) throws BusinessException;
} }
...@@ -22,7 +22,11 @@ ...@@ -22,7 +22,11 @@
<select id="list_notice" parameterType="map" resultType="upperCaseKeyMap"> <select id="list_notice" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[ <![CDATA[
select * from notice t select t.* ,
uu1.REAL_NAME AS CREATE_USER_NAME
from notice t
LEFT JOIN uicm_user_info uu1 ON t.CREATE_ID = uu1.USER_ID
]]> ]]>
<include refid="where" /> <include refid="where" />
ORDER BY t.CREATE_TIME ORDER BY t.CREATE_TIME
...@@ -31,6 +35,7 @@ ...@@ -31,6 +35,7 @@
<select id="list_count_notice" parameterType="map" resultType="int"> <select id="list_count_notice" parameterType="map" resultType="int">
<![CDATA[ <![CDATA[
select count(*) from notice t select count(*) from notice t
LEFT JOIN uicm_user_info uu1 ON t.CREATE_ID = uu1.USER_ID
]]> ]]>
<include refid="where" /> <include refid="where" />
ORDER BY t.CREATE_TIME ORDER BY t.CREATE_TIME
...@@ -63,6 +68,12 @@ ...@@ -63,6 +68,12 @@
</update> </update>
<delete id="delete_notice" parameterType="String"> <delete id="delete_notice" parameterType="String">
delete from notice where UUID=#{uuid} <![CDATA[
delete from notice where UUID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
package com.jw.app.notice.action; package com.jw.app.notice.action;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
...@@ -59,8 +60,11 @@ public class actAction extends BasicAction { ...@@ -59,8 +60,11 @@ public class actAction extends BasicAction {
*/ */
public String removeNoticeInfo() throws BusinessException { public String removeNoticeInfo() throws BusinessException {
NoticeBusiness business = BusinessManager.getBusiness(NoticeBusiness.class); NoticeBusiness business = BusinessManager.getBusiness(NoticeBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
String deletekey = (String) entity.get("CODE");
List<String> ListKey = QueryParamUtil.StringToList(deletekey);
try { try {
business.delete_notice(RequestUtils.getString(request, "UUID")); business.delete_notice(ListKey);
jsonObject.putAll(Status.getStatus(Status.DELETE_OK)); jsonObject.putAll(Status.getStatus(Status.DELETE_OK));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatus(Status.DELETE_ERR)); jsonObject.putAll(Status.getStatus(Status.DELETE_ERR));
......
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