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);//删除
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user