诉求类型管理接口及接口文档完成

master
liuqingkun 3 years ago
parent f2719bc46d
commit 2f0449075c
  1. 119
      doc/api.md
  2. 2
      doc/sql/mysql/business_increase.sql
  3. 33
      src/main/java/org/springblade/common/constant/BusinessConstant.java
  4. 57
      src/main/java/org/springblade/modules/business/controller/AppealRegController.java
  5. 74
      src/main/java/org/springblade/modules/business/controller/ServerDisputeConfController.java
  6. 59
      src/main/java/org/springblade/modules/business/dto/ServerWindowsDisputeDTO.java
  7. 4
      src/main/java/org/springblade/modules/business/entity/Appeal.java
  8. 3
      src/main/java/org/springblade/modules/business/entity/AppealMediation.java
  9. 3
      src/main/java/org/springblade/modules/business/entity/AppealMediationFile.java
  10. 3
      src/main/java/org/springblade/modules/business/entity/AppealReg.java
  11. 3
      src/main/java/org/springblade/modules/business/entity/AppealVisitor.java
  12. 30
      src/main/java/org/springblade/modules/business/entity/ServerWindowsDispute.java
  13. 26
      src/main/java/org/springblade/modules/business/mapper/ServerWindowsDisputeMapper.java
  14. 18
      src/main/java/org/springblade/modules/business/mapper/ServerWindowsDisputeMapper.xml
  15. 62
      src/main/java/org/springblade/modules/business/service/IServerWindowsDisputeService.java
  16. 115
      src/main/java/org/springblade/modules/business/service/impl/ServerWindowsDisputeServiceImpl.java
  17. 59
      src/main/java/org/springblade/modules/business/vo/ServerWindowsDisputeVO.java

@ -91,107 +91,89 @@
|参数名称|参数类型|允许为空|参数说明|
| ---- | ---- | ---- | ---- |
|serverWindowId| long | N | 窗口ID |
|swId| long | N | 服务窗口ID |
- 返回示例
```json
{
"code": 200,
"success": true,
"data": [
{
"id": "1666700063321280514",
"tenantId": "000000",
"parentId": "1666626082400526337",
"code": "dispute_type",
"dictKey": "401",
"dictValue": "其他事项",
"sort": 401,
"remark": "",
"isSealed": 0,
"isDeleted": 0
},
{
"id": "1666626705640546306",
"tenantId": "000000",
"parentId": "1666625859938836481",
"code": "dispute_type",
"dictKey": "101",
"dictValue": "婚恋家庭纠纷",
"sort": 1,
"remark": "",
"isSealed": 0,
"isDeleted": 0
}
],
"msg": "操作成功"
"code": 200,
"success": true,
"data": [
{
"swId": "1666702666826436610",
"swName": "市卫健局",
"disputeIds": "1666699928344383490,1666629875083141122,1666697888226529282,1666697948918108162",
"disputeNames": "残疾人权益保障,劳动、社保纠纷,房产物业纠纷,涉法涉诉纠纷",
"status": 1
}
],
"msg": "操作成功"
}
```
### 2. 禁用/启用
### 2. 获取根据id获取详情
- 请求地址
`POST` `/blade-business/serverDisputeConf/enable`
`GET` `/blade-business/serverDisputeConf/detail`
- 请求参数
|参数名称|参数类型|允许为空|参数说明|
| ---- | ---- | ---- | ---- |
| id | long | N | 关联记录ID |
|swId| long | N | 服务窗口ID |
- 返回示例
```json
{
"code": 200,
"success": true,
"data": "",
"msg": "操作成功"
"code": 200,
"success": true,
"data": {
"swId": "1666702666826436610",
"swName": "市卫健局",
"disputeIds": "1666699928344383490,1666629875083141122,1666697888226529282,1666697948918108162",
"disputeNames": "残疾人权益保障,劳动、社保纠纷,房产物业纠纷,涉法涉诉纠纷",
"status": 1
},
"msg": "操作成功"
}
```
### 3. 删除
### 3. 禁用/启用
- 请求地址
`POST` `/blade-business/serverDisputeConf/delete`
`POST` `/blade-business/serverDisputeConf/enable`
- 请求参数
|参数名称|参数类型|允许为空|参数说明|
| ---- | ---- | ---- | ---- |
| id | long | N | 关联记录ID |
|swId| long | N | 服务窗口ID |
- 返回示例
```json
{
"code": 200,
"success": true,
"data": "",
"msg": "操作成功"
"code": 200,
"success": true,
"data": {},
"msg": "操作成功"
}
```
### 4. 获取根据id获取详情
### 4. 删除
- 请求地址
`GET` `/blade-business/serverDisputeConf/detail`
`POST` `/blade-business/serverDisputeConf/delete`
- 请求参数
|参数名称|参数类型|允许为空|参数说明|
| ---- | ---- | ---- | ---- |
| id | long | N | 关联记录ID |
| swId | long | N | 服务窗口ID |
- 返回示例
```json
{
"code": 200,
"success": true,
"data": {
"id": "1666625605998895105",
"serverWindowId": "1666625235998895105",
"serverWindowName": "市交通局",
"disputeIds": "1666625605998898705,1666625605998894105",
"disputeNames": "交通事故,道路纠纷",
"status": 1
},
"msg": "操作成功"
"code": 200,
"success": true,
"data": {},
"msg": "操作成功"
}
```
@ -203,17 +185,26 @@
|参数名称|参数类型|允许为空|参数说明|
| ---- | ---- | ---- | ---- |
| id | long | N | 关联记录ID |
| serverWindowId | long | N | 服务窗口ID |
| swId | long | N | 服务窗口ID |
| disputeIds | string | N | 纠纷id, 多个以逗号分割 |
| status | int | N | 启用状态, 0:禁用, 1:启用 |
- 请求示例
```json
{
"swId": "1646019847",
"disputeIds": "123321,12341,5345",
"status": "1"
}
```
- 返回示例
```json
{
"code": 200,
"success": true,
"data": "",
"msg": "操作成功"
"code": 200,
"success": true,
"data": {},
"msg": "操作成功"
}
```

