组织增加审核功能
This commit is contained in:
parent
01c74da3b8
commit
50f1fb236a
|
|
@ -1,15 +1,14 @@
|
|||
package com.ruoyi.web.controller.front;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.front.domain.ServiceOrganization;
|
||||
|
|
@ -123,4 +122,29 @@ public class ServiceOrganizationController extends BaseController
|
|||
{
|
||||
return toAjax(serviceOrganizationService.deleteServiceOrganizationByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增服务组织
|
||||
*/
|
||||
@GetMapping("/audit")
|
||||
public String audit(@RequestParam String ids, ModelMap mmap)
|
||||
{
|
||||
mmap.put("ids", ids);
|
||||
return prefix + "/audit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核服务组织
|
||||
*/
|
||||
@PostMapping("/audit")
|
||||
@ResponseBody
|
||||
public AjaxResult audit(@RequestParam() String ids, @RequestParam String auditStatus, String remark)
|
||||
{
|
||||
// 未审核通过,则备注不能为空
|
||||
if (StringUtils.isEmpty(remark) && auditStatus.equals(Constants.NO_PASS_AUDIT)) {
|
||||
return error("备注不能为空");
|
||||
}
|
||||
|
||||
return toAjax(serviceOrganizationService.audit(ids, auditStatus, remark));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1227,7 +1227,20 @@ var table = {
|
|||
$.modal.alertError(result.msg);
|
||||
}
|
||||
$.modal.closeLoading();
|
||||
}
|
||||
},
|
||||
|
||||
// 审核信息
|
||||
auditAll: function() {
|
||||
table.set();
|
||||
let rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请至少选择一条记录");
|
||||
return;
|
||||
}
|
||||
|
||||
let url = table.options.auditUrl.concat("?ids=" + rows.join());
|
||||
$.modal.open("审核" + table.options.modalName, url);
|
||||
}
|
||||
},
|
||||
// 校验封装处理
|
||||
validate: {
|
||||
|
|
|
|||
|
|
@ -106,4 +106,19 @@ public class Constants
|
|||
* 未删除
|
||||
*/
|
||||
public static final String NO_DELETE = "0";
|
||||
|
||||
/**
|
||||
* 待审核
|
||||
*/
|
||||
public static final String WAIT_AUDIT = "0";
|
||||
|
||||
/**
|
||||
* 审核不通过
|
||||
*/
|
||||
public static final String NO_PASS_AUDIT = "1";
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*/
|
||||
public static final String PASS_AUDIT = "2";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@
|
|||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.front.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.front.domain.ServiceOrganization;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 服务组织Mapper接口
|
||||
|
|
@ -58,4 +59,13 @@ public interface ServiceOrganizationMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteServiceOrganizationByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 审核组织
|
||||
* @param ids
|
||||
* @param auditStatus
|
||||
* @param remark
|
||||
* @return
|
||||
*/
|
||||
public int auditServiceOrganization(@Param("ids") String[] ids, @Param("auditStatus")String auditStatus, @Param("remark")String remark, @Param("checkBy")String checkBy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,13 @@ public interface IServiceOrganizationService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteServiceOrganizationById(Long id);
|
||||
|
||||
/**
|
||||
* 审核服务组织对象
|
||||
* @param ids 服务组织IDs
|
||||
* @param auditStatus 审核状态
|
||||
* @param remark 审核备注
|
||||
* @return
|
||||
*/
|
||||
public int audit(String ids, String auditStatus, String remark);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.front.service.impl;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.front.mapper.ServiceOrganizationMapper;
|
||||
|
|
@ -94,4 +96,18 @@ public class ServiceOrganizationServiceImpl implements IServiceOrganizationServi
|
|||
{
|
||||
return serviceOrganizationMapper.deleteServiceOrganizationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核服务组织对象
|
||||
* @param ids 服务组织IDs
|
||||
* @param auditStatus 审核状态
|
||||
* @param remark 审核备注
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int audit(String ids, String auditStatus, String remark)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
return serviceOrganizationMapper.auditServiceOrganization(Convert.toStrArray(ids), auditStatus, remark, user.getUserId().toString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,4 +138,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="auditServiceOrganization">
|
||||
update service_organization
|
||||
set check_by = #{checkBy},
|
||||
check_time = now(),
|
||||
remark = #{remark},
|
||||
audit_status = #{auditStatus}
|
||||
where id in
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('审核服务组织')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
<th:block th:include="include :: summernote-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-organization-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">审核状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="ids" name="ids" th:value="${ids}">
|
||||
<select name="auditStatus" th:with="type=${@dict.getType('audit_status')}" class="col-sm-8">
|
||||
<!-- 审核状态不等于0的才显示 -->
|
||||
<th:block th:each="dict : ${type}">
|
||||
<th:block th:if="${dict.dictValue ne '0'}">
|
||||
<!-- 默认显示审核通过 -->
|
||||
<option th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue eq '2'}"/>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" rows="5" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: summernote-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "front/organization"
|
||||
$("#form-organization-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/audit", $('#form-organization-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -68,11 +68,8 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="front:organization:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="front:organization:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
<a class="btn btn-primary multiple disabled" onclick="$.operate.auditAll()" shiro:hasPermission="front:organization:edit">
|
||||
<i class="fa fa-edit"></i> 审核
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="front:organization:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
|
|
@ -99,6 +96,7 @@
|
|||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
auditUrl: prefix + "/audit",
|
||||
modalName: "服务组织",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
|
|
|
|||
Loading…
Reference in New Issue