1.来函信息展示,新增,修改,审核,取消审核,删除,条件查询
2.翻译配置文件中添加来函页面的中英翻译
This commit is contained in:
195
src/main/java/com/nis/domain/configuration/RequestInfo.java
Normal file
195
src/main/java/com/nis/domain/configuration/RequestInfo.java
Normal file
@@ -0,0 +1,195 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.nis.domain.BaseEntity;
|
||||
|
||||
public class RequestInfo extends BaseEntity<RequestInfo>{
|
||||
|
||||
private String requestNumber;
|
||||
|
||||
private String requestOrg;
|
||||
|
||||
private Date requestTime;
|
||||
|
||||
private String requestTitle;
|
||||
|
||||
private String requestContent;
|
||||
|
||||
private Integer isValid;
|
||||
|
||||
private Integer isAudit;
|
||||
|
||||
private Integer creatorId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Integer editorId;
|
||||
|
||||
private Date editTime;
|
||||
|
||||
private Integer auditorId;
|
||||
|
||||
private Date auditTime;
|
||||
|
||||
//自定义 创建人员 修改人员 审核人员
|
||||
private String creatorName;
|
||||
private String editorName;
|
||||
private String auditorName;
|
||||
private Date beginDate;//开始时间
|
||||
private Date endDate;//结束时间
|
||||
private String timeType;//时间类型
|
||||
|
||||
public String getRequestNumber() {
|
||||
return requestNumber;
|
||||
}
|
||||
|
||||
public void setRequestNumber(String requestNumber) {
|
||||
this.requestNumber = requestNumber == null ? null : requestNumber.trim();
|
||||
}
|
||||
|
||||
public String getRequestOrg() {
|
||||
return requestOrg;
|
||||
}
|
||||
|
||||
public void setRequestOrg(String requestOrg) {
|
||||
this.requestOrg = requestOrg == null ? null : requestOrg.trim();
|
||||
}
|
||||
|
||||
public Date getRequestTime() {
|
||||
return requestTime;
|
||||
}
|
||||
|
||||
public void setRequestTime(Date requestTime) {
|
||||
this.requestTime = requestTime;
|
||||
}
|
||||
|
||||
public String getRequestTitle() {
|
||||
return requestTitle;
|
||||
}
|
||||
|
||||
public void setRequestTitle(String requestTitle) {
|
||||
this.requestTitle = requestTitle == null ? null : requestTitle.trim();
|
||||
}
|
||||
|
||||
public String getRequestContent() {
|
||||
return requestContent;
|
||||
}
|
||||
|
||||
public void setRequestContent(String requestContent) {
|
||||
this.requestContent = requestContent == null ? null : requestContent.trim();
|
||||
}
|
||||
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
public Integer getIsAudit() {
|
||||
return isAudit;
|
||||
}
|
||||
|
||||
public void setIsAudit(Integer isAudit) {
|
||||
this.isAudit = isAudit;
|
||||
}
|
||||
|
||||
public Integer getCreatorId() {
|
||||
return creatorId;
|
||||
}
|
||||
|
||||
public void setCreatorId(Integer creatorId) {
|
||||
this.creatorId = creatorId;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Integer getEditorId() {
|
||||
return editorId;
|
||||
}
|
||||
|
||||
public void setEditorId(Integer editorId) {
|
||||
this.editorId = editorId;
|
||||
}
|
||||
|
||||
public Date getEditTime() {
|
||||
return editTime;
|
||||
}
|
||||
|
||||
public void setEditTime(Date editTime) {
|
||||
this.editTime = editTime;
|
||||
}
|
||||
|
||||
public Integer getAuditorId() {
|
||||
return auditorId;
|
||||
}
|
||||
|
||||
public void setAuditorId(Integer auditorId) {
|
||||
this.auditorId = auditorId;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
public String getCreatorName() {
|
||||
return creatorName;
|
||||
}
|
||||
|
||||
public void setCreatorName(String creatorName) {
|
||||
this.creatorName = creatorName;
|
||||
}
|
||||
|
||||
public String getEditorName() {
|
||||
return editorName;
|
||||
}
|
||||
|
||||
public void setEditorName(String editorName) {
|
||||
this.editorName = editorName;
|
||||
}
|
||||
|
||||
public String getAuditorName() {
|
||||
return auditorName;
|
||||
}
|
||||
|
||||
public void setAuditorName(String auditorName) {
|
||||
this.auditorName = auditorName;
|
||||
}
|
||||
|
||||
public Date getBeginDate() {
|
||||
return beginDate;
|
||||
}
|
||||
|
||||
public void setBeginDate(Date beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getTimeType() {
|
||||
return timeType;
|
||||
}
|
||||
|
||||
public void setTimeType(String timeType) {
|
||||
this.timeType = timeType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,20 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
|
||||
/**
|
||||
* 测试类
|
||||
@@ -13,18 +24,105 @@ import com.nis.web.controller.BaseController;
|
||||
@RequestMapping("${adminPath}/cfg/request")
|
||||
public class RequestInfoController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private RequestInfoService requestInfoService;
|
||||
|
||||
@RequestMapping(value = {"list"})
|
||||
public String list() {
|
||||
return "/cfg/requestList";
|
||||
|
||||
/**
|
||||
*来函列表
|
||||
*/
|
||||
@RequestMapping(value = {"list",""})
|
||||
public String list(RequestInfo requestInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
Page<RequestInfo> page = requestInfoService.findRequestInfo(new Page<RequestInfo>(request, response), requestInfo);
|
||||
model.addAttribute("page", page);
|
||||
return "/cfg/requestList";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"form"})
|
||||
public String form() {
|
||||
/**
|
||||
* 进入用户添加或修改页面
|
||||
*/
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(RequestInfo requestInfo, Model model) {
|
||||
if(StringUtils.isNotEmpty(requestInfo.getRequestNumber())){
|
||||
requestInfo = requestInfoService.getRequestInfoByRequestNumber(requestInfo.getRequestNumber());
|
||||
model.addAttribute("requestInfo", requestInfo);
|
||||
}
|
||||
model.addAttribute("requestInfo", requestInfo);
|
||||
return "/cfg/requestForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/修改
|
||||
*/
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(RequestInfo requestInfo, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
if(requestInfo.getId()!=null){
|
||||
// 保存用户信息
|
||||
requestInfoService.saveOrUpdate(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
}else{
|
||||
if (!"true".equals(checkRequestNumber(requestInfo.getRequestNumber()))){
|
||||
addMessage(model, "error");
|
||||
return form(requestInfo, model);
|
||||
}
|
||||
// 保存用户信息
|
||||
requestInfoService.saveOrUpdate(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(model, "error");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证是否有效
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "checkRequestNumber")
|
||||
public String checkRequestNumber(String requestNumber) {
|
||||
if (requestNumber !=null && requestInfoService.getRequestInfoByRequestNumber(requestNumber) == null) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "requestExamine")
|
||||
public String requestExamine(RequestInfo requestInfo, Model model){
|
||||
requestInfoService.requestExamine(requestInfo);
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 取消审核
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "requestCancelExamine")
|
||||
public String requestCancelExamine(RequestInfo requestInfo, Model model){
|
||||
requestInfoService.requestCancelExamine(requestInfo);
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "delete")
|
||||
public String delete(RequestInfo requestInfo, Model model){
|
||||
requestInfoService.delete(requestInfo);
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface RequestInfoDao extends CrudDao {
|
||||
|
||||
List<RequestInfo> findRequestInfo(RequestInfo requestInfo);
|
||||
|
||||
RequestInfo getRequestInfoByRequestNumber(@Param("requestNumber") String requestNumber);
|
||||
|
||||
RequestInfo getRequestInfoById(@Param("id") Long id);
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
|
||||
int insertSelective(RequestInfo requestInfo);
|
||||
|
||||
RequestInfo selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(RequestInfo requestInfo);
|
||||
|
||||
int updateByPrimaryKey(RequestInfo requestInfo);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
272
src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml
Normal file
272
src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml
Normal file
@@ -0,0 +1,272 @@
|
||||
<?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">
|
||||
<mapper namespace="com.nis.web.dao.configuration.RequestInfoDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.configuration.RequestInfo">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="request_number" jdbcType="VARCHAR" property="requestNumber" />
|
||||
<result column="request_org" jdbcType="VARCHAR" property="requestOrg" />
|
||||
<result column="request_time" jdbcType="DATE" property="requestTime" />
|
||||
<result column="request_title" jdbcType="VARCHAR" property="requestTitle" />
|
||||
<result column="request_content" jdbcType="VARCHAR" property="requestContent" />
|
||||
<result column="is_valid" jdbcType="INTEGER" property="isValid" />
|
||||
<result column="is_audit" jdbcType="INTEGER" property="isAudit" />
|
||||
<result column="creator_id" jdbcType="INTEGER" property="creatorId" />
|
||||
<result column="create_time" jdbcType="DATE" property="createTime" />
|
||||
<result column="editor_id" jdbcType="INTEGER" property="editorId" />
|
||||
<result column="edit_time" jdbcType="DATE" property="editTime" />
|
||||
<result column="auditor_id" jdbcType="INTEGER" property="auditorId" />
|
||||
<result column="audit_time" jdbcType="DATE" property="auditTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, request_number, request_org, request_time, request_title, request_content, is_valid,
|
||||
is_audit, creator_id, create_time, editor_id, edit_time, auditor_id, audit_time
|
||||
</sql>
|
||||
<!-- 查询列表 -->
|
||||
<select id="findRequestInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
r.id AS id,
|
||||
r.request_number AS requestNumber,
|
||||
r.request_org AS requestOrg,
|
||||
r.request_time AS requestTime,
|
||||
r.request_title AS requestTitle,
|
||||
r.request_content AS requestContent,
|
||||
r.is_valid AS isValid,
|
||||
r.is_audit AS isAudit,
|
||||
s.name AS creatorName,
|
||||
r.create_time AS createTime,
|
||||
u.name AS editorName,
|
||||
r.edit_time AS editTime,
|
||||
e.name AS currentName,
|
||||
r.audit_time AS auditTime
|
||||
from request_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user u on r.editor_id=u.id
|
||||
left join sys_user e on r.auditor_id=e.id
|
||||
where r.is_valid=1 and r.is_audit !=3
|
||||
<if test="requestTitle != null and requestTitle != ''">
|
||||
AND r.request_title like
|
||||
<if test="dbName == 'mysql'">CONCAT('%',#{requestTitle}, '%')</if>
|
||||
</if>
|
||||
<if test="requestContent != null and requestContent != ''">
|
||||
AND r.request_content like
|
||||
<if test="dbName == 'mysql'">CONCAT('%',#{requestContent},'%')</if>
|
||||
</if>
|
||||
<if test="requestNumber != null and requestNumber != ''">
|
||||
AND r.request_number=#{requestNumber}
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.is_audit=${isAudit}
|
||||
</if>
|
||||
<if test=" timeType = 'requestTime' and beginDate!=null and beginDate!='' and endDate!=null and endDate!=''">
|
||||
AND r.request_time between #{beginDate} and #{endDate}
|
||||
</if>
|
||||
<if test="timeType = 'createTime' and beginDate!=null and beginDate!='' and endDate!=null and endDate!=''">
|
||||
AND (r.create_time between #{beginDate} and #{endDate}) or (r.audit_time between #{beginDate} and #{endDate})
|
||||
</if>
|
||||
</select>
|
||||
<!-- 根据来函号查询 -->
|
||||
<select id="getRequestInfoByRequestNumber" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from request_info
|
||||
where request_number = #{requestNumber,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<!-- 根据来id查询 -->
|
||||
<select id="getRequestInfoById" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from request_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="insert" parameterType="com.nis.domain.configuration.RequestInfo">
|
||||
insert into request_info (
|
||||
request_number,
|
||||
request_org,
|
||||
request_time,
|
||||
request_title,
|
||||
request_content,
|
||||
is_valid,
|
||||
is_audit,
|
||||
creator_id,
|
||||
create_time,
|
||||
editor_id,
|
||||
edit_time,
|
||||
auditor_id,
|
||||
audit_time
|
||||
)
|
||||
values (#{requestNumber,jdbcType=VARCHAR}, #{requestOrg,jdbcType=VARCHAR},
|
||||
#{requestTime,jdbcType=DATE}, #{requestTitle,jdbcType=VARCHAR}, #{requestContent,jdbcType=VARCHAR},
|
||||
#{isValid,jdbcType=INTEGER}, #{isAudit,jdbcType=INTEGER}, #{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=DATE}, #{editorId,jdbcType=INTEGER}, #{editTime,jdbcType=DATE},
|
||||
#{auditorId,jdbcType=INTEGER}, #{auditTime,jdbcType=DATE})
|
||||
</insert>
|
||||
<!--修改 -->
|
||||
<update id="update" parameterType="com.nis.domain.configuration.RequestInfo">
|
||||
update request_info
|
||||
<set>
|
||||
<if test="requestNumber != null">
|
||||
request_number = #{requestNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestOrg != null">
|
||||
request_org = #{requestOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestTime != null">
|
||||
request_time = #{requestTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="requestTitle != null">
|
||||
request_title = #{requestTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestContent != null">
|
||||
request_content = #{requestContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="editorId != null">
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null">
|
||||
edit_time = #{editTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="auditorId != null">
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null">
|
||||
audit_time = #{auditTime,jdbcType=DATE},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<!--删除 -->
|
||||
<update id="delete" parameterType="com.nis.domain.configuration.RequestInfo">
|
||||
update request_info
|
||||
<set>
|
||||
<if test="isValid != null and id != null">
|
||||
is_valid=#{isValid}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT} and is_audit !=1
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<insert id="insertSelective" parameterType="com.nis.domain.configuration.RequestInfo">
|
||||
insert into request_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="requestNumber != null">
|
||||
request_number,
|
||||
</if>
|
||||
<if test="requestOrg != null">
|
||||
request_org,
|
||||
</if>
|
||||
<if test="requestTime != null">
|
||||
request_time,
|
||||
</if>
|
||||
<if test="requestTitle != null">
|
||||
request_title,
|
||||
</if>
|
||||
<if test="requestContent != null">
|
||||
request_content,
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
is_valid,
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
is_audit,
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
creator_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="editorId != null">
|
||||
editor_id,
|
||||
</if>
|
||||
<if test="editTime != null">
|
||||
edit_time,
|
||||
</if>
|
||||
<if test="auditorId != null">
|
||||
auditor_id,
|
||||
</if>
|
||||
<if test="auditTime != null">
|
||||
audit_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="requestNumber != null">
|
||||
#{requestNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestOrg != null">
|
||||
#{requestOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestTime != null">
|
||||
#{requestTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="requestTitle != null">
|
||||
#{requestTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestContent != null">
|
||||
#{requestContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="editorId != null">
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null">
|
||||
#{editTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="auditorId != null">
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null">
|
||||
#{auditTime,jdbcType=DATE},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.configuration.RequestInfo">
|
||||
update request_info
|
||||
set request_number = #{requestNumber,jdbcType=VARCHAR},
|
||||
request_org = #{requestOrg,jdbcType=VARCHAR},
|
||||
request_time = #{requestTime,jdbcType=DATE},
|
||||
request_title = #{requestTitle,jdbcType=VARCHAR},
|
||||
request_content = #{requestContent,jdbcType=VARCHAR},
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=DATE},
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
edit_time = #{editTime,jdbcType=DATE},
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
audit_time = #{auditTime,jdbcType=DATE}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.RequestInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class RequestInfoService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private RequestInfoDao requestInfoDao;
|
||||
|
||||
public Page<RequestInfo> findRequestInfo(Page<RequestInfo> page, RequestInfo requestInfo) {
|
||||
// 设置分页参数
|
||||
requestInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
page.setList(requestInfoDao.findRequestInfo(requestInfo));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void saveOrUpdate(RequestInfo requestInfo) {
|
||||
if (StringUtil.isEmpty(requestInfo.getId())) {
|
||||
//设置默认参数值
|
||||
requestInfo.setIsValid(1);//有效
|
||||
requestInfo.setIsAudit(0);//未审核
|
||||
requestInfo.setCreatorId((UserUtils.getUser().getId()).intValue());//创建人员
|
||||
requestInfo.setCreateTime(new Date());//创建时间
|
||||
requestInfoDao.insert(requestInfo);
|
||||
}else{
|
||||
requestInfo.setEditorId((UserUtils.getUser().getId()).intValue());//修改人员
|
||||
requestInfo.setEditTime(new Date());//修改时间
|
||||
requestInfoDao.update(requestInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public RequestInfo getRequestInfoByRequestNumber(String requestNumber) {
|
||||
|
||||
return requestInfoDao.getRequestInfoByRequestNumber(requestNumber);
|
||||
}
|
||||
public RequestInfo getRequestInfoById(Long id) {
|
||||
|
||||
return requestInfoDao.getRequestInfoById(id);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void requestExamine(RequestInfo requestInfo){
|
||||
requestInfo.setIsAudit(1);//审核通过
|
||||
requestInfoDao.update(requestInfo);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void requestCancelExamine(RequestInfo requestInfo){
|
||||
requestInfo.setIsAudit(3);//取消审核通过
|
||||
int update = requestInfoDao.update(requestInfo);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void delete(RequestInfo requestInfo){
|
||||
requestInfo.setIsValid(-1);
|
||||
requestInfoDao.delete(requestInfo);//删除
|
||||
}
|
||||
}
|
||||
@@ -124,4 +124,10 @@ operator=operator
|
||||
content=content
|
||||
remarks=remarks
|
||||
update_request=update request
|
||||
operation=operation
|
||||
submit=submit
|
||||
cancel=cancel
|
||||
begin_date=begin date
|
||||
end_date=end date
|
||||
delete=delete
|
||||
#============laihan end======================
|
||||
@@ -124,4 +124,10 @@ operator=operator
|
||||
content=content
|
||||
remarks=remarks
|
||||
update_request=update request
|
||||
operation=operation
|
||||
submit=submit
|
||||
cancel=cancel
|
||||
begin_date=begin date
|
||||
end_date=end date
|
||||
delete=delete
|
||||
#============laihan end======================
|
||||
@@ -123,5 +123,10 @@ operator=\u64CD\u4F5C\u5458
|
||||
content=\u5185\u5BB9
|
||||
remarks=\u5907\u6CE8
|
||||
update_request=\u4FEE\u6539\u6765\u51FD
|
||||
|
||||
operation=\u64CD\u4F5C
|
||||
submit=\u63D0\u4EA4
|
||||
cancel=\u53D6\u6D88
|
||||
begin_date=\u5F00\u59CB\u65F6\u95F4
|
||||
end_date=\u7ED3\u675F\u65F6\u95F4
|
||||
delete=\u5220\u9664
|
||||
#==========yewu zidian end=====================
|
||||
@@ -29,62 +29,65 @@
|
||||
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form action="#" class="form-horizontal">
|
||||
<form:form action="${ctx}/cfg/request/saveOrUpdate" class="form-horizontal" id="inputForm" method="post" >
|
||||
<sys:message content="${message}"/>
|
||||
<input type="hidden" name="id" value="${requestInfo.id}"/>
|
||||
<div class="form-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">函号:</label>
|
||||
<label class="col-md-3 control-label"><spring:message code="request_number"></spring:message>:</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control">
|
||||
<input type="text" class="form-control" name="requestNumber" value="${requestInfo.requestNumber}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">来函单位:</label>
|
||||
<label class="col-md-3 control-label"><spring:message code="request_organization"></spring:message>:</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control">
|
||||
<input type="text" class="form-control" name="requestOrg" value="${requestInfo.requestOrg}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">来函时间:</label>
|
||||
<label class="col-md-3 control-label"><spring:message code="request_time"></spring:message>:</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control">
|
||||
<input id="requestTime" name="requestTime" type="text" readonly="readonly" maxlength="20" class="form-control input-medium Wdate"
|
||||
value="<fmt:formatDate value="${requestInfo.requestTime}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">标题:</label>
|
||||
<label class="col-md-3 control-label"><spring:message code="title"></spring:message>:</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control">
|
||||
<input type="text" class="form-control" name="requestTitle" value="${requestInfo.requestTitle}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-md-3 control-label">专项:</label>
|
||||
<div class="col-md-4">
|
||||
<div class="input-icon right">
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
</div> -->
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-md-3 control-label">描述:</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group last">
|
||||
<label class="col-md-3 control-label">内容:</label>
|
||||
<label class="col-md-3 control-label"><th><spring:message code="content"></spring:message>:</label>
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control">
|
||||
<input type="text" class="form-control" name="requestContent" value="${requestInfo.requestContent}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<button type="submit" class="btn btn-circle green">提交</button>
|
||||
<button type="button" class="btn btn-circle grey-salsa btn-outline">Cancel</button>
|
||||
<button type="submit" class="btn btn-circle green"><spring:message code="submit"></spring:message></button>
|
||||
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"></spring:message></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
|
||||
@@ -92,5 +95,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.input-medium {
|
||||
width: 200px !important;
|
||||
}
|
||||
.Wdate {
|
||||
border: #999 2px solid;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,14 +5,15 @@
|
||||
<title>来函信息</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-default"> 刷新 </button>
|
||||
<button type="button" class="btn btn-default" onclick="location='${ctx}/cfg/request/list'"><spring:message code="refresh"></spring:message></button>
|
||||
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/cfg/request/form'"> 新增来函 </button>
|
||||
onClick="javascript:window.location='${ctx}/cfg/request/form'"><spring:message code="add_request"></spring:message></button>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
@@ -24,7 +25,7 @@
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i>来函函号
|
||||
<i class="fa fa-cogs"></i><spring:message code="request_number"></spring:message>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title=""
|
||||
@@ -40,128 +41,141 @@
|
||||
|
||||
<div class="row" >
|
||||
|
||||
|
||||
<form:form id="searchForm" modelAttribute="requestInfo" action="${ctx}/cfg/request/list" method="post" class="breadcrumb form-search">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<div class="col-md-12">
|
||||
|
||||
状态:<select class="select2">
|
||||
<option>未审核</option>
|
||||
<option>审核通过</option>
|
||||
<spring:message code="state"></spring:message>:<select class="select2" name="isAudit">
|
||||
<option value="0"><spring:message code="created"></spring:message></option>
|
||||
<option value="1"><spring:message code="approved"></spring:message></option>
|
||||
</select>
|
||||
|
||||
<select>
|
||||
<option>标题</option>
|
||||
<option>来函函号</option>
|
||||
<option>任务</option>
|
||||
</select> <input> <select>
|
||||
<option>来函时间</option>
|
||||
<option>操作时间</option>
|
||||
</select> <input>
|
||||
<select id="seltype">
|
||||
<option value="requestTitle"><spring:message code="title"></spring:message></option>
|
||||
<option value="requestNumber"><spring:message code="request_number"></spring:message></option>
|
||||
<option value="requestContent"><spring:message code="task"></spring:message></option>
|
||||
</select> <input id="intype">
|
||||
|
||||
<select id="timeType" name="timeType">
|
||||
<option value="requestTime"><spring:message code="request_time"></spring:message></option>
|
||||
<option value="createTime"><spring:message code="operate_time"></spring:message></option>
|
||||
</select>
|
||||
|
||||
<spring:message code="begin_date"></spring:message>:<input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${requestInfo.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
<spring:message code="end_date"></spring:message>:<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${requestInfo.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm">
|
||||
<i class="fa fa-edit"></i> 搜索
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="return page()">
|
||||
<i class="fa fa-edit"></i> <spring:message code="search"></spring:message>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form:form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="table-responsive">
|
||||
<sys:message content="${message}"/>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>来函函号</th>
|
||||
<th>来函单位</th>
|
||||
<th>来函时间</th>
|
||||
<th>状态</th>
|
||||
<th>任务</th>
|
||||
<th>操作员</th>
|
||||
<th>操作时间</th>
|
||||
<th>标题</th>
|
||||
<th>内容</th>
|
||||
<th>备注</th>
|
||||
<th><spring:message code="seq"></spring:message></th>
|
||||
<th><spring:message code="request_number"></spring:message></th>
|
||||
<th><spring:message code="request_organization"></spring:message></th>
|
||||
<th><spring:message code="request_time"></spring:message></th>
|
||||
<th><spring:message code="state"></spring:message></th>
|
||||
<th><spring:message code="operator"></spring:message></th>
|
||||
<th><spring:message code="operate_time"></spring:message></th>
|
||||
<th><spring:message code="title"></spring:message></th>
|
||||
<th><spring:message code="content"></spring:message></th>
|
||||
<th><spring:message code="operation"></spring:message></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list}" var="requestInfo">
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>20181720函号</td>
|
||||
<td>来函单位 </d>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td><span class="label label-sm label-success"> 通过
|
||||
</span></td>
|
||||
<td>七五专项</td>
|
||||
<td>Admin</td>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td>标题</td>
|
||||
<td>test</td>
|
||||
<td>test</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>20181720函号</td>
|
||||
<td>来函单位 </d>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td><span class="label label-sm label-success"> 通过
|
||||
</span></td>
|
||||
<td>七五专项</td>
|
||||
<td>Admin</td>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td>标题</td>
|
||||
<td>test</td>
|
||||
<td>test</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>20181720函号</td>
|
||||
<td>来函单位 </d>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td><span class="label label-sm label-success"> 通过
|
||||
</span></td>
|
||||
<td>七五专项</td>
|
||||
<td>Admin</td>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td>标题</td>
|
||||
<td>test</td>
|
||||
<td>test</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td>20181720函号</td>
|
||||
<td>来函单位 </d>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td><span class="label label-sm label-success"> 通过
|
||||
</span></td>
|
||||
<td>七五专项</td>
|
||||
<td>Admin</td>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td>标题</td>
|
||||
<td>test</td>
|
||||
<td>test</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>5</td>
|
||||
<td>20181720函号</td>
|
||||
<td>来函单位 </d>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td><span class="label label-sm label-success"> 通过
|
||||
</span></td>
|
||||
<td>七五专项</td>
|
||||
<td>Admin</td>
|
||||
<td>2018-01-06 21:57:03</td>
|
||||
<td>标题</td>
|
||||
<td>test</td>
|
||||
<td>test</td>
|
||||
|
||||
<td>${requestInfo.id }</td>
|
||||
<td>${requestInfo.requestNumber }</td>
|
||||
<td>${requestInfo.requestOrg }</td>
|
||||
<td><fmt:formatDate value="${requestInfo.requestTime }" pattern="yyyy-MM-dd"/></td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${requestInfo.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||
<c:when test="${requestInfo.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||
<c:when test="${requestInfo.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${requestInfo.creatorName }</td>
|
||||
<td>
|
||||
<!-- 编辑时间为空则显示创建时间 -->
|
||||
<c:choose>
|
||||
<c:when test="${empty requestInfo.editTime}">
|
||||
<fmt:formatDate value="${requestInfo.createTime }" pattern="yyyy-MM-dd"/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<fmt:formatDate value="${requestInfo.editTime }" pattern="yyyy-MM-dd"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${requestInfo.requestTitle }</td>
|
||||
<td>${requestInfo.requestContent }</td>
|
||||
<td>
|
||||
<div class="btn-group btn-xs">
|
||||
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#"><spring:message code="operation"></spring:message><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu btn-xs">
|
||||
<!-- 审核未通过可修改 -->
|
||||
<c:choose>
|
||||
<c:when test="${requestInfo.isAudit eq '1'}">
|
||||
<li><a href="${ctx}/cfg/request/requestCancelExamine?id=${requestInfo.id}" onclick="return confirm('sure?', this.href)"><spring:message code="cancel"></spring:message></a></li>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<li><a href="${ctx}/cfg/request/requestExamine?id=${requestInfo.id}" onclick="return confirm('sure?', this.href)"><spring:message code="approved"></spring:message></a></li>
|
||||
<li><a href="${ctx}/cfg/request/form?requestNumber=${requestInfo.requestNumber}" onclick="javascript:return confirm('sure?', this.href)"><spring:message code="update_request"></spring:message></a></li>
|
||||
<li><a href="${ctx}/cfg/request/delete?id=${requestInfo.id}" onclick="return confirm('sure?', this.href)"><spring:message code="delete"></spring:message></a></li>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pager">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/cfg/request/list");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.input-medium {
|
||||
width: 200px !important;
|
||||
}
|
||||
.Wdate {
|
||||
border: #999 2px solid;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user