@ -1,2 +1,4 @@
alter table mp_appeal add column `source_type` int(4) default 0 COMMENT '数据来源 0:系统添加, 1:数据导入';
alter table mp_appeal add column `handle_dept` bigint COMMENT '数据录入时, 处理部门';
alter table mp_appeal_visitor add column `sort` int(10) COMMENT '排序';

@ -0,0 +1,33 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.common.constant;
/**
* 通用常量
*
* @author Chill
*/
public interface BusinessConstant {
/**
* 启用禁用, 0:禁用, 1:启用
*/
Integer ENABLE_CODE_ENABLE = 1;
Integer ENABLE_CODE_DISABLE = 0;
}

@ -22,8 +22,12 @@ import lombok.AllArgsConstructor;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tenant.annotation.TenantDS;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springblade.core.tool.api.R;
import org.springblade.modules.business.entity.AppealReg;
import org.springblade.modules.business.entity.ServerWindowsDispute;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 控制器
@ -38,5 +42,54 @@ import org.springframework.web.bind.annotation.RestController;
@Api(value = "诉求登记管理", tags = "诉求登记管理接口")
public class AppealRegController extends BladeController {
/**
* 列表
*
* @param appealStatus 诉求状态
* @param startTime 登记时间-开始
* @param endTime 登记时间-结束
* @param appealType 诉求类型
* @param windowId 处理窗口ID
* @param username 代表姓名
* @return
*/
@GetMapping("/list")
public R list(String appealStatus, String startTime, String endTime, String appealType, String windowId, String username) {
return null;
}
/**
* 导出
*
* @param appealStatus 诉求状态
* @param startTime 登记时间-开始
* @param endTime 登记时间-结束
* @param appealType 诉求类型
* @param windowId 处理窗口ID
* @param username 代表姓名
* @return
*/
@GetMapping("/export")
public R export(String appealStatus, String startTime, String endTime, String appealType, String windowId, String username) {
return null;
}
/**
* 根据id获取诉求信息, 上一次调解记录(点击"再次调解")
*
* @param appealId 诉求id
* @return
*/
@GetMapping("/getById")
public R getById(String appealId) {
return null;
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody Map<String, Object> entity) {
return null;
}
}

