23 changed files with 1247 additions and 98 deletions
@ -0,0 +1,142 @@ |
|||
package com.zdxt.app.controller; |
|||
|
|||
import com.zdxt.code.domain.ComplaintItem; |
|||
import com.zdxt.code.service.IComplaintItemService; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
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.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 投诉事项Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-24 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/app/code/item") |
|||
public class AppComplaintItemController extends BaseController { |
|||
private String prefix = "code/item"; |
|||
|
|||
@Autowired |
|||
private IComplaintItemService complaintItemService; |
|||
|
|||
@GetMapping() |
|||
public String item() { |
|||
return prefix + "/item"; |
|||
} |
|||
|
|||
/** |
|||
* 查询投诉事项列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(ComplaintItem complaintItem) { |
|||
startPage(); |
|||
List<ComplaintItem> list = complaintItemService.selectComplaintItemList(complaintItem); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 查询投诉事项列表 |
|||
*/ |
|||
@GetMapping("/queryList") |
|||
@ResponseBody |
|||
public TableDataInfo queryList(ComplaintItem complaintItem) { |
|||
startPage(); |
|||
List<ComplaintItem> list = complaintItemService.selectComplaintItemList(complaintItem); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 新增投诉事项 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() { |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存投诉事项 |
|||
*/ |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public ZDResponse addSave(ComplaintItem complaintItem) { |
|||
int i = complaintItemService.insertComplaintItem(complaintItem); |
|||
return i > 0 ? ZDResponse.success("保存成功") : ZDResponse.error("保存失败"); |
|||
} |
|||
|
|||
/** |
|||
* 修改投诉事项 |
|||
*/ |
|||
@GetMapping("/edit/{id}") |
|||
public String edit(@PathVariable("id") String id, ModelMap mmap) { |
|||
ComplaintItem complaintItem = complaintItemService.selectComplaintItemById(id); |
|||
mmap.put("complaintItem", complaintItem); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存投诉事项 |
|||
*/ |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public ZDResponse editSave(ComplaintItem complaintItem) { |
|||
int i = complaintItemService.updateComplaintItem(complaintItem); |
|||
return i > 0 ? ZDResponse.success("修改成功") : ZDResponse.error("修改失败"); |
|||
} |
|||
|
|||
/** |
|||
* 删除投诉事项 |
|||
*/ |
|||
@PostMapping("/remove") |
|||
@ResponseBody |
|||
public ZDResponse remove(String ids) { |
|||
int i = complaintItemService.deleteComplaintItemByIds(ids); |
|||
return i > 0 ? ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
|||
} |
|||
|
|||
@PostMapping("/exportItem") |
|||
@ResponseBody |
|||
public void exportItem(MultipartFile file) throws Exception { |
|||
// String filePath = FileUploadUtils.getDefaultBaseDir();
|
|||
// File file1 = new File(filePath);
|
|||
// file.transferTo(file1);
|
|||
// File file1 = new File("C:\\Users\\soul\\Desktop\\执法监督码部署\\司法局投诉事项.xlsx");
|
|||
// JSONArray objects = ExcelUtils.readFile(file1);
|
|||
// for (int i = 0; i < objects.size(); i++) {
|
|||
// JSONObject jsonObject = objects.getJSONObject(i);
|
|||
// ComplaintItem complaintItem = new ComplaintItem();
|
|||
// complaintItem.setComplaintItemName(jsonObject.getString("subName"));
|
|||
// complaintItem.setComplaintItemCode(jsonObject.getString("itemCode"));
|
|||
// complaintItem.setSubName(jsonObject.getString("subName"));
|
|||
// complaintItemService.insertComplaintItem(complaintItem);
|
|||
// }
|
|||
} |
|||
|
|||
|
|||
public File transferToFile(MultipartFile multipartFile) { |
|||
// 选择用缓冲区来实现这个转换即使用java 创建的临时文件 使用 MultipartFile.transferto()方法 。
|
|||
File file = null; |
|||
try { |
|||
String originalFilename = multipartFile.getOriginalFilename(); |
|||
String[] filename = originalFilename.split("\\."); |
|||
file = File.createTempFile(filename[0], filename[1] + "."); |
|||
multipartFile.transferTo(file); |
|||
// file.deleteOnExit();
|
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return file; |
|||
} |
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
# 数据源配置 |
|||
spring: |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
druid: |
|||
# 主库数据源 |
|||
master: |
|||
url: jdbc:mysql://10.78.77.2:3306/zfjd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
|||
username: ENC(E5mY10bkGFBgN1Pljgzggg==) |
|||
password: ENC(oqD1IasQS57qOeOHFtBdAAemGwJ2I7BV) |
|||
# 从库数据源 |
|||
slave: |
|||
# 从数据源开关/默认关闭 |
|||
enabled: false |
|||
url: |
|||
username: |
|||
password: |
|||
# 初始连接数 |
|||
initialSize: 5 |
|||
# 最小连接池数量 |
|||
minIdle: 10 |
|||
# 最大连接池数量 |
|||
maxActive: 20 |
|||
# 配置获取连接等待超时的时间 |
|||
maxWait: 60000 |
|||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
|||
timeBetweenEvictionRunsMillis: 60000 |
|||
# 配置一个连接在池中最小生存的时间,单位是毫秒 |
|||
minEvictableIdleTimeMillis: 300000 |
|||
# 配置一个连接在池中最大生存的时间,单位是毫秒 |
|||
maxEvictableIdleTimeMillis: 900000 |
|||
# 配置检测连接是否有效 |
|||
validationQuery: SELECT 1 FROM DUAL |
|||
testWhileIdle: true |
|||
testOnBorrow: false |
|||
testOnReturn: false |
|||
webStatFilter: |
|||
enabled: true |
|||
statViewServlet: |
|||
enabled: true |
|||
# 设置白名单,不填则允许所有访问 |
|||
allow: |
|||
url-pattern: /druid/* |
|||
# 控制台管理用户名和密码 |
|||
login-username: |
|||
login-password: |
|||
filter: |
|||
stat: |
|||
enabled: true |
|||
# 慢SQL记录 |
|||
log-slow-sql: true |
|||
slow-sql-millis: 1000 |
|||
merge-sql: true |
|||
wall: |
|||
config: |
|||
multi-statement-allow: true |
|||
# PageHelper分页插件 |
|||
pagehelper: |
|||
helperDialect: mysql |
|||
reasonable: true |
|||
supportMethodsArguments: true |
|||
params: count=countSql |
|||
|
|||
# MybatisPlus |
|||
mybatis-plus: |
|||
config-location: classpath:mapper/mybatis-config.xml |
|||
mapper-locations: classpath*:mapper/**/*Mapper.xml |
|||
typeAliasesPackage: com.zdxt.**.domain |
|||
|
|||
largeScreenConfig: DatasourcesCofig.xml |
|||
@ -0,0 +1,111 @@ |
|||
# Spring配置 |
|||
spring: |
|||
# redis配置 |
|||
redis: |
|||
database: 0 |
|||
host: 10.78.77.1 |
|||
port: 6379 |
|||
password: zfjd@123 |
|||
# host: 43.136.51.161 |
|||
# port: 6379 |
|||
# password: meiyoumima |
|||
timeout: 6000ms # 连接超时时长(毫秒) |
|||
lettuce: |
|||
pool: |
|||
max-active: 10 # 连接池最大连接数(使用负值表示没有限制) |
|||
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) |
|||
max-idle: 3 # 连接池中的最大空闲连接 |
|||
min-idle: 2 # 连接池中的最小空闲连接 |
|||
xxl: |
|||
job: |
|||
status: false #启用状态 false 关闭 |
|||
accessToken: default_token |
|||
admin: |
|||
addresses: http://127.0.0.1:8080/xxl-job-admin #注册地址 |
|||
executor: |
|||
address: '' |
|||
appname: zdxt #系统标识名称 |
|||
ip: '' |
|||
logpath: /data/applogs/xxl-job/jobhandler |
|||
logretentiondays: -1 |
|||
port: 9999 |
|||
|
|||
|
|||
|
|||
allowed: |
|||
servernames: 10.76.108.1,10.76.108.3,10.132.108.3,jdm.szssfj.cn,58.250.157.161,127.0.0.1,localhost,192.168.110.35,192.168.110.41 |
|||
|
|||
excel: |
|||
export: true |
|||
import: true |
|||
|
|||
# 粤政易对接令牌信息 |
|||
yzy: |
|||
yzyUrl: http://50.9.11.153 |
|||
corpid: 123456 |
|||
corpsecret: 88761 |
|||
paasid: 123 |
|||
|
|||
|
|||
#qr_code_url: C:\ruoyi\uploadPath\zfjd_logo.png |
|||
qr_code_url: /usr/local/uploads/zfjd_logo.png |
|||
#qr_code_url: /Users/kylin_stone/Workspaces/uploads/zfjd_logo.png |
|||
|
|||
#深i企对接密钥 测试环境 |
|||
siq: |
|||
#正式 |
|||
# siqUrl: http://10.76.108.3/siqApi |
|||
# code: zfjdm |
|||
# secretKey: SXRpWEhVN3RHM3ZFbzRQcQ== |
|||
#测试 |
|||
siqUrl: http://egbpub.siqhz.com/egb/api/thirdauth |
|||
code: zfjdm |
|||
# secretKey: eWIzY3BMRVNEQXhvUUlXMA== |
|||
secretKey: ENC(zTr/tj2VgFxQyunI4eIL7NyRWDPSMPSB0VlwTYeHTdsEWyu1H96xWw==) |
|||
|
|||
#深圳易平台对接密钥 |
|||
szypt: |
|||
#测试 |
|||
agentid: ENC(JHe/LoW7bh5Cxpn8BJ2Q6Q==) |
|||
url: ENC(pRnuGFcSRfkkLTp7NLU5EvD5QpSdkobiPlxjRhGE5l/Uvrur9isTzMkqYoYgMrHt) |
|||
corpid: ENC(jrCQGAujvdFRc5tCE8g8oM9F0Ln7shZoXB7WeM3Tzhs=) |
|||
corpsecret: ENC(Z8hjBADO1lZDAhOB7/ku9FpPIkYk4mGwyFH01vSwefMxweTeGaMuajSc9vD4bPL1wdgVhS/ZPeI=) |
|||
|
|||
#市认证网关 |
|||
srnwg: |
|||
#正式 |
|||
url: ENC(pHNm/o0+6S+HjrM5nuMiPRfkrHS1tXYD5i25OBtM4dWSi6MvH6iXfw==) |
|||
systemCode: ENC(cHDdxMKpJ/rbuj4PVCxylN+zPd9I2KT0) |
|||
integrationKey: ENC(txSndcPbZK5mYjW7Doa/n9Ips2PLa9NV) |
|||
paasId: szsfj_zhifajianduma_001 |
|||
paasToken: ENC(VfUgR5OXHJcKvBBfq/2ysuNPH6I7tCCeWHYSzXKicGChlMiw9mVPGD51naX9w42E) |
|||
#市认证数据加密字符 |
|||
secretKey: ENC(xWBA5VwT23j14A8+6I15HCerJvo3zaRxzVE2xc0i7wZ7wq/SCflOEkHCc8wwdi0KHkDGjKIoHhs=) |
|||
# #测试 |
|||
# url: ENC(jFwf6bYIMn+FOtbCkyPr0r+TBOPrp84tNotl912ilUZy2e9Y8cbH3uDQ5jtr6SAa) |
|||
# systemCode: ENC(ECOnqNVVPmCmnqhde6tsS5JEQYPtlmCv) |
|||
# integrationKey: ENC(8RZtrfL4t5tsEk7lfrw00+4hSxbjxcVM) |
|||
# paasId: szsfj_zhifajianduma_001 |
|||
# paasToken: ENC(0Cg8Vtpay+3hwRm+vJB0utikr4dXcEguwSaxlbTWkgQ4parB8pN2rL2xrhQ8eUd5) |
|||
|
|||
|
|||
#测试 |
|||
mssq: |
|||
appId: ENC(iYSWCYHguGJTOxTcUjFcq4Tkp0HpU/7UqmxGtda3ORKF7a5UZiz612YlxZ9I4zL+) |
|||
appKey: ENC(m81tKAp6NtfW/97e3NNfnfq/1TN79M9JL9UY82dhKPxWJkedAuRJPNDBULZDv4ue5vFXcAHDGtWMsH6flq06B7MdjoYGrDc7) |
|||
apiUrl: ENC(2fR5TkUb/A0p4+Gp/As+LJsVCjq7pgNwJIG2OAk2yWLXY/q7DNaCDQ==) |
|||
hcpappid: zfjdm |
|||
hcpsign: ENC(SZL+KT860YpMBuK6GbNWTp0TYVeSu/DTYjKPRCm5xVJk9tI+O6/hqsE5zH9orApgjX6ggAS2hbGefmUsJwIkos0YtIgueK89ilDHtEy6/S0RWrnoi6F9aByxVG/mAwPxTPIXxwUECjvuET1rByTi7juNbufzWzJfYrH4dFXLmzbF5Cv5jJHM8R7Rq6DGL9X9UCqmROJygXv9KvrxN3OcnVoTHb0wQepEq6kplkd3SswLnPSDpb7q5vcs1XMxYcFRDLyqjmQYVRcx3HMsQZOGkTahOdzIfI/tL4D4upgYK1TFpaCiBL98vX/bh/s9RPmiHkyqMd8/R/NnoB8q5/5LldqxBhPCBi6RbPFGM/UfojdXeS5z2Uk/2w==) |
|||
hcptimestamp: 20240710172956 |
|||
#正式 |
|||
#mssq: |
|||
# appId: 30cd632d18c24bc2b476535494327987 |
|||
# appKey: MzBjZDYzMmQxOGMyNGJjMmI0NzY1MzU0OTQzMjc5ODc6U3pzejIwMjQ= |
|||
# apiUrl: http://10.224.158.101:8182/proxy/ |
|||
# hcpappid: zfjdm |
|||
# hcpsign: 0460493a4493a06d4e4bf20df7495b36b019b311312b4fe305450a4bfd9cb8e5cba00ef71698f67cfc68247c4f43c7b71d0ec9d18b9d8f0b68ac048d8af563c8f8eff55a02f28cf524af9ff82b0e9d3e59bf750b3a1bb38b6dbb3f2075600b941aaa68317d882622734ed068bcb1b2e496b05991dcfc31169934a0805ef7abcf7371daff66ea |
|||
# hcptimestamp: 20240801142433 |
|||
#短信平台 |
|||
sms: |
|||
account: 122 |
|||
pwd: szsfj1800 |
|||
@ -0,0 +1,44 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改投诉事项')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-item-edit" th:object="${complaintItem}"> |
|||
<input name="id" th:field="*{id}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">投诉事项编码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="complaintItemCode" th:field="*{complaintItemCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">投诉事项名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="complaintItemName" th:field="*{complaintItemName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">执法主体名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="subName" th:field="*{subName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script type="text/javascript"> |
|||
var prefix = ctx + "system/item"; |
|||
$("#form-item-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-item-edit').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,97 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('投诉事项列表')" /> |
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<p>投诉事项编码:</p> |
|||
<input type="text" name="complaintItemCode"/> |
|||
</li> |
|||
<li> |
|||
<p>投诉事项名称:</p> |
|||
<input type="text" name="complaintItemName"/> |
|||
</li> |
|||
<li> |
|||
<p>执法主体名称:</p> |
|||
<input type="text" name="subName"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-reset btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
|
|||
<div class="btn-group-sm" id="toolbar" role="group"> |
|||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:item:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:item:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:item:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="zdxtInclude :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "system/item"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
modalName: "投诉事项", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field : 'id', |
|||
title : '主键ID', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field : 'complaintItemCode', |
|||
title : '投诉事项编码' |
|||
}, |
|||
{ |
|||
field : 'complaintItemName', |
|||
title : '投诉事项名称' |
|||
}, |
|||
{ |
|||
field : 'subName', |
|||
title : '执法主体名称' |
|||
}, |
|||
{ |
|||
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(''); |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,146 @@ |
|||
package com.zdxt.code.controller; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.zdxt.auth.common.utils.file.FileUploadUtils; |
|||
import com.zdxt.code.domain.ComplaintItem; |
|||
import com.zdxt.code.service.IComplaintItemService; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.ExcelUtils; |
|||
import com.zdxt.common.util.IdCardCryptoUtil; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
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.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
|
|||
/** |
|||
* 投诉事项Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-24 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/code/item") |
|||
public class ComplaintItemController extends BaseController { |
|||
private String prefix = "code/item"; |
|||
|
|||
@Autowired |
|||
private IComplaintItemService complaintItemService; |
|||
|
|||
@GetMapping() |
|||
public String item() { |
|||
return prefix + "/item"; |
|||
} |
|||
|
|||
/** |
|||
* 查询投诉事项列表 |
|||
*/ |
|||
@RequiresPermissions("system:item:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(ComplaintItem complaintItem) { |
|||
startPage(); |
|||
List<ComplaintItem> list = complaintItemService.selectComplaintItemList(complaintItem); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 新增投诉事项 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() { |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存投诉事项 |
|||
*/ |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public ZDResponse addSave(ComplaintItem complaintItem) { |
|||
int i = complaintItemService.insertComplaintItem(complaintItem); |
|||
return i > 0 ? ZDResponse.success("保存成功") : ZDResponse.error("保存失败"); |
|||
} |
|||
|
|||
/** |
|||
* 修改投诉事项 |
|||
*/ |
|||
@GetMapping("/edit/{id}") |
|||
public String edit(@PathVariable("id") String id, ModelMap mmap) { |
|||
ComplaintItem complaintItem = complaintItemService.selectComplaintItemById(id); |
|||
mmap.put("complaintItem", complaintItem); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存投诉事项 |
|||
*/ |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public ZDResponse editSave(ComplaintItem complaintItem) { |
|||
int i = complaintItemService.updateComplaintItem(complaintItem); |
|||
return i > 0 ? ZDResponse.success("修改成功") : ZDResponse.error("修改失败"); |
|||
} |
|||
|
|||
/** |
|||
* 删除投诉事项 |
|||
*/ |
|||
@PostMapping("/remove") |
|||
@ResponseBody |
|||
public ZDResponse remove(String ids) { |
|||
int i = complaintItemService.deleteComplaintItemByIds(ids); |
|||
return i > 0 ? ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
|||
} |
|||
|
|||
@PostMapping("/exportItem") |
|||
@ResponseBody |
|||
public void exportItem(MultipartFile file) throws Exception { |
|||
// String filePath = FileUploadUtils.getDefaultBaseDir();
|
|||
// File file1 = new File(filePath);
|
|||
// file.transferTo(file1);
|
|||
// File file1 = new File("C:\\Users\\soul\\Desktop\\执法监督码部署\\司法局投诉事项.xlsx");
|
|||
// JSONArray objects = ExcelUtils.readFile(file1);
|
|||
// for (int i = 0; i < objects.size(); i++) {
|
|||
// JSONObject jsonObject = objects.getJSONObject(i);
|
|||
// ComplaintItem complaintItem = new ComplaintItem();
|
|||
// complaintItem.setComplaintItemName(jsonObject.getString("subName"));
|
|||
// complaintItem.setComplaintItemCode(jsonObject.getString("itemCode"));
|
|||
// complaintItem.setSubName(jsonObject.getString("subName"));
|
|||
// complaintItemService.insertComplaintItem(complaintItem);
|
|||
// }
|
|||
} |
|||
|
|||
|
|||
public File transferToFile(MultipartFile multipartFile) { |
|||
// 选择用缓冲区来实现这个转换即使用java 创建的临时文件 使用 MultipartFile.transferto()方法 。
|
|||
File file = null; |
|||
try { |
|||
String originalFilename = multipartFile.getOriginalFilename(); |
|||
String[] filename = originalFilename.split("\\."); |
|||
file = File.createTempFile(filename[0], filename[1] + "."); |
|||
multipartFile.transferTo(file); |
|||
// file.deleteOnExit();
|
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return file; |
|||
} |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package com.zdxt.code.domain; |
|||
|
|||
import com.zdxt.common.BaseDomain; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
|
|||
/** |
|||
* 投诉事项对象 complaint_item |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-24 |
|||
*/ |
|||
public class ComplaintItem extends BaseDomain |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 主键ID */ |
|||
private String id; |
|||
|
|||
/** 投诉事项编码 */ |
|||
private String complaintItemCode; |
|||
|
|||
/** 投诉事项名称 */ |
|||
private String complaintItemName; |
|||
|
|||
/** 执法主体名称 */ |
|||
private String subName; |
|||
|
|||
public void setId(String id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setComplaintItemCode(String complaintItemCode) |
|||
{ |
|||
this.complaintItemCode = complaintItemCode; |
|||
} |
|||
|
|||
public String getComplaintItemCode() |
|||
{ |
|||
return complaintItemCode; |
|||
} |
|||
public void setComplaintItemName(String complaintItemName) |
|||
{ |
|||
this.complaintItemName = complaintItemName; |
|||
} |
|||
|
|||
public String getComplaintItemName() |
|||
{ |
|||
return complaintItemName; |
|||
} |
|||
public void setSubName(String subName) |
|||
{ |
|||
this.subName = subName; |
|||
} |
|||
|
|||
public String getSubName() |
|||
{ |
|||
return subName; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("complaintItemCode", getComplaintItemCode()) |
|||
.append("complaintItemName", getComplaintItemName()) |
|||
.append("subName", getSubName()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package com.zdxt.code.mapper; |
|||
|
|||
import com.zdxt.code.domain.ComplaintItem; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 投诉事项Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-24 |
|||
*/ |
|||
public interface ComplaintItemMapper |
|||
{ |
|||
/** |
|||
* 查询投诉事项 |
|||
* |
|||
* @param id 投诉事项ID |
|||
* @return 投诉事项 |
|||
*/ |
|||
ComplaintItem selectComplaintItemById(String id); |
|||
|
|||
/** |
|||
* 查询投诉事项详情 |
|||
* @param code |
|||
* @return |
|||
*/ |
|||
ComplaintItem selectComplaintItemByCode(String code); |
|||
|
|||
/** |
|||
* 通过统一信用代码查询投诉事项编码 |
|||
* @param code 部门统一信用代码 |
|||
* @return |
|||
*/ |
|||
List<ComplaintItem> selectComplaintItemCodeByNumber(String code); |
|||
|
|||
/** |
|||
* 查询投诉事项列表 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 投诉事项集合 |
|||
*/ |
|||
List<ComplaintItem> selectComplaintItemList(ComplaintItem complaintItem); |
|||
|
|||
/** |
|||
* 新增投诉事项 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 结果 |
|||
*/ |
|||
int insertComplaintItem(ComplaintItem complaintItem); |
|||
|
|||
/** |
|||
* 修改投诉事项 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 结果 |
|||
*/ |
|||
int updateComplaintItem(ComplaintItem complaintItem); |
|||
|
|||
/** |
|||
* 删除投诉事项 |
|||
* |
|||
* @param id 投诉事项ID |
|||
* @return 结果 |
|||
*/ |
|||
int deleteComplaintItemById(String id); |
|||
|
|||
/** |
|||
* 批量删除投诉事项 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
int deleteComplaintItemByIds(String[] ids); |
|||
} |
|||
@ -0,0 +1,63 @@ |
|||
package com.zdxt.code.service; |
|||
|
|||
|
|||
import com.zdxt.code.domain.ComplaintItem; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 投诉事项Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-24 |
|||
*/ |
|||
public interface IComplaintItemService |
|||
{ |
|||
/** |
|||
* 查询投诉事项 |
|||
* |
|||
* @param id 投诉事项ID |
|||
* @return 投诉事项 |
|||
*/ |
|||
ComplaintItem selectComplaintItemById(String id); |
|||
|
|||
/** |
|||
* 查询投诉事项列表 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 投诉事项集合 |
|||
*/ |
|||
List<ComplaintItem> selectComplaintItemList(ComplaintItem complaintItem); |
|||
|
|||
/** |
|||
* 新增投诉事项 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 结果 |
|||
*/ |
|||
int insertComplaintItem(ComplaintItem complaintItem); |
|||
|
|||
/** |
|||
* 修改投诉事项 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 结果 |
|||
*/ |
|||
int updateComplaintItem(ComplaintItem complaintItem); |
|||
|
|||
/** |
|||
* 批量删除投诉事项 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
int deleteComplaintItemByIds(String ids); |
|||
|
|||
/** |
|||
* 删除投诉事项信息 |
|||
* |
|||
* @param id 投诉事项ID |
|||
* @return 结果 |
|||
*/ |
|||
int deleteComplaintItemById(String id); |
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
package com.zdxt.code.service.impl; |
|||
|
|||
import java.util.List; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.convert.Convert; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import com.zdxt.code.domain.ComplaintItem; |
|||
import com.zdxt.code.mapper.ComplaintItemMapper; |
|||
import com.zdxt.code.service.IComplaintItemService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
/** |
|||
* 投诉事项Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-24 |
|||
*/ |
|||
@Service |
|||
public class ComplaintItemServiceImpl implements IComplaintItemService |
|||
{ |
|||
@Autowired |
|||
private ComplaintItemMapper complaintItemMapper; |
|||
|
|||
/** |
|||
* 查询投诉事项 |
|||
* |
|||
* @param id 投诉事项ID |
|||
* @return 投诉事项 |
|||
*/ |
|||
@Override |
|||
public ComplaintItem selectComplaintItemById(String id) |
|||
{ |
|||
return complaintItemMapper.selectComplaintItemById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询投诉事项列表 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 投诉事项 |
|||
*/ |
|||
@Override |
|||
public List<ComplaintItem> selectComplaintItemList(ComplaintItem complaintItem) |
|||
{ |
|||
return complaintItemMapper.selectComplaintItemList(complaintItem); |
|||
} |
|||
|
|||
/** |
|||
* 新增投诉事项 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertComplaintItem(ComplaintItem complaintItem) |
|||
{ |
|||
ComplaintItem complaintItem1 = |
|||
complaintItemMapper.selectComplaintItemByCode(complaintItem.getComplaintItemCode()); |
|||
if(BeanUtil.isNotEmpty(complaintItem1)){ |
|||
complaintItem.setId(complaintItem1.getId()); |
|||
return complaintItemMapper.updateComplaintItem(complaintItem); |
|||
}else{ |
|||
complaintItem.setId(IdUtil.simpleUUID()); |
|||
return complaintItemMapper.insertComplaintItem(complaintItem); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 修改投诉事项 |
|||
* |
|||
* @param complaintItem 投诉事项 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateComplaintItem(ComplaintItem complaintItem) |
|||
{ |
|||
return complaintItemMapper.updateComplaintItem(complaintItem); |
|||
} |
|||
|
|||
/** |
|||
* 删除投诉事项对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteComplaintItemByIds(String ids) |
|||
{ |
|||
return complaintItemMapper.deleteComplaintItemByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除投诉事项信息 |
|||
* |
|||
* @param id 投诉事项ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteComplaintItemById(String id) |
|||
{ |
|||
return complaintItemMapper.deleteComplaintItemById(id); |
|||
} |
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
<?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.zdxt.code.mapper.ComplaintItemMapper"> |
|||
|
|||
<resultMap type="ComplaintItem" id="ComplaintItemResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="complaintItemCode" column="complaint_item_code" /> |
|||
<result property="complaintItemName" column="complaint_item_name" /> |
|||
<result property="subName" column="sub_name" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectComplaintItemVo"> |
|||
select id, complaint_item_code, complaint_item_name, sub_name from complaint_item |
|||
</sql> |
|||
|
|||
<select id="selectComplaintItemList" parameterType="ComplaintItem" resultMap="ComplaintItemResult"> |
|||
<include refid="selectComplaintItemVo"/> |
|||
<where> |
|||
<if test="complaintItemCode != null and complaintItemCode != ''"> and complaint_item_code = #{complaintItemCode}</if> |
|||
<if test="complaintItemName != null and complaintItemName != ''"> and complaint_item_name like concat('%', #{complaintItemName}, '%')</if> |
|||
<if test="subName != null and subName != ''"> and sub_name like concat('%', #{subName}, '%')</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectComplaintItemById" parameterType="String" resultMap="ComplaintItemResult"> |
|||
<include refid="selectComplaintItemVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
<select id="selectComplaintItemByCode" parameterType="String" resultMap="ComplaintItemResult"> |
|||
<include refid="selectComplaintItemVo"/> |
|||
where complaint_item_code = #{code} |
|||
</select> |
|||
|
|||
<select id="selectComplaintItemCodeByNumber" parameterType="String" resultMap="ComplaintItemResult"> |
|||
<include refid="selectComplaintItemVo"/> |
|||
where complaint_item_code like concat('%', #{code}, '%') |
|||
</select> |
|||
|
|||
<insert id="insertComplaintItem" parameterType="ComplaintItem"> |
|||
insert into complaint_item |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id != null and id != ''">id,</if> |
|||
<if test="complaintItemCode != null and complaintItemCode != ''">complaint_item_code,</if> |
|||
<if test="complaintItemName != null and complaintItemName != ''">complaint_item_name,</if> |
|||
<if test="subName != null and subName != ''">sub_name,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="id != null and id != ''">#{id},</if> |
|||
<if test="complaintItemCode != null and complaintItemCode != ''">#{complaintItemCode},</if> |
|||
<if test="complaintItemName != null and complaintItemName != ''">#{complaintItemName},</if> |
|||
<if test="subName != null and subName != ''">#{subName},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateComplaintItem" parameterType="ComplaintItem"> |
|||
update complaint_item |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="complaintItemCode != null and complaintItemCode != ''">complaint_item_code = #{complaintItemCode},</if> |
|||
<if test="complaintItemName != null and complaintItemName != ''">complaint_item_name = #{complaintItemName},</if> |
|||
<if test="subName != null and subName != ''">sub_name = #{subName},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteComplaintItemById" parameterType="String"> |
|||
delete from complaint_item where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteComplaintItemByIds" parameterType="String"> |
|||
delete from complaint_item where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue