1.专项任务页面展示及新增修改查询
2.国际化
This commit is contained in:
@@ -30,6 +30,16 @@ public class TaskInfo extends BaseEntity<TaskInfo> {
|
||||
private Integer auditorId;
|
||||
|
||||
private Date auditTime;
|
||||
|
||||
//自定义 创建人员 修改人员 审核人员
|
||||
private String creatorName;
|
||||
private String editorName;
|
||||
private String auditorName;
|
||||
private Date beginDate;//来函开始时间
|
||||
private Date endDate;//来函结束时间
|
||||
private String seltype;//选中类型
|
||||
private Date dobeginDate;//操作开始时间
|
||||
private Date doendDate;//操作结束时间
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
@@ -127,5 +137,69 @@ public class TaskInfo extends BaseEntity<TaskInfo> {
|
||||
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 getSeltype() {
|
||||
return seltype;
|
||||
}
|
||||
|
||||
public void setSeltype(String seltype) {
|
||||
this.seltype = seltype;
|
||||
}
|
||||
|
||||
public Date getDobeginDate() {
|
||||
return dobeginDate;
|
||||
}
|
||||
|
||||
public void setDobeginDate(Date dobeginDate) {
|
||||
this.dobeginDate = dobeginDate;
|
||||
}
|
||||
|
||||
public Date getDoendDate() {
|
||||
return doendDate;
|
||||
}
|
||||
|
||||
public void setDoendDate(Date doendDate) {
|
||||
this.doendDate = doendDate;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.TaskInfo;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.basics.TaskInfoService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/basics/taskInfo")
|
||||
public class TaskInfoController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private TaskInfoService taskInfoService;
|
||||
|
||||
|
||||
/**
|
||||
*来函列表
|
||||
*/
|
||||
@RequestMapping(value = {"list",""})
|
||||
public String list(TaskInfo taskInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
Page<TaskInfo> page = taskInfoService.findTaskInfo(new Page<TaskInfo>(request, response), taskInfo);
|
||||
model.addAttribute("page", page);
|
||||
return "/basics/taskInfoList";
|
||||
}
|
||||
/**
|
||||
* 进入用户添加或修改页面
|
||||
*/
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(TaskInfo taskInfo, Model model) {
|
||||
if(taskInfo.getId()!=null){
|
||||
taskInfo = taskInfoService.getTaskInfoById(taskInfo.getId());
|
||||
model.addAttribute("taskInfo", taskInfo);
|
||||
}else{
|
||||
model.addAttribute("taskInfo", taskInfo);
|
||||
}
|
||||
return "/basics/taskInfoForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/修改
|
||||
*/
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(TaskInfo taskInfo, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
if(taskInfo.getId()!=null){
|
||||
// 保存用户信息
|
||||
logger.info(taskInfo.getId()+"修改成功");
|
||||
taskInfoService.saveOrUpdate(taskInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
}else{
|
||||
if (!"true".equals(checkTaskName(taskInfo.getTaskName()))){
|
||||
logger.info(taskInfo.getTaskName()+"重复数据");
|
||||
addMessage(model, "error");
|
||||
return form(taskInfo, model);
|
||||
}
|
||||
// 保存用户信息
|
||||
taskInfoService.saveOrUpdate(taskInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
logger.info(taskInfo.getId()+"保存成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
e.printStackTrace();
|
||||
addMessage(model, "error");
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/taskInfo/list?repage";
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否有效
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "checkTaskName")
|
||||
public String checkTaskName(String taskName) {
|
||||
if (taskName !=null && taskInfoService.getTaskInfoByTaskName(taskName) == null) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
* @param taskInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "taskExamine")
|
||||
public String taskExamine(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] exId = ids.split(",");
|
||||
taskInfoService.taskExamine(exId);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/basics/taskInfo/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 审核未通过
|
||||
* @param taskInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "taskExamineNo")
|
||||
public String taskExamineNo(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] noId = ids.split(",");
|
||||
taskInfoService.taskExamineNo(noId);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/basics/taskInfo/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 取消审核
|
||||
* @param taskInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "taskCancelExamine")
|
||||
public String taskCancelExamine(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] canclelId = ids.split(",");
|
||||
taskInfoService.taskCancelExamine(canclelId);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/basics/taskInfo/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param taskInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "delete")
|
||||
public String delete(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] delId = ids.split(",");
|
||||
taskInfoService.delete(delId);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/basics/taskInfo/list?repage";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,20 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.TaskInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface TaskInfoDao extends CrudDao<TaskInfo>{
|
||||
List<TaskInfo> findTaskInfo(TaskInfo requestInfo);
|
||||
|
||||
TaskInfo getTaskInfoByTaskName(@Param("taskName") String taskName);
|
||||
|
||||
TaskInfo getTaskInfoById(@Param("id") Long id);
|
||||
|
||||
void delete(@Param("id") Long id);
|
||||
|
||||
}
|
||||
@@ -30,10 +30,55 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from task_info
|
||||
<!-- 查询列表 -->
|
||||
<select id="findTaskInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
r.id AS id,
|
||||
r.task_name AS taskName,
|
||||
r.task_org AS taskOrg,
|
||||
r.task_time AS taskTime,
|
||||
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 task_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="taskName != null and taskName != ''">
|
||||
AND r.task_name like
|
||||
<if test="dbName == 'mysql'">CONCAT('%',#{taskName}, '%')</if>
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.is_audit=${isAudit}
|
||||
</if>
|
||||
<if test="beginDate!=null and beginDate!='' and endDate!=null and endDate!=''">
|
||||
AND r.task_time between #{beginDate} and #{endDate}
|
||||
</if>
|
||||
<if test="dobeginDate!=null and dobeginDate!='' and doendDate!=null and doendDate!=''">
|
||||
AND (r.create_time between #{dobeginDate} and #{doendDate}) or (r.audit_time between #{dobeginDate} and #{doendDate})
|
||||
</if>
|
||||
order by r.task_time desc
|
||||
</select>
|
||||
<!-- 根据来函号查询 -->
|
||||
<select id="getTaskInfoByTaskName" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from task_info
|
||||
where task_name = #{taskName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<!-- 根据来id查询 -->
|
||||
<select id="getTaskInfoById" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from task_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
</select>
|
||||
<insert id="insert" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
insert into task_info (id, task_name, task_org,
|
||||
task_time, task_desc, is_valid,
|
||||
@@ -46,92 +91,8 @@
|
||||
#{editorId,jdbcType=INTEGER}, #{editTime,jdbcType=DATE}, #{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=DATE})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
insert into task_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="taskName != null">
|
||||
task_name,
|
||||
</if>
|
||||
<if test="taskOrg != null">
|
||||
task_org,
|
||||
</if>
|
||||
<if test="taskTime != null">
|
||||
task_time,
|
||||
</if>
|
||||
<if test="taskDesc != null">
|
||||
task_desc,
|
||||
</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="taskName != null">
|
||||
#{taskName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taskOrg != null">
|
||||
#{taskOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taskTime != null">
|
||||
#{taskTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="taskDesc != null">
|
||||
#{taskDesc,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="updateByPrimaryKeySelective" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
|
||||
<update id="update" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
update task_info
|
||||
<set>
|
||||
<if test="taskName != null">
|
||||
@@ -173,20 +134,14 @@
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
update task_info
|
||||
set task_name = #{taskName,jdbcType=VARCHAR},
|
||||
task_org = #{taskOrg,jdbcType=VARCHAR},
|
||||
task_time = #{taskTime,jdbcType=DATE},
|
||||
task_desc = #{taskDesc,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 id="delete" parameterType="long">
|
||||
update task_info
|
||||
<set>
|
||||
<if test="id != null and id != ''">
|
||||
is_valid=-1
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT} and is_audit !=1
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.TaskInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.TaskInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TaskInfoService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private TaskInfoDao taskInfoDao;
|
||||
|
||||
public Page<TaskInfo> findTaskInfo(Page<TaskInfo> page, TaskInfo taskInfo) {
|
||||
// 设置分页参数
|
||||
taskInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
page.setList(taskInfoDao.findTaskInfo(taskInfo));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void saveOrUpdate(TaskInfo taskInfo) {
|
||||
if (StringUtil.isEmpty(taskInfo.getId())) {
|
||||
//设置默认参数值
|
||||
taskInfo.setIsValid(1);//有效
|
||||
taskInfo.setIsAudit(0);//未审核
|
||||
taskInfo.setCreatorId((UserUtils.getUser().getId()).intValue());//创建人员
|
||||
taskInfo.setCreateTime(new Date());//创建时间
|
||||
taskInfoDao.insert(taskInfo);
|
||||
}else{
|
||||
taskInfo.setEditorId((UserUtils.getUser().getId()).intValue());//修改人员
|
||||
taskInfo.setEditTime(new Date());//修改时间
|
||||
taskInfoDao.update(taskInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public TaskInfo getTaskInfoByTaskName(String taskName) {
|
||||
|
||||
return taskInfoDao.getTaskInfoByTaskName(taskName);
|
||||
}
|
||||
public TaskInfo getTaskInfoById(Long id) {
|
||||
|
||||
return taskInfoDao.getTaskInfoById(id);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void taskExamine(String[] exId){
|
||||
TaskInfo taskInfo = new TaskInfo();
|
||||
for (int i = 0; i < exId.length; i++) {
|
||||
taskInfo.setId(Long.valueOf(exId[i]));
|
||||
taskInfo.setIsAudit(1);//审核通过
|
||||
taskInfo.setAuditTime(new Date());
|
||||
taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
taskInfoDao.update(taskInfo);
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void taskExamineNo(String[] noId){
|
||||
TaskInfo taskInfo = new TaskInfo();
|
||||
for (int i = 0; i < noId.length; i++) {
|
||||
taskInfo.setId(Long.valueOf(noId[i]));
|
||||
taskInfo.setIsAudit(2);//审核未通过
|
||||
taskInfo.setAuditTime(new Date());
|
||||
taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
taskInfoDao.update(taskInfo);
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void taskCancelExamine(String[] cancelId){
|
||||
TaskInfo taskInfo = new TaskInfo();
|
||||
for (int i = 0; i < cancelId.length; i++) {
|
||||
taskInfo.setId(Long.valueOf(cancelId[i]));
|
||||
taskInfo.setIsAudit(3);//取消审核通过
|
||||
taskInfo.setAuditTime(new Date());
|
||||
taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
taskInfoDao.update(taskInfo);
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void delete(String[] delId){
|
||||
for (int i = 0; i < delId.length; i++) {
|
||||
taskInfoDao.delete(Long.valueOf(delId[i]));//删除
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,8 @@ public class RequestInfoService extends BaseService{
|
||||
for (int i = 0; i < exId.length; i++) {
|
||||
requestInfo.setId(Long.valueOf(exId[i]));
|
||||
requestInfo.setIsAudit(1);//审核通过
|
||||
requestInfo.setAuditTime(new Date());
|
||||
requestInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
requestInfoDao.update(requestInfo);
|
||||
}
|
||||
}
|
||||
@@ -76,6 +78,8 @@ public class RequestInfoService extends BaseService{
|
||||
for (int i = 0; i < noId.length; i++) {
|
||||
requestInfo.setId(Long.valueOf(noId[i]));
|
||||
requestInfo.setIsAudit(2);//审核未通过
|
||||
requestInfo.setAuditTime(new Date());
|
||||
requestInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
requestInfoDao.update(requestInfo);
|
||||
}
|
||||
}
|
||||
@@ -85,6 +89,8 @@ public class RequestInfoService extends BaseService{
|
||||
for (int i = 0; i < cancelId.length; i++) {
|
||||
requestInfo.setId(Long.valueOf(cancelId[i]));
|
||||
requestInfo.setIsAudit(3);//取消审核通过
|
||||
requestInfo.setAuditTime(new Date());
|
||||
requestInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
requestInfoDao.update(requestInfo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user