@ -1,31 +1,17 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.business.controller;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tenant.annotation.TenantDS;
import org.springblade.core.tool.api.R;
import org.springblade.modules.business.entity.ServerWindowsDispute;
import org.springblade.modules.business.service.IServerWindowsDisputeService;
import org.springblade.modules.business.vo.ServerWindowsDisputeVO;
import org.springframework.web.bind.annotation.*;
/**
* 控制器
* 诉求类型管理
*
* @author Chill
*/
@ -33,9 +19,55 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(CommonConstant.APPLICATION_NAME_BUSINESS + "/serverDisputeConf")
@AllArgsConstructor
@ApiSort(1)
@Api(value = "诉求类型管理", tags = "诉求类型管理接口")
public class ServerDisputeConfController extends BladeController {
IServerWindowsDisputeService swDisputeService;
/**
* 列表
*
* @param swId 窗口id
*/
@GetMapping("/getList")
public R getServerWindowList(Long swId) {
return R.data(swDisputeService.getServerWindowList(swId));
}
/**
* 获取根据id获取详情
*
* @param swId 窗口id
*/
@GetMapping("/detail")
public R detail(Long swId) {
return R.data(swDisputeService.detail(swId));
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody ServerWindowsDisputeVO entity) {
return R.status(swDisputeService.saveEntity(entity));
}
/**
* 禁用/启用
*
* @param swId 窗口id
*/
@PostMapping("/enable")
public R enable(Long swId) {
return R.status(swDisputeService.enable(swId));
}
/**
* 删除
*
* @param swId 窗口id
*/
@PostMapping("/delete")
public R delete(Long swId) {
return R.status(swDisputeService.delete(swId));
}
}

@ -0,0 +1,59 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.business.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 服务窗口-纠纷关联表
*
* @author Chill
*/
@Data
public class ServerWindowsDisputeDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 窗口ID
*/
private Long swId;
/**
* 窗口名称
*/
private String swName;
/**
* 纠纷字典id
*/
private Long disputeId;
/**
* 诉求名称字符串
*/
private String disputeName;
/**
* 状态 0:禁用, 1:启用
*/
private int status;
}

