增加批量停用,批量启用功能
This commit is contained in:
parent
59397acce7
commit
1397656937
|
|
@ -147,4 +147,14 @@ public class ServiceOrganizationController extends BaseController
|
|||
|
||||
return toAjax(serviceOrganizationService.audit(ids, auditStatus, remark));
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用或者启用
|
||||
*/
|
||||
@PostMapping("/updateStatus")
|
||||
@ResponseBody
|
||||
public AjaxResult updateStatus(@RequestParam() String ids, @RequestParam String status)
|
||||
{
|
||||
return toAjax(serviceOrganizationService.updateStatus(ids, status));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1240,6 +1240,20 @@ var table = {
|
|||
|
||||
let url = table.options.auditUrl.concat("?ids=" + rows.join());
|
||||
$.modal.open("审核" + table.options.modalName, url);
|
||||
},
|
||||
|
||||
//启用or停用
|
||||
updateStatusAll: function(status) {
|
||||
table.set();
|
||||
let rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请至少选择一条记录");
|
||||
return;
|
||||
}
|
||||
|
||||
var url = table.options.updateStatusUrl;
|
||||
var data = { "ids": rows.join(), "status": status};
|
||||
$.operate.submit(url, "post", "json", data);
|
||||
}
|
||||
},
|
||||
// 校验封装处理
|
||||
|
|
|
|||
|
|
@ -68,4 +68,12 @@ public interface ServiceOrganizationMapper
|
|||
* @return
|
||||
*/
|
||||
public int auditServiceOrganization(@Param("ids") String[] ids, @Param("auditStatus")String auditStatus, @Param("remark")String remark, @Param("checkBy")String checkBy);
|
||||
|
||||
/**
|
||||
* 变更状态
|
||||
* @param ids 组织机构id
|
||||
* @param status 状态
|
||||
* @return
|
||||
*/
|
||||
public int updateStatus(@Param("ids") String[] ids, @Param("status")String status, @Param("updateBy")String updateBy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,4 +67,12 @@ public interface IServiceOrganizationService
|
|||
* @return
|
||||
*/
|
||||
public int audit(String ids, String auditStatus, String remark);
|
||||
|
||||
/**
|
||||
* 停用或者启用服务组织对象
|
||||
* @param ids 服务组织IDs
|
||||
* @param status 状态
|
||||
* @return
|
||||
*/
|
||||
public int updateStatus(String ids, String status);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.ruoyi.front.mapper.ServiceOrganizationMapper;
|
|||
import com.ruoyi.front.domain.ServiceOrganization;
|
||||
import com.ruoyi.front.service.IServiceOrganizationService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 服务组织Service业务层处理
|
||||
|
|
@ -104,10 +105,24 @@ public class ServiceOrganizationServiceImpl implements IServiceOrganizationServi
|
|||
* @param remark 审核备注
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@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());
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用或者启用服务组织对象
|
||||
* @param ids 服务组织IDs
|
||||
* @param status 状态
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateStatus(String ids, String status) {
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
return serviceOrganizationMapper.updateStatus(Convert.toStrArray(ids), status, user.getUserId().toString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,25 +28,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectServiceOrganizationVo">
|
||||
select id, name, contacts, phone, license_url, title, introduction, content, hits, audit_status, picture_url, status, del_flag, create_by, create_time, update_by, update_time, check_by, check_time, remark from service_organization
|
||||
select so.id, so.name, so.contacts, so.phone, so.license_url, so.title, so.introduction, so.content, so.hits, so.audit_status, so.picture_url, so.status,
|
||||
so.del_flag, so.create_by, so.create_time, so.update_by, so.update_time, su.user_name check_by, so.check_time, so.remark from service_organization so
|
||||
</sql>
|
||||
|
||||
<select id="selectServiceOrganizationList" parameterType="ServiceOrganization" resultMap="ServiceOrganizationResult">
|
||||
<include refid="selectServiceOrganizationVo"/>
|
||||
left join sys_user su on su.user_id = so.check_by
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="contacts != null and contacts != ''"> and contacts = #{contacts}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="licenseUrl != null and licenseUrl != ''"> and license_url = #{licenseUrl}</if>
|
||||
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||
<if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if>
|
||||
<if test="content != null and content != ''"> and content = #{content}</if>
|
||||
<if test="hits != null "> and hits = #{hits}</if>
|
||||
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
|
||||
<if test="pictureUrl != null and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="checkBy != null and checkBy != ''"> and check_by = #{checkBy}</if>
|
||||
<if test="checkTime != null "> and check_time = #{checkTime}</if>
|
||||
<if test="name != null and name != ''"> and so.name like concat('%', #{name}, '%')</if>
|
||||
<if test="contacts != null and contacts != ''"> and so.contacts = #{contacts}</if>
|
||||
<if test="phone != null and phone != ''"> and so.phone = #{phone}</if>
|
||||
<if test="licenseUrl != null and licenseUrl != ''"> and so.license_url = #{licenseUrl}</if>
|
||||
<if test="title != null and title != ''"> and so.title = #{title}</if>
|
||||
<if test="introduction != null and introduction != ''"> and so.introduction = #{introduction}</if>
|
||||
<if test="content != null and content != ''"> and so.content = #{content}</if>
|
||||
<if test="hits != null "> and so.hits = #{hits}</if>
|
||||
<if test="auditStatus != null and auditStatus != ''"> and so.audit_status = #{auditStatus}</if>
|
||||
<if test="pictureUrl != null and pictureUrl != ''"> and so.picture_url = #{pictureUrl}</if>
|
||||
<if test="status != null and status != ''"> and so.status = #{status}</if>
|
||||
<if test="checkBy != null and checkBy != ''"> and so.check_by = #{checkBy}</if>
|
||||
<if test="checkTime != null "> and so.check_time = #{checkTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -149,4 +151,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateStatus">
|
||||
update service_organization
|
||||
set update_by = #{updateBy},
|
||||
update_time = now(),
|
||||
status = #{status}
|
||||
where id in
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -68,12 +68,18 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-primary multiple disabled" onclick="$.operate.auditAll()" shiro:hasPermission="front:organization:edit">
|
||||
<a class="btn btn-success btn-xs 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> 删除
|
||||
<a class="btn btn-primary multiple disabled" onclick="$.operate.updateStatusAll('0')" shiro:hasPermission="front:organization:edit">
|
||||
<i class="fa fa-edit"></i> 启用
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.updateStatusAll('1')" shiro:hasPermission="front:organization:edit">
|
||||
<i class="fa fa-remove"></i> 停用
|
||||
</a>
|
||||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="front:organization:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>-->
|
||||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="front:organization:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>-->
|
||||
|
|
@ -87,6 +93,8 @@
|
|||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('front:organization:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('front:organization:remove')}]];
|
||||
var dictStatus = [[${@dict.getType('sys_normal_disable')}]];
|
||||
var dictAuditStatus = [[${@dict.getType('audit_status')}]];
|
||||
var prefix = ctx + "front/organization";
|
||||
|
||||
$(function() {
|
||||
|
|
@ -97,6 +105,7 @@
|
|||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
auditUrl: prefix + "/audit",
|
||||
updateStatusUrl: prefix + "/updateStatus",
|
||||
modalName: "服务组织",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
|
|
@ -140,7 +149,10 @@
|
|||
},
|
||||
{
|
||||
field: 'auditStatus',
|
||||
title: '审核状态'
|
||||
title: '审核状态',
|
||||
formatter: function(value, item, index) {
|
||||
return $.table.selectDictLabel(dictAuditStatus, item.auditStatus);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'pictureUrl',
|
||||
|
|
@ -148,7 +160,10 @@
|
|||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态'
|
||||
title: '状态',
|
||||
formatter: function(value, item, index) {
|
||||
return $.table.selectDictLabel(dictStatus, item.status);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'checkBy',
|
||||
|
|
@ -166,10 +181,10 @@
|
|||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
//var actions = [];
|
||||
//actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
//return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue