Commit 921abd56 by 罗绍泽

添加公司日历功能

parent f696157b
...@@ -343,3 +343,6 @@ ...@@ -343,3 +343,6 @@
.icon-ext-06_10 { .icon-ext-06_10 {
background:url('../../../../images/icons/(06,10).png') no-repeat left center; background:url('../../../../images/icons/(06,10).png') no-repeat left center;
} }
.icon-ext-13_48 {
background:url('../../../../images/icons/(13,48).png') no-repeat left center;
}
\ No newline at end of file
...@@ -1260,7 +1260,8 @@ function init_index_fullCalendar() { ...@@ -1260,7 +1260,8 @@ function init_index_fullCalendar() {
events : function(start,end,timezone, callback) { events : function(start,end,timezone, callback) {
var result=calendarModule.data.listCalendarInfo({ var result=calendarModule.data.listCalendarInfo({
FIELD_START_TIME:start._i, FIELD_START_TIME:start._i,
FIELD_END_TIME:end._i FIELD_END_TIME:end._i,
pageSize:999
}); });
var listData=result.rowSet; var listData=result.rowSet;
var json=[]; var json=[];
......
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="studentTab">
<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_input.css" charset="utf-8"></link>
<!-- spectrum(颜色)的css -->
<link rel="stylesheet" type="text/css" href="${ctx}/lib/plug/jqueryColour/spectrum.css">
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="calendarTab_searchForm" style="float:left">
<input id="FIELD_USER_ID" name="FIELD_USER_ID" type="hidden"/>
内容: <input id="FIELD_TITLE" name="FIELD_TITLE" type="text" style="width: 300px" >&nbsp;&nbsp;
从<input class="easyui-datetimebox" id="FIELD_START_TIME" name="FIELD_START_TIME" style="width:150px"/>&nbsp;
到 &nbsp;<input class="easyui-datetimebox" id="FIELD_END_TIME" name="FIELD_END_TIME" style="width:150px"/>&nbsp;&nbsp;
</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-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-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
<span id="calendarTab_changeperson"></span>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="userChoice" style="overflow:auto;"></div>
<!-- spectrum(颜色)的js -->
<script type="text/javascript" src="/jfV5portal/lib/plug/jqueryColour/spectrum.js"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/calendar/js/calendarModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/calendar/js/calendarCompanyTab.js" charset="utf-8"></script>
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" />
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}" />
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>日程内容:</span></td>
<td style="width: 85%">
<input class="easyui-textbox" data-options="required:true" id="TITLE" name="FIELD_TITLE" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>开始时间:</span></td>
<td style="width: 85%">
<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>结束时间:</span></td>
<td style="width: 85%">
<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>背景颜色:</span></td>
<td style="width: 85%">
<input id="COLOR" name="FIELD_COLOR" style="width:100px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>是否全天:</span></td>
<td style="width: 85%">
<input class="easyui-textbox" id="ALLDAY" name="FIELD_ALLDAY" style="width:100px" />
</td>
</tr>
<tr>
</table>
</form>
\ No newline at end of file
<%@page contentType="text/html; charset=UTF-8"%> <%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;"> <form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" /> <input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}" /> <input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" />
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}" />
<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> <td style="width: 15%;" class="tableStyleLable"><span>日程内容:</span></td>
......
...@@ -14,6 +14,12 @@ calendarModule.prototype.listCalendarInfo = function(){}; ...@@ -14,6 +14,12 @@ calendarModule.prototype.listCalendarInfo = function(){};
calendarModule.prototype.saveCalendarInfo = function(){}; calendarModule.prototype.saveCalendarInfo = function(){};
//删除当前登录人的日历信息 //删除当前登录人的日历信息
calendarModule.prototype.removeCalendarInfo = function(){}; calendarModule.prototype.removeCalendarInfo = function(){};
//获取公司日历信息
calendarModule.prototype.listCalendarCompanyInfo = function(){};
//保存公司日历信息
calendarModule.prototype.saveCalendarCompanyInfo = function(){};
//删除公司日历信息
calendarModule.prototype.removeCalendarCompanyInfo = function(){};
//创建一个数据操作对象,然后再后续使用 //创建一个数据操作对象,然后再后续使用
calendarModule.act = new calendarModule("json").delegate("calendarAct"); calendarModule.act = new calendarModule("json").delegate("calendarAct");
......
...@@ -156,6 +156,7 @@ function addRow(){ ...@@ -156,6 +156,7 @@ function addRow(){
} }
//加载增加子页面成功后的回调 //加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){ function addUrlOnloadCallback(is_row){
$("#USER_ID").val($("#FIELD_USER_ID").val());
$('#ALLDAY').val(1); $('#ALLDAY').val(1);
$('#COLOR').val('#ECC'); $('#COLOR').val('#ECC');
$('#ALLDAY').combobox({ $('#ALLDAY').combobox({
......
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;
import com.gaowj.business.exception.BusinessException; import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
@Service @Service
public interface CalendarBusiness { public interface CalendarBusiness {
List<Map<String, Object>> list_calendar_by_user(Map<String, Object> query) throws BusinessException; Page<Map<String, Object>> list_calendar_by_user(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException;
Map<String, Object> save_calendar(Map<String, Object> info) throws BusinessException; Map<String, Object> save_calendar(Map<String, Object> info) throws BusinessException;
void delete_calendar(String uuid) throws BusinessException; void delete_calendar(String uuid) throws BusinessException;
Page<Map<String, Object>> list_calendar_by_company(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException;
Map<String, Object> save_calendar_by_company(Map<String, Object> info) throws BusinessException;
void delete_calendar_company(String uuid) throws BusinessException;
} }
...@@ -8,7 +8,10 @@ import java.util.List; ...@@ -8,7 +8,10 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException; import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil; import com.gaowj.business.util.SessionUtil;
import com.jw.app.business.CalendarBusiness; import com.jw.app.business.CalendarBusiness;
import com.jw.app.business.utils.DateTools; import com.jw.app.business.utils.DateTools;
...@@ -26,7 +29,7 @@ public class CalendarBusinessImpl implements CalendarBusiness { ...@@ -26,7 +29,7 @@ public class CalendarBusinessImpl implements CalendarBusiness {
} }
@Override @Override
public List<Map<String, Object>> list_calendar_by_user(Map<String, Object> query) throws BusinessException { public Page<Map<String, Object>> list_calendar_by_user(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
if (query.get("START_TIME") != null) { if (query.get("START_TIME") != null) {
try { try {
query.put("START_TIME", new Date(Long.valueOf(query.get("START_TIME").toString()))); query.put("START_TIME", new Date(Long.valueOf(query.get("START_TIME").toString())));
...@@ -61,7 +64,18 @@ public class CalendarBusinessImpl implements CalendarBusiness { ...@@ -61,7 +64,18 @@ public class CalendarBusinessImpl implements CalendarBusiness {
query.put("USER_ID", SessionUtil.getEmid()); query.put("USER_ID", SessionUtil.getEmid());
} }
return calendarDAO.list_calendar_by_user(query); // 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
List<Map<String, Object>> items = calendarDAO.list_calendar_by_user(new RowBounds(pageStart, pageSize), query);
int count = calendarDAO.list_count_calendar_by_user(query);
// 创建分页对象
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setStart(pageStart);
page.setLimit(pageSize);
page.setCount(count);
page.setItems(items);
return page;
} }
@Override @Override
...@@ -69,7 +83,11 @@ public class CalendarBusinessImpl implements CalendarBusiness { ...@@ -69,7 +83,11 @@ public class CalendarBusinessImpl implements CalendarBusiness {
if (info.get("UUID") == null || "".equals(info.get("UUID"))) { if (info.get("UUID") == null || "".equals(info.get("UUID"))) {
// 表示新增 // 表示新增
info.put("UUID", UUID.randomUUID().toString()); info.put("UUID", UUID.randomUUID().toString());
if (info.get("USER_ID") == null || "".equals(info.get("USER_ID"))) {
// 如果没有传USER_ID过来,则使用当前登录人id
info.put("USER_ID", SessionUtil.getEmid()); info.put("USER_ID", SessionUtil.getEmid());
}
info.put("CREATE_USER", SessionUtil.getEmid()); info.put("CREATE_USER", SessionUtil.getEmid());
info.put("CREATE_TIME", new Date()); info.put("CREATE_TIME", new Date());
info.put("UPDATE_USER", SessionUtil.getEmid()); info.put("UPDATE_USER", SessionUtil.getEmid());
...@@ -87,6 +105,8 @@ public class CalendarBusinessImpl implements CalendarBusiness { ...@@ -87,6 +105,8 @@ public class CalendarBusinessImpl implements CalendarBusiness {
// 表示更新 // 表示更新
info.put("UPDATE_USER", SessionUtil.getEmid()); info.put("UPDATE_USER", SessionUtil.getEmid());
info.put("UPDATE_TIME", new Date()); info.put("UPDATE_TIME", new Date());
// 防止修改记录的所属人
info.remove("USER_ID");
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()) {
if ("UUID".equals(k)) { if ("UUID".equals(k)) {
...@@ -111,4 +131,95 @@ public class CalendarBusinessImpl implements CalendarBusiness { ...@@ -111,4 +131,95 @@ public class CalendarBusinessImpl implements CalendarBusiness {
} }
} }
@Override
public Page<Map<String, Object>> list_calendar_by_company(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
if (query.get("START_TIME") != null) {
try {
query.put("START_TIME", new Date(Long.valueOf(query.get("START_TIME").toString())));
} catch (NumberFormatException e) {
try {
query.put("START_TIME", DateTools.strToDate(query.get("START_TIME").toString()));
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
if (query.get("END_TIME") != null) {
try {
query.put("END_TIME", new Date(Long.valueOf(query.get("END_TIME").toString())));
} catch (NumberFormatException e) {
try {
query.put("END_TIME", DateTools.strToDate(query.get("END_TIME").toString()));
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
if (query.get("TITLE") != null && !"".equals(query.get("TITLE"))) {
query.put("TITLE_LIKE", "%" + query.get("TITLE") + "%");
}
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
List<Map<String, Object>> items = calendarDAO.list_calendar_by_company(new RowBounds(pageStart, pageSize), query);
int count = calendarDAO.list_count_calendar_by_company(query);
// 创建分页对象
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setStart(pageStart);
page.setLimit(pageSize);
page.setCount(count);
page.setItems(items);
return page;
}
@Override
public Map<String, Object> save_calendar_by_company(Map<String, Object> info) throws BusinessException {
if (info.get("UUID") == null || "".equals(info.get("UUID"))) {
// 表示新增
info.put("UUID", UUID.randomUUID().toString());
info.put("CREATE_USER", SessionUtil.getEmid());
info.put("CREATE_TIME", new Date());
info.put("UPDATE_USER", SessionUtil.getEmid());
info.put("UPDATE_TIME", new Date());
List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>();
for (String k : info.keySet()) {
Map<String, Object> field = new HashMap<String, Object>();
field.put("key", k);
field.put("value", info.get(k));
listField.add(field);
}
info.put("list", listField);
calendarDAO.insert_calendar_by_company(info);
} else {
// 表示更新
info.put("UPDATE_USER", SessionUtil.getEmid());
info.put("UPDATE_TIME", new Date());
List<Map<String, Object>> listField = new ArrayList<Map<String, Object>>();
for (String k : info.keySet()) {
if ("UUID".equals(k)) {
continue;
}
Map<String, Object> field = new HashMap<String, Object>();
field.put("key", k);
field.put("value", info.get(k));
listField.add(field);
}
info.put("list", listField);
calendarDAO.update_calendar_by_company(info);
}
return info;
}
@Override
public void delete_calendar_company(String uuid) throws BusinessException {
for (String u : uuid.split(",")) {
calendarDAO.delete_calendar_by_company(u);
}
}
} }
...@@ -3,14 +3,32 @@ package com.jw.app.business.calendar; ...@@ -3,14 +3,32 @@ package com.jw.app.business.calendar;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException; import com.gaowj.business.exception.BusinessException;
public interface calendarDAO { public interface calendarDAO {
List<Map<String, Object>> list_calendar_by_user(Map<String, Object> query) throws BusinessException; List<Map<String, Object>> list_calendar_by_user(Map<String, Object> query) throws BusinessException;
int list_count_calendar_by_user(Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_calendar_by_user(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
void insert_calendar(Map<String, Object> info) throws BusinessException; void insert_calendar(Map<String, Object> info) throws BusinessException;
void update_calendar(Map<String, Object> info) throws BusinessException; void update_calendar(Map<String, Object> info) throws BusinessException;
void delete_calendar(String uuid) throws BusinessException; void delete_calendar(String uuid) throws BusinessException;
List<Map<String, Object>> list_calendar_by_company(Map<String, Object> query) throws BusinessException;
int list_count_calendar_by_company(Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_calendar_by_company(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
void insert_calendar_by_company(Map<String, Object> info) throws BusinessException;
void update_calendar_by_company(Map<String, Object> info) throws BusinessException;
void delete_calendar_by_company(String uuid) throws BusinessException;
} }
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jw.app.business.calendar.calendarDAO"> <mapper namespace="com.jw.app.business.calendar.calendarDAO">
<select id="list_calendar_by_user" parameterType="map" <sql id="where_user">
resultType="upperCaseKeyMap"> <where>
<![CDATA[ <trim prefixOverrides="AND |OR">
select * from b_t_ufp_calendar t
]]>
<trim prefix="WHERE" prefixOverrides="AND |OR">
<if test="USER_ID != null and USER_ID != ''"> <if test="USER_ID != null and USER_ID != ''">
and t.USER_ID = #{USER_ID} and t.USER_ID = #{USER_ID}
</if> </if>
...@@ -30,6 +27,48 @@ ...@@ -30,6 +27,48 @@
]]> ]]>
</if> </if>
</trim> </trim>
</where>
</sql>
<sql id="where_company">
<where>
<trim prefixOverrides="AND |OR">
<if test="TITLE_LIKE != null and TITLE_LIKE != ''">
and t.TITLE LIKE #{TITLE_LIKE}
</if>
<!-- 开始时间或者结束时间,有一个在用户传进来的时间范围内就给予显示 -->
<if test="START_TIME != null and START_TIME != '' and END_TIME != null and END_TIME != ''">
<![CDATA[
and ((t.START_TIME >= #{START_TIME} and t.START_TIME <= #{END_TIME}) or (t.END_TIME >= #{START_TIME} and t.END_TIME <= #{END_TIME}))
]]>
</if>
<if test="START_TIME != null and START_TIME != '' and (END_TIME == null or END_TIME == '')">
<![CDATA[
and ((t.START_TIME >= #{START_TIME}) or (t.END_TIME >= #{START_TIME} ))
]]>
</if>
<if test="(END_TIME != null and END_TIME != '' and START_TIME == null or START_TIME == '')">
<![CDATA[
and ((t.START_TIME <= #{END_TIME}) or (t.END_TIME <= #{END_TIME}))
]]>
</if>
</trim>
</where>
</sql>
<select id="list_calendar_by_user" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select * from b_t_ufp_calendar t
]]>
<include refid="where_user" />
ORDER BY t.create_time DESC
</select>
<select id="list_count_calendar_by_user" parameterType="map" resultType="int">
<![CDATA[
select count(*) from b_t_ufp_calendar t
]]>
<include refid="where_user" />
ORDER BY t.create_time DESC ORDER BY t.create_time DESC
</select> </select>
...@@ -62,4 +101,50 @@ ...@@ -62,4 +101,50 @@
<delete id="delete_calendar" parameterType="String"> <delete id="delete_calendar" parameterType="String">
delete from b_t_ufp_calendar where UUID=#{uuid} delete from b_t_ufp_calendar where UUID=#{uuid}
</delete> </delete>
<select id="list_calendar_by_company" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select * from b_t_ufp_calendar_company t
]]>
<include refid="where_company" />
ORDER BY t.create_time DESC
</select>
<select id="list_count_calendar_by_company" parameterType="map" resultType="int">
<![CDATA[
select count(*) from b_t_ufp_calendar_company t
]]>
<include refid="where_company" />
ORDER BY t.create_time DESC
</select>
<insert id="insert_calendar_by_company" parameterType="java.util.List">
insert into b_t_ufp_calendar_company(
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
${field.key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
#{field.value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update id="update_calendar_by_company" parameterType="java.util.List">
update b_t_ufp_calendar_company set
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="field">
${field.key}=#{field.value},
</foreach>
</trim>
where UUID=#{UUID}
</update>
<delete id="delete_calendar_by_company" parameterType="String">
delete from b_t_ufp_calendar_company where UUID=#{uuid}
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -8,7 +8,6 @@ import com.gaowj.business.exception.BusinessException; ...@@ -8,7 +8,6 @@ import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.QueryParamUtil; import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils; import com.gaowj.business.util.RequestUtils;
import com.jw.app.business.CalendarBusiness; import com.jw.app.business.CalendarBusiness;
import com.jw.app.business.PortletBusiness;
import com.jw.app.business.utils.Status; import com.jw.app.business.utils.Status;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
...@@ -69,4 +68,43 @@ public class actAction extends BasicAction { ...@@ -69,4 +68,43 @@ public class actAction extends BasicAction {
return "json"; return "json";
} }
/**
* 保存公司日历信息
*
* @return
* @throws BusinessException
*/
public String saveCalendarCompanyInfo() throws BusinessException {
Map<String, Object> info = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
CalendarBusiness business = BusinessManager.getBusiness(CalendarBusiness.class);
try {
info = QueryParamUtil.StringToDate(info);
info.remove("OPETYPE");
business.save_calendar_by_company(info);
jsonObject.putAll(Status.getStatus(Status.UPDATE_OK));
} catch (Exception e) {
jsonObject.putAll(Status.getStatus(Status.UPDATE_ERR));
}
return "json";
}
/**
* 删除公司日历信息
*
* @return
* @throws BusinessException
*/
public String removeCalendarCompanyInfo() throws BusinessException {
CalendarBusiness business = BusinessManager.getBusiness(CalendarBusiness.class);
try {
business.delete_calendar_company(RequestUtils.getString(request, "UUID"));
jsonObject.putAll(Status.getStatus(Status.DELETE_OK));
} catch (Exception e) {
jsonObject.putAll(Status.getStatus(Status.DELETE_ERR));
}
return "json";
}
} }
...@@ -9,16 +9,15 @@ import java.util.Map; ...@@ -9,16 +9,15 @@ import java.util.Map;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager; import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException; import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.QueryParamUtil; import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils; import com.gaowj.business.util.RequestUtils;
import com.gaowj.business.util.SessionUtil;
import com.jw.app.business.CalendarBusiness; import com.jw.app.business.CalendarBusiness;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
public class dataAction extends BasicAction { public class dataAction extends BasicAction {
/** /**
* *
*/ */
...@@ -26,12 +25,15 @@ public class dataAction extends BasicAction { ...@@ -26,12 +25,15 @@ public class dataAction extends BasicAction {
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数 private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页 private int page = 1;// 当前第几页
public JSONObject getJsonObject() { public JSONObject getJsonObject() {
return jsonObject; return jsonObject;
} }
public void setJsonObject(JSONObject jsonObject) { public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject; this.jsonObject = jsonObject;
} }
public int getRows() { public int getRows() {
rows = getPageSize(); rows = getPageSize();
return rows; return rows;
...@@ -54,32 +56,54 @@ public class dataAction extends BasicAction { ...@@ -54,32 +56,54 @@ public class dataAction extends BasicAction {
/** /**
* 获取日历信息列表 * 获取日历信息列表
*
* @return * @return
* @throws BusinessException * @throws BusinessException
*/ */
public String listCalendarInfo() throws BusinessException{ public String listCalendarInfo() throws BusinessException {
CalendarBusiness business = BusinessManager CalendarBusiness business = BusinessManager.getBusiness(CalendarBusiness.class);
.getBusiness(CalendarBusiness.class); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
query = QueryParamUtil.StringToDate(query); query = QueryParamUtil.StringToDate(query);
List<Map<String, Object>> listData = business Page<Map<String, Object>> pageData = business.list_calendar_by_user(pageNo,pageSize,query);
.list_calendar_by_user(query); Map<String, Object> data = new HashMap<String, Object>();
for (Map<String, Object> rm : listData) { data.put("rowSet", QueryParamUtil.DateTimeToString(pageData.getItems()));
if(rm.get("P_TYPE")==null||!rm.get("P_TYPE").equals("3")) data.put("pageNo", pageNo);
{ data.put("pageSize", pageSize);
rm.remove("RSS_CONTENT"); data.put("pageCount", pageCount);
rm.remove("TAKE_CONTENT"); data.put("rows", data.get("rowSet"));
data.put("total", pageData.getCount());
jsonObject = new JSONObject();
jsonObject.putAll(data);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} }
return "json";
} }
/**
* 获取公司日历列表
*
* @return
* @throws BusinessException
*/
public String listCalendarCompanyInfo() throws BusinessException {
CalendarBusiness business = BusinessManager.getBusiness(CalendarBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageData = business.list_calendar_by_company(pageNo,pageSize,query);
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateTimeToString(listData)); data.put("rowSet", QueryParamUtil.DateTimeToString(pageData.getItems()));
data.put("pageNo", 1); data.put("pageNo", pageNo);
data.put("pageSize", listData.size()); data.put("pageSize", pageSize);
data.put("pageCount", listData.size()); data.put("pageCount", pageCount);
data.put("rows", data.get("rowSet")); data.put("rows", data.get("rowSet"));
data.put("total", listData.size()); data.put("total", pageData.getCount());
jsonObject = new JSONObject(); jsonObject = new JSONObject();
jsonObject.putAll(data); jsonObject.putAll(data);
} catch (SQLException e) { } catch (SQLException e) {
......
package com.jw.app.calendar.action; package com.jw.app.calendar.action;
import java.util.Map;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
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 {
...@@ -21,4 +18,12 @@ public class viewAction extends BasicAction { ...@@ -21,4 +18,12 @@ public class viewAction extends BasicAction {
public String calendarTabDetail() throws BusinessException{ public String calendarTabDetail() throws BusinessException{
return "calendarTabDetail"; return "calendarTabDetail";
} }
public String calendarCompanyTab() throws BusinessException{
return "calendarCompanyTab";
}
public String calendarCompanyTabDetail() throws BusinessException{
return "calendarCompanyTabDetail";
}
} }
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