@ -19,19 +19,21 @@ package org.springblade.modules.business.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
/**
* 诉求表
*
* @author Chill
*/
@Data
@TableName("mp_appeal")
@EqualsAndHashCode(callSuper = true)
public class Appeal extends TenantEntity {
public class Appeal extends BaseEntity {
private static final long serialVersionUID = 1L;

@ -19,6 +19,7 @@ package org.springblade.modules.business.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
@ -31,7 +32,7 @@ import java.util.Date;
@Data
@TableName("mp_appeal_mediation")
@EqualsAndHashCode(callSuper = true)
public class AppealMediation extends TenantEntity {
public class AppealMediation extends BaseEntity {
private static final long serialVersionUID = 1L;

@ -19,6 +19,7 @@ package org.springblade.modules.business.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
/**
@ -29,7 +30,7 @@ import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("mp_appeal_mediation_file")
@EqualsAndHashCode(callSuper = true)
public class AppealMediationFile extends TenantEntity {
public class AppealMediationFile extends BaseEntity {
private static final long serialVersionUID = 1L;

@ -19,6 +19,7 @@ package org.springblade.modules.business.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
@ -31,7 +32,7 @@ import java.util.Date;
@Data
@TableName("mp_appeal_reg")
@EqualsAndHashCode(callSuper = true)
public class AppealReg extends TenantEntity {
public class AppealReg extends BaseEntity {
private static final long serialVersionUID = 1L;

@ -19,6 +19,7 @@ package org.springblade.modules.business.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
/**
@ -29,7 +30,7 @@ import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("mp_appeal_visitor")
@EqualsAndHashCode(callSuper = true)
public class AppealVisitor extends TenantEntity {
public class AppealVisitor extends BaseEntity {
private static final long serialVersionUID = 1L;

@ -17,29 +17,49 @@
package org.springblade.modules.business.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serializable;
/**
* 服务窗口-纠纷关联表
*
* @author Chill
*/
@Data
@TableName("mp_server_windows_dispute")
@EqualsAndHashCode(callSuper = true)
public class ServerWindowsDispute extends TenantEntity {
public class ServerWindowsDispute extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 诉求id
* 窗口id,即账号id
*/
private Long swId;
/**
* 窗口名称
*/
private Long swName;
/**
* 诉求登记Id
* 纠纷字典id
*/
private Long disputeId;
private String disputeId;
/**
* 纠纷名称
*/
private String disputeName;
/**
* 状态 0:禁用, 1:启用
*/
private Integer status;
}

@ -17,7 +17,13 @@
package org.springblade.modules.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.business.dto.ServerWindowsDisputeDTO;
import org.springblade.modules.business.entity.ServerWindowsDispute;
import org.springblade.modules.business.vo.ServerWindowsDisputeVO;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
@ -26,5 +32,25 @@ import org.springblade.modules.business.entity.ServerWindowsDispute;
*/
public interface ServerWindowsDisputeMapper extends BaseMapper<ServerWindowsDispute> {
/**
* 获取窗口,诉求配置列表
*
* @param swId 窗口id
* @return
*/
List<ServerWindowsDisputeDTO> getSwDisputeList(@Param("swId") Long swId);
/**
* 根据窗口id, 更新配置状态
*
* @param swId
*/
boolean updateStatusBySwId(@Param("swId") Long swId, @Param("status") int status);
/**
* 根据窗口id, 删除配置
*
* @param swId
*/
boolean deletedBySwId(@Param("swId") Long swId);
}

@ -2,4 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.business.mapper.ServerWindowsDisputeMapper">
<select id="getSwDisputeList" resultType="org.springblade.modules.business.dto.ServerWindowsDisputeDTO">
SELECT swd.sw_id AS swId, u.`name` AS swName, swd.dispute_id AS disputeId,
biz.dict_value AS disputeName, swd.`status`
FROM mp_server_windows_dispute swd
LEFT JOIN blade_dict_biz biz ON swd.dispute_id = biz.id
LEFT JOIN blade_user u ON swd.sw_id = u.id
<if test="swId != null and swId != ''">
WHERE swd.sw_id = #{swId}
</if>
</select>
<update id="updateStatusBySwId">
update mp_server_windows_dispute set `status` = #{status} where sw_id = #{swId}
</update>
<delete id="deletedBySwId">
delete from mp_server_windows_dispute where sw_id = #{swId}
</delete>
</mapper>

@ -1,29 +1,53 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.business.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.core.tool.api.R;
import org.springblade.modules.business.entity.ServerWindowsDispute;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.business.vo.ServerWindowsDisputeVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* 服务类
* 服务类
*
* @author BladeX
*/
public interface IServerWindowsDisputeService extends BaseService<ServerWindowsDispute> {
public interface IServerWindowsDisputeService extends IService<ServerWindowsDispute> {
/**
* 获取窗口,诉求配置列表
*
* @param swId
* @return
*/
List<ServerWindowsDisputeVO> getServerWindowList(Long swId);
/**
* 获取根据id获取详情
*
* @param swId 窗口id
*/
ServerWindowsDisputeVO detail(Long swId);
/**
* 保存
*/
boolean saveEntity(ServerWindowsDisputeVO vo);
/**
* 禁用/启用
*
* @param swId 窗口id
*/
boolean enable(Long swId);
/**
* 删除
*
* @param swId 窗口id
*/
boolean delete(Long swId);
}

@ -1,27 +1,20 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.business.service.impl;
import org.springblade.common.constant.BusinessConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.business.dto.ServerWindowsDisputeDTO;
import org.springblade.modules.business.entity.ServerWindowsDispute;
import org.springblade.modules.business.mapper.ServerWindowsDisputeMapper;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.business.service.IServerWindowsDisputeService;
import org.springblade.modules.business.vo.ServerWindowsDisputeVO;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 服务实现类
*
@ -30,4 +23,94 @@ import org.springframework.stereotype.Service;
@Service
public class ServerWindowsDisputeServiceImpl extends BaseServiceImpl<ServerWindowsDisputeMapper, ServerWindowsDispute> implements IServerWindowsDisputeService {
@Override
public List<ServerWindowsDisputeVO> getServerWindowList(Long swId) {
List<ServerWindowsDisputeDTO> dtoList = baseMapper.getSwDisputeList(swId);
List<ServerWindowsDisputeVO> voList = new ArrayList<>();
if (Func.isEmpty(dtoList)) {
return voList;
}
Map<Long, List<ServerWindowsDisputeDTO>> map = dtoList.stream().collect(Collectors.groupingBy(ServerWindowsDisputeDTO::getSwId));
map.values().forEach(swdList -> {
ServerWindowsDisputeDTO dto = swdList.get(0);
String disputeIds = swdList.stream().map(ServerWindowsDisputeDTO::getDisputeId).map(String::valueOf).collect(Collectors.joining(","));
String disputeNames = swdList.stream().map(ServerWindowsDisputeDTO::getDisputeName).collect(Collectors.joining(","));
ServerWindowsDisputeVO vo = new ServerWindowsDisputeVO();
vo.setSwId(dto.getSwId());
vo.setSwName(dto.getSwName());
vo.setDisputeIds(disputeIds);
vo.setDisputeNames(disputeNames);
vo.setStatus(dto.getStatus());
voList.add(vo);
});
return voList;
}
@Override
public ServerWindowsDisputeVO detail(Long swId) {
List<ServerWindowsDisputeDTO> dtoList = baseMapper.getSwDisputeList(swId);
if (Func.isEmpty(dtoList)) {
return null;
}
ServerWindowsDisputeDTO dto = dtoList.get(0);
String disputeIds = dtoList.stream().map(ServerWindowsDisputeDTO::getDisputeId).map(String::valueOf).collect(Collectors.joining(","));
String disputeNames = dtoList.stream().map(ServerWindowsDisputeDTO::getDisputeName).collect(Collectors.joining(","));
ServerWindowsDisputeVO vo = new ServerWindowsDisputeVO();
vo.setSwId(dto.getSwId());
vo.setSwName(dto.getSwName());
vo.setDisputeIds(disputeIds);
vo.setDisputeNames(disputeNames);
vo.setStatus(dto.getStatus());
return vo;
}
@Override
public boolean saveEntity(ServerWindowsDisputeVO vo) {
if (Func.isEmpty(vo.getDisputeIds())) {
return false;
}
// 先删除原来的配置
delete(vo.getSwId());
List<ServerWindowsDispute> saveList = new ArrayList<>();
String[] disputeIdList = vo.getDisputeIds().split(",");
for (String s : disputeIdList) {
ServerWindowsDispute dispute = new ServerWindowsDispute();
dispute.setSwId(vo.getSwId());
dispute.setDisputeId(s);
dispute.setStatus(vo.getStatus());
saveList.add(dispute);
}
return saveBatch(saveList);
}
@Override
public boolean enable(Long swId) {
List<ServerWindowsDisputeDTO> dtoList = baseMapper.getSwDisputeList(swId);
if (Func.isEmpty(dtoList)) {
return false;
}
// 若原状态为启用, 更新为禁用, 若原状态为禁用, 更新为启用
ServerWindowsDisputeDTO dto = dtoList.get(0);
if (BusinessConstant.ENABLE_CODE_DISABLE == dto.getStatus()) {
return baseMapper.updateStatusBySwId(swId, BusinessConstant.ENABLE_CODE_ENABLE);
} else {
return baseMapper.updateStatusBySwId(swId, BusinessConstant.ENABLE_CODE_DISABLE);
}
}
@Override
public boolean delete(Long swId) {
return baseMapper.deletedBySwId(swId);
}
}

@ -0,0 +1,59 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.modules.business.vo;
import lombok.Data;
import java.io.Serializable;
/**
* 服务窗口-纠纷关联表
*
* @author Chill
*/
@Data
public class ServerWindowsDisputeVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 窗口ID
*/
private Long swId;
/**
* 窗口名称
*/
private String swName;
/**
* 纠纷字典id, 以逗号分割
*/
private String disputeIds;
/**
* 诉求名称字符串, 以逗号分割
*/
private String disputeNames;
/**
* 状态 0:禁用, 1:启用
*/
private int status;
}
Loading…
Cancel
Save