删除无用代码.
This commit is contained in:
-232
@@ -1,232 +0,0 @@
|
||||
package com.jero.modules.demo.test.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.api.vo.ResultConstant;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
import com.jero.modules.demo.test.service.IJoaDemoService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test/joaDemo")
|
||||
@Slf4j
|
||||
public class JoaDemoController {
|
||||
@Autowired
|
||||
private IJoaDemoService joaDemoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param joaDemo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<JoaDemo>> queryPageList(JoaDemo joaDemo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<JoaDemo>> result = new Result<>();
|
||||
QueryWrapper<JoaDemo> queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, req.getParameterMap());
|
||||
Page<JoaDemo> page = new Page<>(pageNo, pageSize);
|
||||
IPage<JoaDemo> pageList = joaDemoService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param joaDemo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody JoaDemo joaDemo) {
|
||||
try {
|
||||
joaDemoService.save(joaDemo);
|
||||
return Result.OK("操作成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param joaDemo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<Object> edit(@RequestBody JoaDemo joaDemo) {
|
||||
JoaDemo joaDemoEntity = joaDemoService.getById(joaDemo.getId());
|
||||
if(joaDemoEntity==null) {
|
||||
return Result.error(ResultConstant.EN_WAS_NOT_FOUND);
|
||||
}else {
|
||||
boolean ok = joaDemoService.updateById(joaDemo);
|
||||
if(ok) {
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<Object> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
return Result.error(ResultConstant.EN_WAS_NOT_FOUND);
|
||||
}else {
|
||||
boolean ok = joaDemoService.removeById(id);
|
||||
if(ok) {
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
}
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<Object> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
return Result.error("参数不识别!");
|
||||
}else {
|
||||
this.joaDemoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<JoaDemo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
return Result.error(ResultConstant.EN_WAS_NOT_FOUND);
|
||||
}else {
|
||||
return Result.OK(joaDemo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<JoaDemo> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
JoaDemo joaDemo = JSON.parseObject(deString, JoaDemo.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<JoaDemo> pageList = joaDemoService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(JeroController.FILE_NAME, "流程测试列表");
|
||||
mv.addObject(JeroController.CLASS, JoaDemo.class);
|
||||
mv.addObject(JeroController.PARAMS, new ExportParams("流程测试列表数据", "导出人:Jero", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("/importExcel")
|
||||
public Result<T> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<JoaDemo> listJoaDemos = ExcelImportUtil.importExcel(file.getInputStream(), JoaDemo.class, params);
|
||||
for (JoaDemo joaDemoExcel : listJoaDemos) {
|
||||
joaDemoService.save(joaDemoExcel);
|
||||
}
|
||||
return Result.OK("文件导入成功!数据行数:" + listJoaDemos.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error("文件导入失败:"+e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.OK("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
package com.jero.modules.demo.test.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("joa_demo")
|
||||
public class JoaDemo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private java.lang.String id;
|
||||
/**请假人*/
|
||||
@Excel(name = "请假人", width = 15)
|
||||
private java.lang.String name;
|
||||
/**请假天数*/
|
||||
@Excel(name = "请假天数", width = 15)
|
||||
private java.lang.Integer days;
|
||||
/**开始时间*/
|
||||
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private java.util.Date beginDate;
|
||||
/**请假结束时间*/
|
||||
@Excel(name = "请假结束时间", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private java.util.Date endDate;
|
||||
/**请假原因*/
|
||||
@Excel(name = "请假原因", width = 15)
|
||||
private java.lang.String reason;
|
||||
/**流程状态*/
|
||||
@Excel(name = "流程状态", width = 15)
|
||||
private java.lang.String bpmStatus;
|
||||
/**创建人id*/
|
||||
@Excel(name = "创建人id", width = 15)
|
||||
private java.lang.String createBy;
|
||||
/**创建时间*/
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
/**修改时间*/
|
||||
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
/**修改人id*/
|
||||
@Excel(name = "修改人id", width = 15)
|
||||
private java.lang.String updateBy;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.jero.modules.demo.test.mapper;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JoaDemoMapper extends BaseMapper<JoaDemo> {
|
||||
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<?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.jero.modules.demo.test.mapper.JoaDemoMapper">
|
||||
|
||||
</mapper>
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.jero.modules.demo.test.service;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJoaDemoService extends IService<JoaDemo> {
|
||||
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package com.jero.modules.demo.test.service.impl;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
import com.jero.modules.demo.test.mapper.JoaDemoMapper;
|
||||
import com.jero.modules.demo.test.service.IJoaDemoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JoaDemoServiceImpl extends ServiceImpl<JoaDemoMapper, JoaDemo> implements IJoaDemoService {
|
||||
|
||||
}
|
||||
+7
-7
@@ -3,7 +3,7 @@ package com.jero.config.init;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.config.JeroCloudCondition;
|
||||
import com.jero.modules.system.service.ISysGatewayRouteService;
|
||||
//import com.jero.modules.system.service.ISysGatewayRouteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
@@ -21,16 +21,16 @@ import org.springframework.stereotype.Component;
|
||||
public class SystemInitListener implements ApplicationListener<ApplicationReadyEvent>, Ordered {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISysGatewayRouteService sysGatewayRouteService;
|
||||
// @Autowired
|
||||
// private ISysGatewayRouteService sysGatewayRouteService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||
|
||||
log.info(" 服务已启动,初始化路由配置 ###################");
|
||||
if (applicationReadyEvent.getApplicationContext().getDisplayName().indexOf("AnnotationConfigServletWebServerApplicationContext") > -1) {
|
||||
sysGatewayRouteService.addRoute2Redis(CacheConstant.GATEWAY_ROUTES);
|
||||
}
|
||||
// log.info(" 服务已启动,初始化路由配置 ###################");
|
||||
// if (applicationReadyEvent.getApplicationContext().getDisplayName().indexOf("AnnotationConfigServletWebServerApplicationContext") > -1) {
|
||||
// sysGatewayRouteService.addRoute2Redis(CacheConstant.GATEWAY_ROUTES);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
-95
@@ -1,95 +0,0 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.SqlInjectionUtil;
|
||||
import com.jero.modules.system.entity.SysConfusion;
|
||||
import com.jero.modules.system.mapper.SysConfusionMapper;
|
||||
import com.jero.modules.system.mapper.SysDictMapper;
|
||||
import com.jero.modules.system.model.DuplicateCheckVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @Title: DuplicateCheckAction
|
||||
* @Description: 重复校验工具
|
||||
* @Author 张代浩
|
||||
* @Date 2019-03-25
|
||||
* @Version V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sys/duplicate")
|
||||
@Api(tags="重复校验")
|
||||
public class DuplicateCheckController {
|
||||
|
||||
@Resource
|
||||
SysDictMapper sysDictMapper;
|
||||
|
||||
@Resource
|
||||
SysConfusionMapper sysConfusionMapper;
|
||||
|
||||
/**
|
||||
* 校验数据是否在系统中是否存在
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/check")
|
||||
@ApiOperation("重复校验接口")
|
||||
public Result<Object> doDuplicateCheck(DuplicateCheckVo duplicateCheckVo, HttpServletRequest request) {
|
||||
Long num = null;
|
||||
SysConfusion sysConfusion = changeRealName(duplicateCheckVo.getConfusionCode());
|
||||
|
||||
duplicateCheckVo.setTableName(sysConfusion.getTableName());
|
||||
duplicateCheckVo.setFieldName(sysConfusion.getFieldName());
|
||||
//如果加密字段有值,则把校验数据进行加密后在判断
|
||||
String encrypt = duplicateCheckVo.getEncrypt();
|
||||
if (StrUtil.isNotBlank(encrypt)){
|
||||
duplicateCheckVo.setFieldVal(PasswordUtil.encrypt(duplicateCheckVo.getFieldVal()));
|
||||
}
|
||||
log.info("----duplicate check------:" + duplicateCheckVo.toString());
|
||||
//关联表字典(举例:sys_user,realname,id)
|
||||
//SQL注入校验(只限制非法串改数据库)
|
||||
final String[] sqlInjCheck = {duplicateCheckVo.getTableName(), duplicateCheckVo.getFieldName()};
|
||||
SqlInjectionUtil.filterContent(sqlInjCheck);
|
||||
if (StringUtils.isNotBlank(duplicateCheckVo.getDataId())) {
|
||||
// [2].编辑页面校验
|
||||
num = sysDictMapper.duplicateCheckCountSql(duplicateCheckVo);
|
||||
} else {
|
||||
// [1].添加页面校验
|
||||
num = sysDictMapper.duplicateCheckCountSqlNoDataId(duplicateCheckVo);
|
||||
}
|
||||
|
||||
if (num == null || num == 0) {
|
||||
// 该值可用
|
||||
return Result.OK("该值可用!");
|
||||
} else {
|
||||
// 该值不可用
|
||||
log.info("该值不可用,系统中已存在!");
|
||||
return Result.error("该值不可用,系统中已存在!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据混淆code转换为真实表名和字段名
|
||||
*
|
||||
* @param confusionCode 混淆code
|
||||
* @return 真实表名和字段名
|
||||
*/
|
||||
private SysConfusion changeRealName(String confusionCode) {
|
||||
SysConfusion sysConfusion = sysConfusionMapper.selectOne(new QueryWrapper<SysConfusion>().lambda().eq(SysConfusion::getConfusionCode, confusionCode));
|
||||
return sysConfusion;
|
||||
}
|
||||
}
|
||||
-198
@@ -1,198 +0,0 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.system.entity.SysCheckRule;
|
||||
import com.jero.modules.system.service.ISysCheckRuleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 编码校验规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-02-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "编码校验规则")
|
||||
@RestController
|
||||
@RequestMapping("/sys/checkRule")
|
||||
public class SysCheckRuleController extends JeroController<SysCheckRule, ISysCheckRuleService> {
|
||||
|
||||
@Autowired
|
||||
private ISysCheckRuleService sysCheckRuleService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sysCheckRule
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编码校验规则-分页列表查询")
|
||||
@ApiOperation(value = "编码校验规则-分页列表查询", notes = "编码校验规则-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<SysCheckRule>> queryPageList(
|
||||
SysCheckRule sysCheckRule,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
QueryWrapper<SysCheckRule> queryWrapper = QueryGenerator.initQueryWrapper(sysCheckRule, request.getParameterMap());
|
||||
Page<SysCheckRule> page = new Page<>(pageNo, pageSize);
|
||||
IPage<SysCheckRule> pageList = sysCheckRuleService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param ruleCode
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编码校验规则-通过Code校验传入的值")
|
||||
@ApiOperation(value = "编码校验规则-通过Code校验传入的值", notes = "编码校验规则-通过Code校验传入的值")
|
||||
@GetMapping(value = "/checkByCode")
|
||||
public Result<Object> checkByCode(
|
||||
@RequestParam(name = "ruleCode") String ruleCode,
|
||||
@RequestParam(name = "value") String value
|
||||
) throws UnsupportedEncodingException {
|
||||
SysCheckRule sysCheckRule = sysCheckRuleService.getByCode(ruleCode);
|
||||
if (sysCheckRule == null) {
|
||||
return Result.error("该编码不存在");
|
||||
}
|
||||
JSONObject errorResult = sysCheckRuleService.checkValue(sysCheckRule, URLDecoder.decode(value, "UTF-8"));
|
||||
if (errorResult.isEmpty()) {
|
||||
return Result.OK();
|
||||
} else {
|
||||
Result<Object> r = Result.error(errorResult.getString("message"));
|
||||
r.setResult(errorResult);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sysCheckRule
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编码校验规则-添加")
|
||||
@ApiOperation(value = "编码校验规则-添加", notes = "编码校验规则-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@RequestBody SysCheckRule sysCheckRule) {
|
||||
sysCheckRuleService.save(sysCheckRule);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysCheckRule
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编码校验规则-编辑")
|
||||
@ApiOperation(value = "编码校验规则-编辑", notes = "编码校验规则-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@RequestBody SysCheckRule sysCheckRule) {
|
||||
sysCheckRuleService.updateById(sysCheckRule);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编码校验规则-通过id删除")
|
||||
@ApiOperation(value = "编码校验规则-通过id删除", notes = "编码校验规则-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
sysCheckRuleService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编码校验规则-批量删除")
|
||||
@ApiOperation(value = "编码校验规则-批量删除", notes = "编码校验规则-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
this.sysCheckRuleService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编码校验规则-通过id查询")
|
||||
@ApiOperation(value = "编码校验规则-通过id查询", notes = "编码校验规则-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<SysCheckRule> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
SysCheckRule sysCheckRule = sysCheckRuleService.getById(id);
|
||||
return Result.OK(sysCheckRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sysCheckRule
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SysCheckRule sysCheckRule) {
|
||||
return super.exportXls(request, sysCheckRule, SysCheckRule.class, "编码校验规则");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping("/importExcel")
|
||||
public Result<SysCheckRule> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SysCheckRule.class);
|
||||
}
|
||||
|
||||
}
|
||||
-225
@@ -1,225 +0,0 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.FillRuleUtil;
|
||||
import com.jero.modules.system.entity.SysFillRule;
|
||||
import com.jero.modules.system.service.ISysFillRuleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 填值规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-11-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "填值规则")
|
||||
@RestController
|
||||
@RequestMapping("/sys/fillRule")
|
||||
public class SysFillRuleController extends JeroController<SysFillRule, ISysFillRuleService> {
|
||||
@Autowired
|
||||
private ISysFillRuleService sysFillRuleService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sysFillRule
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "填值规则-分页列表查询")
|
||||
@ApiOperation(value = "填值规则-分页列表查询", notes = "填值规则-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<SysFillRule>> queryPageList(SysFillRule sysFillRule,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SysFillRule> queryWrapper = QueryGenerator.initQueryWrapper(sysFillRule, req.getParameterMap());
|
||||
Page<SysFillRule> page = new Page<>(pageNo, pageSize);
|
||||
IPage<SysFillRule> pageList = sysFillRuleService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试 ruleCode
|
||||
*
|
||||
* @param ruleCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/testFillRule")
|
||||
public Result<Object> testFillRule(@RequestParam("ruleCode") String ruleCode) {
|
||||
Object result = FillRuleUtil.executeRule(ruleCode, new JSONObject());
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sysFillRule
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "填值规则-添加")
|
||||
@ApiOperation(value = "填值规则-添加", notes = "填值规则-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@RequestBody SysFillRule sysFillRule) {
|
||||
sysFillRuleService.save(sysFillRule);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysFillRule
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "填值规则-编辑")
|
||||
@ApiOperation(value = "填值规则-编辑", notes = "填值规则-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@RequestBody SysFillRule sysFillRule) {
|
||||
sysFillRuleService.updateById(sysFillRule);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "填值规则-通过id删除")
|
||||
@ApiOperation(value = "填值规则-通过id删除", notes = "填值规则-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
sysFillRuleService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "填值规则-批量删除")
|
||||
@ApiOperation(value = "填值规则-批量删除", notes = "填值规则-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
this.sysFillRuleService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "填值规则-通过id查询")
|
||||
@ApiOperation(value = "填值规则-通过id查询", notes = "填值规则-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<SysFillRule> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
SysFillRule sysFillRule = sysFillRuleService.getById(id);
|
||||
return Result.OK(sysFillRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sysFillRule
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SysFillRule sysFillRule) {
|
||||
return super.exportXls(request, sysFillRule, SysFillRule.class, "填值规则");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping("/importExcel")
|
||||
public Result<SysFillRule> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SysFillRule.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 ruleCode 执行自定义填值规则
|
||||
*
|
||||
* @param ruleCode 要执行的填值规则编码
|
||||
* @param formData 表单数据,可根据表单数据的不同生成不同的填值结果
|
||||
* @return 运行后的结果
|
||||
*/
|
||||
@PostMapping("/executeRuleByCode/{ruleCode}")
|
||||
public Result<Object> executeByRuleCode(@PathVariable("ruleCode") String ruleCode, @RequestBody JSONObject formData) {
|
||||
Object result = FillRuleUtil.executeRule(ruleCode, formData);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量通过 ruleCode 执行自定义填值规则
|
||||
*
|
||||
* @param ruleData 要执行的填值规则JSON数组:
|
||||
* 示例: { "commonFormData": {}, rules: [ { "ruleCode": "xxx", "formData": null } ] }
|
||||
* @return 运行后的结果,返回示例: [{"ruleCode": "order_num_rule", "result": "CN2019111117212984"}]
|
||||
*
|
||||
*/
|
||||
@PostMapping("/executeRuleByCodeBatch")
|
||||
public Result<JSONArray> executeByRuleCodeBatch(@RequestBody JSONObject ruleData) {
|
||||
JSONObject commonFormData = ruleData.getJSONObject("commonFormData");
|
||||
JSONArray rules = ruleData.getJSONArray("rules");
|
||||
// 遍历 rules ,批量执行规则
|
||||
JSONArray results = new JSONArray(rules.size());
|
||||
for (int i = 0; i < rules.size(); i++) {
|
||||
JSONObject rule = rules.getJSONObject(i);
|
||||
String ruleCode = rule.getString("ruleCode");
|
||||
JSONObject formData = rule.getJSONObject("formData");
|
||||
// 如果没有传递 formData,就用common的
|
||||
if (formData == null) {
|
||||
formData = commonFormData;
|
||||
}
|
||||
// 执行填值规则
|
||||
Object result = FillRuleUtil.executeRule(ruleCode, formData);
|
||||
JSONObject obj = new JSONObject(rules.size());
|
||||
obj.put("ruleCode", ruleCode);
|
||||
obj.put("result", result);
|
||||
results.add(obj);
|
||||
}
|
||||
return Result.OK(results);
|
||||
}
|
||||
|
||||
}
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.SysGatewayRoute;
|
||||
import com.jero.modules.system.service.ISysGatewayRouteService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: gateway路由管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-05-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "gateway路由管理")
|
||||
@RestController
|
||||
@RequestMapping("/sys/gatewayRoute")
|
||||
@Slf4j
|
||||
public class SysGatewayRouteController extends JeroController<SysGatewayRoute, ISysGatewayRouteService> {
|
||||
|
||||
@Autowired
|
||||
private ISysGatewayRouteService sysGatewayRouteService;
|
||||
|
||||
@PostMapping(value = "/updateAll")
|
||||
public Result<T> updateAll(@RequestBody JSONObject json) {
|
||||
sysGatewayRouteService.updateAll(json);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
public Result<JSONArray> queryPageList(SysGatewayRoute sysGatewayRoute) {
|
||||
LambdaQueryWrapper<SysGatewayRoute> query = new LambdaQueryWrapper<>();
|
||||
List<SysGatewayRoute> ls = sysGatewayRouteService.list(query);
|
||||
JSONArray array = new JSONArray();
|
||||
for(SysGatewayRoute rt: ls){
|
||||
JSONObject obj = (JSONObject) JSON.toJSON(rt);
|
||||
if(oConvertUtils.isNotEmpty(rt.getPredicates())){
|
||||
obj.put("predicates", JSON.parseArray(rt.getPredicates()));
|
||||
}
|
||||
if(oConvertUtils.isNotEmpty(rt.getFilters())){
|
||||
obj.put("filters", JSON.parseArray(rt.getFilters()));
|
||||
}
|
||||
array.add(obj);
|
||||
}
|
||||
return Result.OK(array);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/clearRedis")
|
||||
public Result<T> clearRedis() {
|
||||
sysGatewayRouteService.clearRedis();
|
||||
return Result.OK("清除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
// @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
|
||||
@PostMapping("/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
sysGatewayRouteService.deleteById(id);
|
||||
return Result.OK("删除路由成功");
|
||||
}
|
||||
|
||||
}
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 编码校验规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-02-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_check_rule")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "sys_check_rule对象", description = "编码校验规则")
|
||||
public class SysCheckRule {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private String id;
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
@Excel(name = "规则名称", width = 15)
|
||||
@ApiModelProperty(value = "规则名称")
|
||||
private String ruleName;
|
||||
/**
|
||||
* 规则Code
|
||||
*/
|
||||
@Excel(name = "规则Code", width = 15)
|
||||
@ApiModelProperty(value = "规则Code")
|
||||
private String ruleCode;
|
||||
/**
|
||||
* 规则JSON
|
||||
*/
|
||||
@Excel(name = "规则JSON", width = 15)
|
||||
@ApiModelProperty(value = "规则JSON")
|
||||
private String ruleJson;
|
||||
/**
|
||||
* 规则描述
|
||||
*/
|
||||
@Excel(name = "规则描述", width = 15)
|
||||
@ApiModelProperty(value = "规则描述")
|
||||
private String ruleDescription;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@Excel(name = "更新人", width = 15)
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name = "创建人", width = 15)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
}
|
||||
-101
@@ -1,101 +0,0 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 混淆表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2021-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_confusion")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "sys_confusion对象", description = "混淆表")
|
||||
public class SysConfusion implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**
|
||||
* 混淆类型
|
||||
*/
|
||||
@Excel(name = "表名", width = 15)
|
||||
@ApiModelProperty(value = "表名")
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 表名或字段名
|
||||
*/
|
||||
@Excel(name = "字段名", width = 15)
|
||||
@ApiModelProperty(value = "字段名")
|
||||
private String fieldName;
|
||||
|
||||
/**
|
||||
* 混淆code
|
||||
*/
|
||||
@Excel(name = "混淆code", width = 15)
|
||||
@ApiModelProperty(value = "混淆code")
|
||||
private String confusionCode;
|
||||
|
||||
}
|
||||
-86
@@ -1,86 +0,0 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* @Description: 填值规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-11-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_fill_rule")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "sys_fill_rule对象", description = "填值规则")
|
||||
public class SysFillRule {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private java.lang.String id;
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
@Excel(name = "规则名称", width = 15)
|
||||
@ApiModelProperty(value = "规则名称")
|
||||
private java.lang.String ruleName;
|
||||
/**
|
||||
* 规则Code
|
||||
*/
|
||||
@Excel(name = "规则Code", width = 15)
|
||||
@ApiModelProperty(value = "规则Code")
|
||||
private java.lang.String ruleCode;
|
||||
/**
|
||||
* 规则实现类
|
||||
*/
|
||||
@Excel(name = "规则实现类", width = 15)
|
||||
@ApiModelProperty(value = "规则实现类")
|
||||
private java.lang.String ruleClass;
|
||||
/**
|
||||
* 规则参数
|
||||
*/
|
||||
@Excel(name = "规则参数", width = 15)
|
||||
@ApiModelProperty(value = "规则参数")
|
||||
private java.lang.String ruleParams;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Excel(name = "修改人", width = 15)
|
||||
@ApiModelProperty(value = "修改人")
|
||||
private java.lang.String updateBy;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private java.util.Date updateTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name = "创建人", width = 15)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
}
|
||||
-101
@@ -1,101 +0,0 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: gateway路由管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-05-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_gateway_route")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="sys_gateway_route对象", description="gateway路由管理")
|
||||
public class SysGatewayRoute implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**routerKEy*/
|
||||
@ApiModelProperty(value = "路由ID")
|
||||
private String routerId;
|
||||
|
||||
/**服务名*/
|
||||
@Excel(name = "服务名", width = 15)
|
||||
@ApiModelProperty(value = "服务名")
|
||||
private String name;
|
||||
|
||||
/**服务地址*/
|
||||
@Excel(name = "服务地址", width = 15)
|
||||
@ApiModelProperty(value = "服务地址")
|
||||
private String uri;
|
||||
|
||||
/**
|
||||
* 断言配置
|
||||
*/
|
||||
private String predicates;
|
||||
|
||||
/**
|
||||
* 过滤配置
|
||||
*/
|
||||
private String filters;
|
||||
|
||||
/**是否忽略前缀0-否 1-是*/
|
||||
@Excel(name = "忽略前缀", width = 15)
|
||||
@ApiModelProperty(value = "忽略前缀")
|
||||
@Dict(dicCode = "yn")
|
||||
private Integer stripPrefix;
|
||||
|
||||
/**是否重试0-否 1-是*/
|
||||
@Excel(name = "是否重试", width = 15)
|
||||
@ApiModelProperty(value = "是否重试")
|
||||
@Dict(dicCode = "yn")
|
||||
private Integer retryable;
|
||||
|
||||
/**是否为保留数据:0-否 1-是*/
|
||||
@Excel(name = "保留数据", width = 15)
|
||||
@ApiModelProperty(value = "保留数据")
|
||||
@Dict(dicCode = "yn")
|
||||
private Integer persistable;
|
||||
|
||||
/**是否在接口文档中展示:0-否 1-是*/
|
||||
@Excel(name = "在接口文档中展示", width = 15)
|
||||
@ApiModelProperty(value = "在接口文档中展示")
|
||||
@Dict(dicCode = "yn")
|
||||
private Integer showApi;
|
||||
|
||||
/**状态 1有效 0无效*/
|
||||
@Excel(name = "状态", width = 15)
|
||||
@ApiModelProperty(value = "状态")
|
||||
@Dict(dicCode = "yn")
|
||||
private Integer status;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.system.entity.SysCheckRule;
|
||||
|
||||
/**
|
||||
* @Description: 编码校验规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-02-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SysCheckRuleMapper extends BaseMapper<SysCheckRule> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.system.entity.SysConfusion;
|
||||
|
||||
/**
|
||||
* @Description: 混淆表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2021-08-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SysConfusionMapper extends BaseMapper<SysConfusion> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.system.entity.SysFillRule;
|
||||
|
||||
/**
|
||||
* @Description: 填值规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-11-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SysFillRuleMapper extends BaseMapper<SysFillRule> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.system.entity.SysGatewayRoute;
|
||||
|
||||
/**
|
||||
* @Description: gateway路由管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-05-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SysGatewayRouteMapper extends BaseMapper<SysGatewayRoute> {
|
||||
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<?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.jero.modules.system.mapper.SysCheckRuleMapper">
|
||||
|
||||
</mapper>
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
<?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.jero.modules.system.mapper.SysConfusionMapper">
|
||||
<resultMap id="SysConfusionResultMap" type="com.jero.modules.system.entity.SysConfusion">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="table_name" property="tableName" />
|
||||
<result column="field_name" property="fieldName" />
|
||||
<result column="confusion_code" property="confusionCode" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<?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.jero.modules.system.mapper.SysFillRuleMapper">
|
||||
|
||||
</mapper>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<?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.jero.modules.system.mapper.SysGatewayRouteMapper">
|
||||
|
||||
</mapper>
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.system.entity.SysCheckRule;
|
||||
|
||||
/**
|
||||
* @Description: 编码校验规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-02-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISysCheckRuleService extends IService<SysCheckRule> {
|
||||
|
||||
/**
|
||||
* 通过 code 获取规则
|
||||
*
|
||||
* @param ruleCode
|
||||
* @return
|
||||
*/
|
||||
SysCheckRule getByCode(String ruleCode);
|
||||
|
||||
|
||||
/**
|
||||
* 通过用户设定的自定义校验规则校验传入的值
|
||||
*
|
||||
* @param checkRule
|
||||
* @param value
|
||||
* @return 返回 null代表通过校验,否则就是返回的错误提示文本
|
||||
*/
|
||||
JSONObject checkValue(SysCheckRule checkRule, String value);
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.system.entity.SysFillRule;
|
||||
|
||||
/**
|
||||
* @Description: 填值规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-11-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISysFillRuleService extends IService<SysFillRule> {
|
||||
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.system.entity.SysGatewayRoute;
|
||||
|
||||
/**
|
||||
* @Description: gateway路由管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-05-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISysGatewayRouteService extends IService<SysGatewayRoute> {
|
||||
|
||||
/**
|
||||
* 添加所有的路由信息到redis
|
||||
* @param key
|
||||
*/
|
||||
void addRoute2Redis(String key);
|
||||
|
||||
/**
|
||||
* 删除路由
|
||||
* @param id
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 保存路由配置
|
||||
* @param array
|
||||
*/
|
||||
void updateAll(JSONObject array);
|
||||
|
||||
/**
|
||||
* 清空redis中的route信息
|
||||
*/
|
||||
void clearRedis();
|
||||
|
||||
}
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.jero.modules.system.entity.SysCheckRule;
|
||||
import com.jero.modules.system.mapper.SysCheckRuleMapper;
|
||||
import com.jero.modules.system.service.ISysCheckRuleService;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @Description: 编码校验规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-02-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SysCheckRuleServiceImpl extends ServiceImpl<SysCheckRuleMapper, SysCheckRule> implements ISysCheckRuleService {
|
||||
|
||||
/**
|
||||
* 位数特殊符号,用于检查整个值,而不是裁剪某一段
|
||||
*/
|
||||
private static final String CHECK_ALL_SYMBOL = "*";
|
||||
|
||||
@Override
|
||||
public SysCheckRule getByCode(String ruleCode) {
|
||||
LambdaQueryWrapper<SysCheckRule> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysCheckRule::getRuleCode, ruleCode);
|
||||
return super.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户设定的自定义校验规则校验传入的值
|
||||
*
|
||||
* @param checkRule
|
||||
* @param value
|
||||
* @return 返回 null代表通过校验,否则就是返回的错误提示文本
|
||||
*/
|
||||
@Override
|
||||
public JSONObject checkValue(SysCheckRule checkRule, String value) {
|
||||
if (checkRule != null && StringUtils.isNotBlank(value)) {
|
||||
String ruleJson = checkRule.getRuleJson();
|
||||
if (StringUtils.isNotBlank(ruleJson)) {
|
||||
JSONObject result = getJsonObject(value, ruleJson);
|
||||
if (result != null) return result;
|
||||
}
|
||||
}
|
||||
return new JSONObject();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private JSONObject getJsonObject(String value, String ruleJson) {
|
||||
// 开始截取的下标,根据规则的顺序递增,但是 * 号不计入递增范围
|
||||
int beginIndex = 0;
|
||||
JSONArray rules = JSON.parseArray(ruleJson);
|
||||
for (int i = 0; i < rules.size(); i++) {
|
||||
JSONObject result = new JSONObject();
|
||||
JSONObject rule = rules.getJSONObject(i);
|
||||
// 位数
|
||||
String digits = rule.getString("digits");
|
||||
result.put("digits", digits);
|
||||
// 验证规则
|
||||
String pattern = rule.getString("pattern");
|
||||
result.put("pattern", pattern);
|
||||
// 未通过时的提示文本
|
||||
String message = rule.getString("message");
|
||||
result.put("message", message);
|
||||
|
||||
// 根据用户设定的区间,截取字符串进行验证
|
||||
String checkValue;
|
||||
// 是否检查整个值而不截取
|
||||
if (CHECK_ALL_SYMBOL.equals(digits)) {
|
||||
checkValue = value;
|
||||
} else {
|
||||
int num = Integer.parseInt(digits);
|
||||
int endIndex = beginIndex + num;
|
||||
// 如果结束下标大于给定的值的长度,则取到最后一位
|
||||
endIndex = endIndex > value.length() ? value.length() : endIndex;
|
||||
// 如果开始下标大于结束下标,则说明用户还尚未输入到该位置,直接赋空值
|
||||
if (beginIndex > endIndex) {
|
||||
checkValue = "";
|
||||
} else {
|
||||
checkValue = value.substring(beginIndex, endIndex);
|
||||
}
|
||||
result.put("beginIndex", beginIndex);
|
||||
result.put("endIndex", endIndex);
|
||||
beginIndex += num;
|
||||
}
|
||||
result.put("checkValue", checkValue);
|
||||
boolean passed = Pattern.matches(pattern, checkValue);
|
||||
result.put("passed", passed);
|
||||
// 如果没有通过校验就返回错误信息
|
||||
if (!passed) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.system.entity.SysFillRule;
|
||||
import com.jero.modules.system.mapper.SysFillRuleMapper;
|
||||
import com.jero.modules.system.service.ISysFillRuleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 填值规则
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-11-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service("sysFillRuleServiceImpl")
|
||||
public class SysFillRuleServiceImpl extends ServiceImpl<SysFillRuleMapper, SysFillRule> implements ISysFillRuleService {
|
||||
|
||||
}
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.base.BaseMap;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.constant.GlobalConstants;
|
||||
import com.jero.modules.system.entity.SysGatewayRoute;
|
||||
import com.jero.modules.system.mapper.SysGatewayRouteMapper;
|
||||
import com.jero.modules.system.service.ISysGatewayRouteService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: gateway路由管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2020-05-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMapper, SysGatewayRoute> implements ISysGatewayRouteService {
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
|
||||
@Override
|
||||
public void addRoute2Redis(String key) {
|
||||
List<SysGatewayRoute> ls = this.list(new LambdaQueryWrapper<>());
|
||||
redisTemplate.opsForValue().set(key, JSON.toJSONString(ls));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
this.removeById(id);
|
||||
this.resreshRouter();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateAll(JSONObject json) {
|
||||
log.info("--gateway 路由配置修改--");
|
||||
try {
|
||||
json = json.getJSONObject("router");
|
||||
String id = json.getString("id");
|
||||
SysGatewayRoute route = getById(id);
|
||||
if (ObjectUtil.isEmpty(route)) {
|
||||
route = new SysGatewayRoute();
|
||||
}
|
||||
route.setRouterId(json.getString("routerId"));
|
||||
route.setName(json.getString("name"));
|
||||
route.setPredicates(json.getString("predicates"));
|
||||
String filters = json.getString("filters");
|
||||
if (ObjectUtil.isEmpty(filters)) {
|
||||
filters = "[]";
|
||||
}
|
||||
route.setFilters(filters);
|
||||
route.setUri(json.getString("uri"));
|
||||
if (json.get("status") == null) {
|
||||
route.setStatus(1);
|
||||
} else {
|
||||
route.setStatus(json.getInteger("status"));
|
||||
}
|
||||
this.saveOrUpdate(route);
|
||||
resreshRouter();
|
||||
} catch (Exception e) {
|
||||
log.error("路由配置解析失败", e);
|
||||
resreshRouter();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新redis路由缓存
|
||||
*/
|
||||
private void resreshRouter() {
|
||||
//更新redis路由缓存
|
||||
addRoute2Redis(CacheConstant.GATEWAY_ROUTES);
|
||||
BaseMap params = new BaseMap();
|
||||
params.put(GlobalConstants.HANDLER_NAME, "loderRouderHandler");
|
||||
//刷新网关
|
||||
redisTemplate.convertAndSend(GlobalConstants.REDIS_TOPIC_NAME, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearRedis() {
|
||||
redisTemplate.opsForValue().set(CacheConstant.GATEWAY_ROUTES, "");
|
||||
}
|
||||
}
|
||||
+2
@@ -338,8 +338,10 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
|
||||
try {
|
||||
this.sarFileCompareInfoService.exportFullTextCompareXls(id,exportName, response, request);
|
||||
}catch (JeroBootException e){
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException(e.getMessage());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException(MessageUtils.getMessage(ResultCommon.ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -573,7 +573,9 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
int i = 1;
|
||||
for (SarFileCompareItem sarFileCompareItem : leftData) {
|
||||
HSSFRow row1 = sheetItemsLeft.createRow(i);
|
||||
row1.createCell(0).setCellValue(sfcInfo.getSerialNumberLeft() + " " +sfcInfo.getTitleLeft());
|
||||
String numberLeft = StringUtils.isNotEmpty(sfcInfo.getSerialNumberLeft()) ? sfcInfo.getSerialNumberLeft():"";
|
||||
String titleLeft = StringUtils.isNotEmpty(sfcInfo.getTitleLeft()) ? sfcInfo.getTitleLeft():"";
|
||||
row1.createCell(0).setCellValue(numberLeft + " " +titleLeft);
|
||||
row1.createCell(1).setCellValue(sarFileCompareItem.getItemsNum());
|
||||
row1.getCell(1).setCellStyle(cellStyleBase);
|
||||
|
||||
@@ -677,7 +679,10 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
int i = 1;
|
||||
for (SarFileCompareItem sarFileCompareItem : rightData) {
|
||||
HSSFRow row1 = sheetItemsRight.createRow(i);
|
||||
row1.createCell(0).setCellValue(sfcInfo.getSerialNumberRight() + " " +sfcInfo.getTitleRight());
|
||||
|
||||
String numberRight = StringUtils.isNotEmpty(sfcInfo.getSerialNumberRight()) ? sfcInfo.getSerialNumberRight():"";
|
||||
String titleRight = StringUtils.isNotEmpty(sfcInfo.getTitleRight()) ? sfcInfo.getTitleRight():"";
|
||||
row1.createCell(0).setCellValue(numberRight + " " +titleRight);
|
||||
row1.createCell(1).setCellValue(sarFileCompareItem.getItemsNum());
|
||||
row1.getCell(1).setCellStyle(cellStyleBase);
|
||||
|
||||
|
||||
-23
@@ -1,33 +1,14 @@
|
||||
package com.jero.modules.compare.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.compare.entity.SarItemsCompareHisEO;
|
||||
import com.jero.modules.compare.mapper.SarItemsCompareHisEOMapper;
|
||||
import com.jero.modules.compare.service.ISarItemsCompareHisEOService;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.split.common.ConvertHtml2Excel;
|
||||
import com.jero.modules.split.common.ReadExcel;
|
||||
import com.jero.modules.split.dto.FileSpiltValTableExportDto;
|
||||
import com.jero.modules.split.dto.FileSplitValExportDto;
|
||||
import com.jero.modules.split.dto.FileSplitValImgExportDto;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
||||
import com.jero.modules.split.page.SarFileSplitItemsEOPage;
|
||||
import com.jero.modules.split.page.SarFileSplitItemsValEOPage;
|
||||
import com.jero.modules.system.util.MyStringUtils;
|
||||
import com.jero.modules.tag.entity.LawsTag;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.common.usermodel.HyperlinkType;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
@@ -41,12 +22,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
|
||||
+1
-13
@@ -39,21 +39,15 @@ import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
import com.jero.modules.split.service.impl.FileSpiltService;
|
||||
import com.jero.modules.sys.entity.LawsEnterpriseStandardLevel;
|
||||
import com.jero.modules.sys.entity.LawsGrade;
|
||||
import com.jero.modules.sys.service.ILawsEnterpriseStandardLevelService;
|
||||
import com.jero.modules.sys.service.ILawsGradeService;
|
||||
import com.jero.modules.system.entity.SysDict;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.model.DepartIdModel;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import com.jero.modules.system.service.ISysUserDepartService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.tag.entity.LawsTag;
|
||||
import com.jero.modules.tag.enums.LawsFieldTypeEnum;
|
||||
import com.jero.modules.tag.enums.TableNameEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -105,10 +99,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
private final SarFileSplitItemsValEOMapper sarFileSplitItemsValEOMapper;
|
||||
private final ISysDictService sysDictService;
|
||||
private final ISysDictItemService sysDictItemService;
|
||||
private final ILawsEnterpriseStandardLevelService lawsEnterpriseStandardLevelService;
|
||||
private final ISysUserService sysUserService;
|
||||
private final ISysUserDepartService sysUserDepartService;
|
||||
private final ILawsGradeService lawsGradeService;
|
||||
private static final String INFO_ID = "info_id";
|
||||
private static final String ID = "id";
|
||||
private static final String IDS = "ids";
|
||||
@@ -128,10 +120,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
SarFileSplitItemsValEOMapper sarFileSplitItemsValEOMapper,
|
||||
ISysDictService sysDictService,
|
||||
ISysDictItemService sysDictItemService,
|
||||
ILawsEnterpriseStandardLevelService lawsEnterpriseStandardLevelService,
|
||||
ISysUserService sysUserService,
|
||||
ISysUserDepartService sysUserDepartService,
|
||||
ILawsGradeService lawsGradeService) {
|
||||
ISysUserDepartService sysUserDepartService) {
|
||||
this.documentSplitMapper = documentSplitMapper;
|
||||
this.sarFileSplitInfoService = sarFileSplitInfoService;
|
||||
this.fileSpiltService = fileSpiltService;
|
||||
@@ -140,10 +130,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
this.sarFileSplitItemsValEOMapper = sarFileSplitItemsValEOMapper;
|
||||
this.sysDictService = sysDictService;
|
||||
this.sysDictItemService = sysDictItemService;
|
||||
this.lawsEnterpriseStandardLevelService = lawsEnterpriseStandardLevelService;
|
||||
this.sysUserService = sysUserService;
|
||||
this.sysUserDepartService = sysUserDepartService;
|
||||
this.lawsGradeService = lawsGradeService;
|
||||
}
|
||||
|
||||
@Value("${jero.path.exportExcelTempPath}")
|
||||
|
||||
-71
@@ -1,71 +0,0 @@
|
||||
package com.jero.modules.log.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 更新log表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("buss_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="buss_log对象", description="更新log表")
|
||||
public class BussLogEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**文档id*/
|
||||
@Excel(name = "文档id", width = 15)
|
||||
@ApiModelProperty(value = "文档id")
|
||||
private String documentId;
|
||||
|
||||
/**日志内容*/
|
||||
@Excel(name = "日志内容", width = 15)
|
||||
@ApiModelProperty(value = "日志内容")
|
||||
private String content;
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.log.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.log.entity.BussLogEO;
|
||||
|
||||
/**
|
||||
* @Description: 更新log表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface BussLogEOMapper extends BaseMapper<BussLogEO> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
<?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.jero.modules.log.mapper.BussLogEOMapper">
|
||||
<resultMap id="BussLogEOResultMap" type="com.jero.modules.log.entity.BussLogEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="document_id" property="documentId" />
|
||||
<result column="content" property="content" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
package com.jero.modules.log.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.log.entity.BussLogEO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 更新log表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IBussLogEOService extends IService<BussLogEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param bussLogEO
|
||||
* @return
|
||||
*/
|
||||
void add(BussLogEO bussLogEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param bussLogEO
|
||||
* @return
|
||||
*/
|
||||
void editById(BussLogEO bussLogEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BussLogEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<BussLogEO> queryList();
|
||||
}
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
package com.jero.modules.log.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.log.entity.BussLogEO;
|
||||
import com.jero.modules.log.mapper.BussLogEOMapper;
|
||||
import com.jero.modules.log.service.IBussLogEOService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 更新log表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class BussLogEOServiceImpl extends ServiceImpl<BussLogEOMapper, BussLogEO> implements IBussLogEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param bussLogEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(BussLogEO bussLogEO) {
|
||||
Date now = new Date();
|
||||
bussLogEO.setCreateTime(now);
|
||||
bussLogEO.setUpdateTime(now);
|
||||
save(bussLogEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param bussLogEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(BussLogEO bussLogEO) {
|
||||
Date now = new Date();
|
||||
bussLogEO.setUpdateTime(now);
|
||||
saveOrUpdate(bussLogEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public BussLogEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BussLogEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.jero.modules.sys.controller;
|
||||
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.sys.entity.LawsEnterpriseStandardLevel;
|
||||
import com.jero.modules.sys.service.ILawsEnterpriseStandardLevelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description: 企标级别映射管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@ApiSupport(order = 109)
|
||||
@Api(tags="企标级别映射管理")
|
||||
@RestController
|
||||
@RequestMapping("/sys/lawsEnterprisestandardLevel")
|
||||
@Slf4j
|
||||
public class LawsEnterprisestandardLevelController extends JeroController<LawsEnterpriseStandardLevel, ILawsEnterpriseStandardLevelService> {
|
||||
|
||||
}
|
||||
-124
@@ -1,124 +0,0 @@
|
||||
package com.jero.modules.sys.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.modules.sys.entity.LawsFriendlyLinks;
|
||||
import com.jero.modules.sys.service.ILawsFriendlyLinksService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 友情链接管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@ApiSupport(order = 110)
|
||||
@Api(tags="友情链接管理")
|
||||
@RestController
|
||||
@RequestMapping("/sys/lawsFriendlyLinks")
|
||||
@Slf4j
|
||||
public class LawsFriendlyLinksController extends JeroController<LawsFriendlyLinks, ILawsFriendlyLinksService> {
|
||||
@Autowired
|
||||
private ILawsFriendlyLinksService lawsFriendlyLinksService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@RequiresPermissions("sys:friendshipLink:search")
|
||||
@AutoLog(value = "友情链接管理-列表查询")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation(value="友情链接管理-列表查询", notes="友情链接管理-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsFriendlyLinks>> queryList(LawsFriendlyLinks lawsFriendlyLinks, HttpServletRequest req) {
|
||||
List<LawsFriendlyLinks> list = lawsFriendlyLinksService.queryList(lawsFriendlyLinks, req);
|
||||
list = list.stream().sorted(Comparator.comparing(LawsFriendlyLinks::getSort)).collect(Collectors.toList());
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@AutoLog(value = "友情链接管理-添加")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value="友情链接管理-添加", notes="友情链接管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody LawsFriendlyLinks lawsFriendlyLinks) {
|
||||
lawsFriendlyLinksService.add(lawsFriendlyLinks);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsFriendlyLinks
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:friendshipLink:edit")
|
||||
@AutoLog(value = "友情链接管理-编辑")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@ApiOperation(value="友情链接管理-编辑", notes="友情链接管理-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@RequestBody LawsFriendlyLinks lawsFriendlyLinks) {
|
||||
lawsFriendlyLinksService.editById(lawsFriendlyLinks);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "友情链接管理-通过id删除")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@ApiOperation(value="友情链接管理-通过id删除", notes="友情链接管理-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
lawsFriendlyLinksService.deleteById(map.get("id"));
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "友情链接管理-批量删除")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@ApiOperation(value="友情链接管理-批量删除", notes="友情链接管理-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
this.lawsFriendlyLinksService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK));
|
||||
}
|
||||
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
package com.jero.modules.sys.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.modules.sys.entity.LawsGrade;
|
||||
import com.jero.modules.sys.service.ILawsGradeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 级别
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="级别")
|
||||
@RestController
|
||||
@RequestMapping("/sys/lawsGrade")
|
||||
@Slf4j
|
||||
public class LawsGradeController extends JeroController<LawsGrade, ILawsGradeService> {
|
||||
@Autowired
|
||||
private ILawsGradeService lawsGradeService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@AutoLog(value = "级别-列表查询")
|
||||
@ApiOperation(value="级别-列表查询", notes="级别-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsGrade>> queryList() {
|
||||
List<LawsGrade> grades = lawsGradeService.queryList();
|
||||
return Result.OK(grades);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
@AutoLog(value = "级别-编辑")
|
||||
@ApiOperation(value="级别-编辑", notes="级别-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@Validated @RequestBody LawsGrade lawsGrade) {
|
||||
if (StringUtils.isBlank(lawsGrade.getId())){
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
lawsGradeService.edit(lawsGrade);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
}
|
||||
-226
@@ -1,226 +0,0 @@
|
||||
package com.jero.modules.sys.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroup;
|
||||
import com.jero.modules.sys.service.ILawsWorkingGroupService;
|
||||
import com.jero.modules.sys.service.ILawsWorkingGroupUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@ApiSupport(order = 107)
|
||||
@Api(tags="内部工作组")
|
||||
@RestController
|
||||
@RequestMapping("/sys/lawsWorkingGroup")
|
||||
@Slf4j
|
||||
public class LawsWorkingGroupController extends JeroController<LawsWorkingGroup, ILawsWorkingGroupService> {
|
||||
@Autowired
|
||||
private ILawsWorkingGroupService lawsWorkingGroupService;
|
||||
@Resource
|
||||
private ILawsWorkingGroupUserService lawsWorkingGroupUserService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@AutoLog(value = "内部工作组-列表查询")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation(value="内部工作组-列表查询", notes="内部工作组-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsWorkingGroup>> queryList(LawsWorkingGroup lawsWorkingGroup) {
|
||||
List<LawsWorkingGroup> list = lawsWorkingGroupService.queryList();
|
||||
List<LawsWorkingGroup> toTree;
|
||||
if (StringUtils.isBlank(lawsWorkingGroup.getName())){
|
||||
toTree = lawsWorkingGroupService.convertToTree(list);
|
||||
}else {
|
||||
toTree = lawsWorkingGroupService.convertToTree(list, lawsWorkingGroup.getName());
|
||||
}
|
||||
return Result.OK(toTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*/
|
||||
@AutoLog(value = "内部工作组-通过id查询")
|
||||
@ApiOperation(value="内部工作组-通过id查询", notes="内部工作组-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<LawsWorkingGroup> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
LawsWorkingGroup lawsWorkingGroup = lawsWorkingGroupService.queryById(id);
|
||||
if(lawsWorkingGroup==null) {
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
// 通过递归查找所有子节点数据
|
||||
List<LawsWorkingGroup> list = lawsWorkingGroupService.realList();
|
||||
LawsWorkingGroup workingGroup = lawsWorkingGroupService.convertToTreeById(list, id);
|
||||
return Result.OK(workingGroup);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:tree:add")
|
||||
@AutoLog(value = "内部工作组-添加")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value="内部工作组-添加", notes="内部工作组-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody LawsWorkingGroup lawsWorkingGroup) {
|
||||
String pid = lawsWorkingGroup.getPid();
|
||||
if (StringUtils.isNotBlank(pid)){
|
||||
LawsWorkingGroup workingGroup = lawsWorkingGroupService.queryById(pid);
|
||||
if(workingGroup.getLevel() == 1 && StringUtils.isBlank(lawsWorkingGroup.getUserId())){
|
||||
throw new JeroBootException("管理权限不能为空");
|
||||
}
|
||||
lawsWorkingGroup.setLevel(workingGroup.getLevel() + 1);
|
||||
}else {
|
||||
lawsWorkingGroup.setLevel(1);
|
||||
}
|
||||
lawsWorkingGroup.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
lawsWorkingGroupService.add(lawsWorkingGroup);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加工作组
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:tree:add")
|
||||
@AutoLog(value = "内部工作组-添加工作组")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@ApiOperation(value="内部工作组-添加工作组", notes="内部工作组-添加工作组")
|
||||
@PostMapping(value = "/addWorkGroup")
|
||||
public Result<T> addWorkGroup(@Validated @RequestBody LawsWorkingGroup lawsWorkingGroup) {
|
||||
// 校验是否有权限
|
||||
lawsWorkingGroupUserService.checkAuth(lawsWorkingGroup.getPid());
|
||||
String pid = lawsWorkingGroup.getPid();
|
||||
if (StringUtils.isNotBlank(pid)){
|
||||
LawsWorkingGroup workingGroup = lawsWorkingGroupService.queryById(pid);
|
||||
if(workingGroup.getLevel() == 1 && StringUtils.isBlank(lawsWorkingGroup.getUserId())){
|
||||
throw new JeroBootException("管理权限不能为空");
|
||||
}
|
||||
lawsWorkingGroup.setLevel(workingGroup.getLevel() + 1);
|
||||
}else {
|
||||
lawsWorkingGroup.setLevel(1);
|
||||
}
|
||||
lawsWorkingGroup.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
lawsWorkingGroupService.add(lawsWorkingGroup);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑工作组
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:tree:edit")
|
||||
@AutoLog(value = "内部工作组-编辑工作组")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@ApiOperation(value="内部工作组-编辑工作组", notes="内部工作组-编辑工作组")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@Validated @RequestBody LawsWorkingGroup lawsWorkingGroup) {
|
||||
// 校验是否有权限
|
||||
lawsWorkingGroupService.editById(lawsWorkingGroup);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:tree:edit")
|
||||
@AutoLog(value = "内部工作组-编辑")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@ApiOperation(value="内部工作组-编辑", notes="内部工作组-编辑")
|
||||
@PostMapping(value = "/editWorkGroup")
|
||||
public Result<T> editWorkGroup(@Validated @RequestBody LawsWorkingGroup lawsWorkingGroup) {
|
||||
lawsWorkingGroupUserService.checkAuth(lawsWorkingGroup.getId());
|
||||
lawsWorkingGroupService.editById(lawsWorkingGroup);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除工作组
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:tree:delete")
|
||||
@AutoLog(value = "内部工作组-通过id删除工作组")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@ApiOperation(value="内部工作组-通过id删除工作组", notes="内部工作组-通过id删除工作组")
|
||||
@PostMapping(value = "/deleteWorkGroup")
|
||||
public Result<T> deleteWorkGroup(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
lawsWorkingGroupUserService.checkAuth(map.get("id"));
|
||||
//不能删除根节点
|
||||
LawsWorkingGroup group = lawsWorkingGroupService.getById(map.get("id"));
|
||||
if (StringUtils.isBlank(group.getPid())){
|
||||
throw new JeroBootException(ResultCommon.THE_TOPLEVEL_GROUP_CANNOT_BE_DELETED);
|
||||
}
|
||||
List<String> ids = new ArrayList<>();
|
||||
List<LawsWorkingGroup> list = lawsWorkingGroupService.realList();
|
||||
ids = lawsWorkingGroupService.allChildIdById(list, map.get("id"), ids);
|
||||
if (ids.size() > 0){
|
||||
LambdaUpdateWrapper<LawsWorkingGroup> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.in(LawsWorkingGroup::getId, ids);
|
||||
wrapper.set(LawsWorkingGroup::getDelFlag, CommonConstant.DEL_FLAG_1.toString());
|
||||
lawsWorkingGroupService.update(wrapper);
|
||||
}
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:tree:delete")
|
||||
@AutoLog(value = "内部工作组-通过id删除")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@ApiOperation(value="内部工作组-通过id删除", notes="内部工作组-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
//不能删除根节点
|
||||
LawsWorkingGroup group = lawsWorkingGroupService.getById(map.get("id"));
|
||||
if (StringUtils.isBlank(group.getPid())){
|
||||
throw new JeroBootException(ResultCommon.THE_TOPLEVEL_GROUP_CANNOT_BE_DELETED);
|
||||
}
|
||||
List<String> ids = new ArrayList<>();
|
||||
List<LawsWorkingGroup> list = lawsWorkingGroupService.realList();
|
||||
ids = lawsWorkingGroupService.allChildIdById(list, map.get("id"), ids);
|
||||
if (ids.size() > 0){
|
||||
LambdaUpdateWrapper<LawsWorkingGroup> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.in(LawsWorkingGroup::getId, ids);
|
||||
wrapper.set(LawsWorkingGroup::getDelFlag, CommonConstant.DEL_FLAG_1.toString());
|
||||
lawsWorkingGroupService.update(wrapper);
|
||||
}
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
}
|
||||
-316
@@ -1,316 +0,0 @@
|
||||
package com.jero.modules.sys.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.util.ImportExcelUtil;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroupUser;
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroupUserImport;
|
||||
import com.jero.modules.sys.service.ILawsWorkingGroupUserService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组人员关联表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@ApiSupport(order = 108)
|
||||
@Api(tags = "内部工作组人员关联")
|
||||
@RestController
|
||||
@RequestMapping("/sys/lawsWorkingGroupUser")
|
||||
@Slf4j
|
||||
public class LawsWorkingGroupUserController extends JeroController<LawsWorkingGroupUser, ILawsWorkingGroupUserService> {
|
||||
@Autowired
|
||||
private ILawsWorkingGroupUserService lawsWorkingGroupUserService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:search")
|
||||
@AutoLog(value = "内部工作组人员关联表-分页列表查询")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation(value = "内部工作组人员关联表-分页列表查询", notes = "内部工作组人员关联表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<LawsWorkingGroupUser>> queryPageList(LawsWorkingGroupUser lawsWorkingGroupUser,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
lawsWorkingGroupUser.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
IPage<LawsWorkingGroupUser> pageList = lawsWorkingGroupUserService.queryPage(lawsWorkingGroupUser, pageNo, pageSize, req);
|
||||
lawsWorkingGroupUserService.userAssignment(pageList.getRecords());
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:search")
|
||||
@AutoLog(value = "内部工作组人员关联表-列表查询")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value = "内部工作组人员关联表-列表查询", notes = "内部工作组人员关联表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsWorkingGroupUser>> queryList(LawsWorkingGroupUser lawsWorkingGroupUser, HttpServletRequest req) {
|
||||
lawsWorkingGroupUser.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
List<LawsWorkingGroupUser> list = lawsWorkingGroupUserService.queryList(lawsWorkingGroupUser, req);
|
||||
lawsWorkingGroupUserService.userAssignment(list);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:operate")
|
||||
@AutoLog(value = "内部工作组人员关联表-添加")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@ApiOperation(value = "内部工作组人员关联表-添加", notes = "内部工作组人员关联表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody LawsWorkingGroupUser lawsWorkingGroupUser) {
|
||||
if (StringUtils.isBlank(lawsWorkingGroupUser.getWorkingGroupId()) || StringUtils.isBlank(lawsWorkingGroupUser.getUserId())) {
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_PERSONNEL_AND_WORKGROUP);
|
||||
}
|
||||
// 校验是否有权限
|
||||
lawsWorkingGroupUserService.checkAuth(lawsWorkingGroupUser.getWorkingGroupId());
|
||||
|
||||
String userId = lawsWorkingGroupUser.getUserId();
|
||||
List<String> asList = Arrays.asList(userId.split(","));
|
||||
LambdaQueryWrapper<LawsWorkingGroupUser> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsWorkingGroupUser::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
wrapper.in(LawsWorkingGroupUser::getUserId, asList);
|
||||
wrapper.eq(LawsWorkingGroupUser::getWorkingGroupId, lawsWorkingGroupUser.getWorkingGroupId());
|
||||
List<LawsWorkingGroupUser> list = lawsWorkingGroupUserService.list(wrapper);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
String workNo;
|
||||
List<String> collect = list.stream().map(LawsWorkingGroupUser::getUserId).distinct().collect(Collectors.toList());
|
||||
StringJoiner joiner = new StringJoiner(",");
|
||||
for (String id : collect) {
|
||||
SysUser sysUser = sysUserService.getById(id);
|
||||
if (sysUser != null && StringUtils.isNotBlank(sysUser.getUsername())) {
|
||||
joiner.add(sysUser.getUsername());
|
||||
}
|
||||
}
|
||||
workNo = joiner.toString();
|
||||
throw new JeroBootException(ResultCommon.NUMBER_WORK_NO_ALREADY_EXISTS, workNo);
|
||||
}
|
||||
List<LawsWorkingGroupUser> groupUsers = new ArrayList<>();
|
||||
for (String id : asList) {
|
||||
LawsWorkingGroupUser workingGroupUser = new LawsWorkingGroupUser();
|
||||
workingGroupUser.setWorkingGroupId(lawsWorkingGroupUser.getWorkingGroupId());
|
||||
workingGroupUser.setUserId(id);
|
||||
workingGroupUser.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
groupUsers.add(workingGroupUser);
|
||||
}
|
||||
lawsWorkingGroupUserService.saveBatch(groupUsers);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:operate")
|
||||
@AutoLog(value = "内部工作组人员关联表-通过id删除")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@ApiOperation(value = "内部工作组人员关联表-通过id删除", notes = "内部工作组人员关联表-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
LawsWorkingGroupUser lawsWorkingGroupUser = lawsWorkingGroupUserService.getById(map.get("id"));
|
||||
if(Objects.isNull(lawsWorkingGroupUser)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
// 校验是否有权限
|
||||
lawsWorkingGroupUserService.checkAuth(lawsWorkingGroupUser.getWorkingGroupId());
|
||||
lawsWorkingGroupUserService.deleteById(map.get("id"));
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:operate")
|
||||
@AutoLog(value = "内部工作组人员关联表-导入")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@ApiOperation(value = "内部工作组人员关联表-导入", notes = "内部工作组人员关联表-导入")
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<?> importFile(MultipartFile file, String workingGroupId) throws Exception {
|
||||
String fileName = file.getOriginalFilename();
|
||||
// 上传文件为空
|
||||
if (StringUtils.isEmpty(fileName)) {
|
||||
throw new JeroBootException(ResultCommon.NO_FILES_IMPORTED);
|
||||
}
|
||||
if (StringUtils.isBlank(workingGroupId)) {
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_A_WORKGROUP_TO_IMPORT);
|
||||
}
|
||||
|
||||
// 校验是否有权限
|
||||
lawsWorkingGroupUserService.checkAuth(workingGroupId);
|
||||
|
||||
// 上传文件名格式不正确
|
||||
if (fileName.lastIndexOf(".") != -1 && !".xls".equals(fileName.substring(fileName.lastIndexOf(".")))) {
|
||||
throw new JeroBootException(ResultCommon.PLEASE_USE_A_FILE_WITH_THE_SUFFIX_XLS);
|
||||
}
|
||||
boolean b;
|
||||
try {
|
||||
b = ImportExcelUtil.checkTemplateTitle(file, LawsWorkingGroupUserImport.class, 0, 0);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException(ResultCommon.PLEASE_USE_A_FILE_WITH_THE_SUFFIX_XLS);
|
||||
}
|
||||
// 校验excel 字段是否正确
|
||||
if (!b) {
|
||||
throw new JeroBootException(ResultCommon.HEADER_INCONSISTENT_WITH_TEMPLATE);
|
||||
}
|
||||
|
||||
List<LawsWorkingGroupUser> all = new ArrayList<>();
|
||||
List<LawsWorkingGroupUserImport> list;
|
||||
try {
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(0);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
list = ExcelImportUtil.importExcel(file.getInputStream(), LawsWorkingGroupUserImport.class, params);
|
||||
} catch (Exception e) {
|
||||
throw new JeroBootException(e.getMessage());
|
||||
}
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
throw new JeroBootException(ResultCommon.IMPORT_DATA_CANNOT_BE_EMPTY);
|
||||
}
|
||||
|
||||
for (LawsWorkingGroupUserImport lawsWorkingGroupUserImport : list) {
|
||||
LawsWorkingGroupUser lawsWorkingGroupUser = new LawsWorkingGroupUser();
|
||||
lawsWorkingGroupUser.setUsername(lawsWorkingGroupUserImport.getUsername());
|
||||
lawsWorkingGroupUser.setRealname(lawsWorkingGroupUserImport.getRealname());
|
||||
all.add(lawsWorkingGroupUser);
|
||||
}
|
||||
//校验导入正确性,msg是错误信息
|
||||
List<String> msg = importExcelCheck(all,workingGroupId);
|
||||
if (!CollectionUtils.isEmpty(msg)) {
|
||||
return Result.error(MessageUtils.getMessage(ResultCommon.ERROR),msg);
|
||||
}
|
||||
for (LawsWorkingGroupUser groupUser : all) {
|
||||
String username = groupUser.getUsername();
|
||||
SysUser userByWorkNo = sysUserService.getUserByName(username);
|
||||
groupUser.setUserId(userByWorkNo.getId());
|
||||
groupUser.setWorkingGroupId(workingGroupId);
|
||||
groupUser.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
}
|
||||
lawsWorkingGroupUserService.saveBatch(all);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:export")
|
||||
@AutoLog(value = "内部工作组人员关联表-导出")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@ApiOperation(value = "内部工作组人员关联表-导出", notes = "内部工作组人员关联表-导出")
|
||||
@GetMapping(value = "/export")
|
||||
public ModelAndView template(@RequestParam(required = false) String workingGroupId, @RequestParam(required = false) String realname, @RequestParam(required = false) String username, @RequestParam(required = false) String userRoleName, @RequestParam(required = false) String userPostName, HttpServletRequest request) {
|
||||
return lawsWorkingGroupUserService.export(workingGroupId,realname,username,userRoleName,userPostName, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据校验错误信息
|
||||
*/
|
||||
public List<String> importExcelCheck(List<LawsWorkingGroupUser> all,String workingGroupId) {
|
||||
return validateWorkNo(all,workingGroupId);
|
||||
}
|
||||
|
||||
private List<String> validateWorkNo(List<LawsWorkingGroupUser> all,String workingGroupId) {
|
||||
List<SysUser> listSysUser = sysUserService.list();
|
||||
LambdaQueryWrapper<LawsWorkingGroupUser> queryLawsWorkingGroupUser = new LambdaQueryWrapper<>();
|
||||
queryLawsWorkingGroupUser.eq(LawsWorkingGroupUser::getWorkingGroupId,workingGroupId);
|
||||
Set<String> existingWorkNos = lawsWorkingGroupUserService.list(queryLawsWorkingGroupUser).stream().map(LawsWorkingGroupUser::getUserId).collect(Collectors.toSet());
|
||||
return IntStream.range(0, all.size())
|
||||
.mapToObj(i -> {
|
||||
LawsWorkingGroupUser lawsWorkingGroupUser = all.get(i);
|
||||
String username = lawsWorkingGroupUser.getUsername();
|
||||
String realname = lawsWorkingGroupUser.getRealname();
|
||||
if (StringUtils.isBlank(username)) {
|
||||
return MessageUtils.getMessage(ResultCommon.THE_JOB_NUMBER_CANNOT_BE_EMPTY_EXPORT, (i + 2));
|
||||
}
|
||||
if (StringUtils.isBlank(realname)) {
|
||||
return MessageUtils.getMessage(ResultCommon.THE_REAL_NAME_CANNOT_BE_EMPTY_EXPORT, (i + 2));
|
||||
}
|
||||
if(!CollectionUtils.isEmpty(listSysUser)){
|
||||
String finalUsername = username;
|
||||
Optional<SysUser> op = listSysUser.stream().filter(o->Objects.equals(o.getUsername(), finalUsername)).findFirst();
|
||||
if(!op.isPresent()){
|
||||
return MessageUtils.getMessage(ResultCommon.JOB_NUMBER_DOES_NOT_EXIST_EXPORT, (i + 2));
|
||||
}
|
||||
username = op.get().getId();
|
||||
if(!Objects.equals(op.get().getRealname(),realname)){
|
||||
return MessageUtils.getMessage(ResultCommon.THE_REAL_NAME_AND_JOB_NUMBER_MISMATCH_EXPORT, (i + 2));
|
||||
}
|
||||
}
|
||||
if (!existingWorkNos.add(username)) {
|
||||
return MessageUtils.getMessage(ResultCommon.DUPLICATE_JOB_NUMBER_EXPORT, (i + 2));
|
||||
}
|
||||
return null;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("sys:innerWorkingGroup:operate")
|
||||
@AutoLog(value = "内部工作组人员关联表-下载模板")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@ApiOperation(value = "内部工作组人员关联表-下载模板", notes = "内部工作组人员关联表-下载模板")
|
||||
@GetMapping(value = "/download/template")
|
||||
public ModelAndView template() {
|
||||
// AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
String title = "内部工作组人员表模板";
|
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(FILE_NAME, title);
|
||||
mv.addObject(CLASS, LawsWorkingGroupUserImport.class);
|
||||
ExportParams exportParams = new ExportParams(null, title);
|
||||
// 导出xls
|
||||
mv.addObject(PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, new ArrayList<T>());
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
package com.jero.modules.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 企标级别映射管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_enterprise_standard_level")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_enterprise_standard_level对象", description="企标级别映射管理")
|
||||
public class LawsEnterpriseStandardLevel implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**企标等级分类(0、1、2、3)ID*/
|
||||
@ApiModelProperty(value = "企标等级分类(0、1、2、3)ID")
|
||||
private String gradeId;
|
||||
|
||||
/**可查看部门ID*/
|
||||
@ApiModelProperty(value = "可查看部门ID")
|
||||
private String deptId;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
}
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
package com.jero.modules.sys.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 友情链接管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_friendly_links")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_friendly_links对象", description="友情链接管理")
|
||||
public class LawsFriendlyLinks implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**名称*/
|
||||
@NotBlank(message = "name not null")
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**链接*/
|
||||
@NotBlank(message = "link not null")
|
||||
@ApiModelProperty(value = "链接")
|
||||
private String link;
|
||||
|
||||
/**是否上架(0-是、1-否)*/
|
||||
@NotBlank(message = "grounding not null")
|
||||
@ApiModelProperty(value = "是否上架(0-是、1-否)")
|
||||
private String grounding;
|
||||
|
||||
/**排序*/
|
||||
@NotBlank(message = "sort not null")
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
}
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
package com.jero.modules.sys.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 级别
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_grade")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_grade对象", description="级别")
|
||||
public class LawsGrade implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**等级(0、1、2、3)*/
|
||||
@ApiModelProperty(value = "等级(0、1、2、3)")
|
||||
private int level;
|
||||
|
||||
/**备注*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String notes;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**可查看部门ID*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "可查看部门ID")
|
||||
private String deptIds;
|
||||
|
||||
/**可查看部门名字*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "可查看部门名字")
|
||||
private String deptNames;
|
||||
}
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
package com.jero.modules.sys.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_working_group")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_working_group对象", description="内部工作组")
|
||||
public class LawsWorkingGroup implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**父级节点*/
|
||||
@ApiModelProperty(value = "父级节点")
|
||||
private String pid;
|
||||
|
||||
/**名称*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**层级*/
|
||||
@ApiModelProperty(value = "层级")
|
||||
private Integer level;
|
||||
|
||||
/**管理权限(只有分会层级配置)*/
|
||||
@ApiModelProperty(value = "管理权限(只有分会层级配置)")
|
||||
private String userId;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**删除状态(0-正常,1-删除)*/
|
||||
@ApiModelProperty(value = "删除状态(0-正常,1-删除)")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<LawsWorkingGroup> subset;
|
||||
|
||||
/**
|
||||
* 真实姓名(用户名)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
}
|
||||
-92
@@ -1,92 +0,0 @@
|
||||
package com.jero.modules.sys.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组人员关联表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_working_group_user")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_working_group_user对象", description="内部工作组人员关联表")
|
||||
public class LawsWorkingGroupUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**人员ID*/
|
||||
@ApiModelProperty(value = "人员ID")
|
||||
private String userId;
|
||||
|
||||
/**内部工作组ID*/
|
||||
@ApiModelProperty(value = "内部工作组ID")
|
||||
private String workingGroupId;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**删除状态(0-正常,1-删除)*/
|
||||
@ApiModelProperty(value = "删除状态(0-正常,1-删除)")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "姓名")
|
||||
@Excel(name = "姓名",width = 15)
|
||||
private String realname;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "工号")
|
||||
@Excel(name = "工号",width = 15)
|
||||
private String username;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "角色")
|
||||
@Excel(name = "角色",width = 15)
|
||||
private String userRoleName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "岗位")
|
||||
@Excel(name = "岗位",width = 15)
|
||||
private String userPostName;
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.sys.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.sys.entity.LawsEnterpriseStandardLevel;
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsEnterprisestandardLevelMapper extends BaseMapper<LawsEnterpriseStandardLevel> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.sys.mapper;
|
||||
|
||||
import com.jero.modules.sys.entity.LawsFriendlyLinks;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 友情链接管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsFriendlyLinksMapper extends BaseMapper<LawsFriendlyLinks> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.sys.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.sys.entity.LawsGrade;
|
||||
|
||||
/**
|
||||
* @Description: 级别
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsGradeMapper extends BaseMapper<LawsGrade> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.sys.mapper;
|
||||
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroup;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsWorkingGroupMapper extends BaseMapper<LawsWorkingGroup> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.jero.modules.sys.mapper;
|
||||
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroupUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组人员关联表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsWorkingGroupUserMapper extends BaseMapper<LawsWorkingGroupUser> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
<?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.jero.modules.sys.mapper.LawsEnterprisestandardLevelMapper">
|
||||
<resultMap id="LawsEnterpriseStandardLevelResultMap" type="com.jero.modules.sys.entity.LawsEnterpriseStandardLevel">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="org_code" property="orgCode" />
|
||||
<result column="grade_id" property="gradeId" />
|
||||
<result column="dept_id" property="deptId" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
<?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.jero.modules.sys.mapper.LawsFriendlyLinksMapper">
|
||||
<resultMap id="LawsFriendlyLinksResultMap" type="com.jero.modules.sys.entity.LawsFriendlyLinks">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="org_code" property="orgCode" />
|
||||
<result column="name" property="name" />
|
||||
<result column="link" property="link" />
|
||||
<result column="grounding" property="grounding" />
|
||||
<result column="sort" property="sort" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
<?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.jero.modules.sys.mapper.LawsGradeMapper">
|
||||
<resultMap id="LawsGradeMapperResultMap" type="com.jero.modules.sys.entity.LawsGrade">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="org_code" property="orgCode" />
|
||||
<result column="level" property="level" />
|
||||
<result column="notes" property="notes" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
<?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.jero.modules.sys.mapper.LawsWorkingGroupMapper">
|
||||
<resultMap id="LawsWorkingGroupResultMap" type="com.jero.modules.sys.entity.LawsWorkingGroup">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="org_code" property="orgCode" />
|
||||
<result column="pid" property="pid" />
|
||||
<result column="name" property="name" />
|
||||
<result column="level" property="level" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
<?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.jero.modules.sys.mapper.LawsWorkingGroupUserMapper">
|
||||
<resultMap id="LawsWorkingGroupUserResultMap" type="com.jero.modules.sys.entity.LawsWorkingGroupUser">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="org_code" property="orgCode" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="working_group_id" property="workingGroupId" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
package com.jero.modules.sys.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroup;
|
||||
import com.jero.modules.sys.entity.LawsEnterpriseStandardLevel;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 企标级别映射管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsEnterpriseStandardLevelService extends IService<LawsEnterpriseStandardLevel> {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
List<LawsEnterpriseStandardLevel> queryList(LawsEnterpriseStandardLevel lawsEnterpriseStandardLevel, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
void editById(LawsEnterpriseStandardLevel lawsEnterpriseStandardLevel);
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package com.jero.modules.sys.service;
|
||||
|
||||
import com.jero.modules.sys.entity.LawsFriendlyLinks;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 友情链接管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsFriendlyLinksService extends IService<LawsFriendlyLinks> {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
List<LawsFriendlyLinks> queryList(LawsFriendlyLinks lawsFriendlyLinks, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
void add(LawsFriendlyLinks lawsFriendlyLinks);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
void editById(LawsFriendlyLinks lawsFriendlyLinks);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.jero.modules.sys.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.sys.entity.LawsGrade;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 级别
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsGradeService extends IService<LawsGrade> {
|
||||
|
||||
/**
|
||||
* 级别-列表查询
|
||||
*/
|
||||
List<LawsGrade> queryList();
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
void edit(LawsGrade lawsGrade);
|
||||
}
|
||||
-86
@@ -1,86 +0,0 @@
|
||||
package com.jero.modules.sys.service;
|
||||
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsWorkingGroupService extends IService<LawsWorkingGroup> {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
List<LawsWorkingGroup> queryList();
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsWorkingGroup
|
||||
* @return
|
||||
*/
|
||||
void add(LawsWorkingGroup lawsWorkingGroup);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsWorkingGroup
|
||||
* @return
|
||||
*/
|
||||
void editById(LawsWorkingGroup lawsWorkingGroup);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsWorkingGroup queryById(String id);
|
||||
|
||||
/**
|
||||
* 查询所有未逻辑删除的数据
|
||||
*/
|
||||
List<LawsWorkingGroup> realList();
|
||||
|
||||
/**
|
||||
* 对列表数据转树结构列表(pid为空当作开始节点)
|
||||
*/
|
||||
List<LawsWorkingGroup> convertToTree(List<LawsWorkingGroup> list);
|
||||
List<LawsWorkingGroup> convertToTree(List<LawsWorkingGroup> list, String name);
|
||||
|
||||
/**
|
||||
* 对列表数据转树结构列表(指定开始节点)
|
||||
*/
|
||||
LawsWorkingGroup convertToTreeById(List<LawsWorkingGroup> list, String id);
|
||||
|
||||
/**
|
||||
* 获取指定节点以及所有子节点ID
|
||||
* @param list 所有数据集合
|
||||
* @param id 指定节点ID
|
||||
* @param ids 指定节点以及所有子节点ID
|
||||
* @return
|
||||
*/
|
||||
List<String> allChildIdById(List<LawsWorkingGroup> list, String id, List<String> ids);
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
package com.jero.modules.sys.service;
|
||||
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroupUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组人员关联表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsWorkingGroupUserService extends IService<LawsWorkingGroupUser> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsWorkingGroupUser
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<LawsWorkingGroupUser> queryPage(LawsWorkingGroupUser lawsWorkingGroupUser, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsWorkingGroupUser
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<LawsWorkingGroupUser> queryList(LawsWorkingGroupUser lawsWorkingGroupUser, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsWorkingGroupUser
|
||||
* @return
|
||||
*/
|
||||
void add(LawsWorkingGroupUser lawsWorkingGroupUser);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsWorkingGroupUser
|
||||
* @return
|
||||
*/
|
||||
void editById(LawsWorkingGroupUser lawsWorkingGroupUser);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsWorkingGroupUser queryById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 为人员赋值姓名、工号、角色、岗位
|
||||
*/
|
||||
public void userAssignment(List<LawsWorkingGroupUser> list);
|
||||
|
||||
/**
|
||||
* 内部工作组模糊搜索获取满足条件的用户id集合,全为空的话就返回空
|
||||
* @param realname 姓名
|
||||
* @param username 工号
|
||||
* @param userRoleName 角色
|
||||
* @param userPostName 职位
|
||||
* @return
|
||||
*/
|
||||
List<String> lawsWorkingGroupUserSearch(String realname, String username, String userRoleName, String userPostName);
|
||||
|
||||
/**
|
||||
* 校验用户有无权限
|
||||
* @author LQT
|
||||
* @date 2023/11/8 17:27
|
||||
* @param workingGroupId 工作id
|
||||
* @return void
|
||||
*/
|
||||
void checkAuth(String workingGroupId);
|
||||
|
||||
/**
|
||||
* 导出
|
||||
* @author LQT
|
||||
* @date 2023/11/9 9:26
|
||||
* @param workingGroupId
|
||||
* @param realname
|
||||
* @param username
|
||||
* @param userRoleName
|
||||
* @param userPostName
|
||||
* @param request
|
||||
* @return org.springframework.web.servlet.ModelAndView
|
||||
*/
|
||||
ModelAndView export(String workingGroupId,String realname,String username,String userRoleName,String userPostName,HttpServletRequest request);
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.jero.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.sys.entity.LawsEnterpriseStandardLevel;
|
||||
import com.jero.modules.sys.mapper.LawsEnterprisestandardLevelMapper;
|
||||
import com.jero.modules.sys.service.ILawsEnterpriseStandardLevelService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 企标级别映射管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class LawsEnterpriseStandardLevelServiceImpl extends ServiceImpl<LawsEnterprisestandardLevelMapper, LawsEnterpriseStandardLevel> implements ILawsEnterpriseStandardLevelService {
|
||||
|
||||
@Override
|
||||
public List<LawsEnterpriseStandardLevel> queryList(LawsEnterpriseStandardLevel lawsEnterpriseStandardLevel, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(lawsEnterpriseStandardLevel, req.getParameterMap()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editById(LawsEnterpriseStandardLevel lawsEnterpriseStandardLevel) {
|
||||
|
||||
}
|
||||
}
|
||||
-71
@@ -1,71 +0,0 @@
|
||||
package com.jero.modules.sys.service.impl;
|
||||
|
||||
import com.jero.modules.sys.entity.LawsFriendlyLinks;
|
||||
import com.jero.modules.sys.mapper.LawsFriendlyLinksMapper;
|
||||
import com.jero.modules.sys.service.ILawsFriendlyLinksService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 友情链接管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class LawsFriendlyLinksServiceImpl extends ServiceImpl<LawsFriendlyLinksMapper, LawsFriendlyLinks> implements ILawsFriendlyLinksService {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@Override
|
||||
public List<LawsFriendlyLinks> queryList(LawsFriendlyLinks lawsFriendlyLinks, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(lawsFriendlyLinks, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsFriendlyLinks lawsFriendlyLinks) {
|
||||
Date now = new Date();
|
||||
lawsFriendlyLinks.setCreateTime(now);
|
||||
lawsFriendlyLinks.setUpdateTime(now);
|
||||
save(lawsFriendlyLinks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsFriendlyLinks lawsFriendlyLinks) {
|
||||
Date now = new Date();
|
||||
lawsFriendlyLinks.setUpdateTime(now);
|
||||
saveOrUpdate(lawsFriendlyLinks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
-84
@@ -1,84 +0,0 @@
|
||||
package com.jero.modules.sys.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.sys.entity.LawsEnterpriseStandardLevel;
|
||||
import com.jero.modules.sys.entity.LawsGrade;
|
||||
import com.jero.modules.sys.mapper.LawsGradeMapper;
|
||||
import com.jero.modules.sys.service.ILawsEnterpriseStandardLevelService;
|
||||
import com.jero.modules.sys.service.ILawsGradeService;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 级别
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class LawsGradeServiceImpl extends ServiceImpl<LawsGradeMapper, LawsGrade> implements ILawsGradeService {
|
||||
|
||||
@Autowired
|
||||
private ILawsGradeService lawsGradeService;
|
||||
@Autowired
|
||||
private ILawsEnterpriseStandardLevelService lawsEnterpriseStandardLevelService;
|
||||
@Autowired
|
||||
private ISysDepartService sysDepartService;
|
||||
|
||||
@Override
|
||||
public List<LawsGrade> queryList() {
|
||||
List<LawsGrade> grades = lawsGradeService.list();
|
||||
List<LawsEnterpriseStandardLevel> standardLevels = lawsEnterpriseStandardLevelService.list();
|
||||
if (standardLevels == null || standardLevels.isEmpty() || grades == null || grades.isEmpty()){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Map<String, List<LawsEnterpriseStandardLevel>> map = standardLevels.stream().collect(Collectors.groupingBy(LawsEnterpriseStandardLevel::getGradeId));
|
||||
for (LawsGrade grade : grades) {
|
||||
List<LawsEnterpriseStandardLevel> levels = map.get(grade.getId());
|
||||
if (levels != null && !levels.isEmpty()){
|
||||
List<String> collect = levels.stream().map(LawsEnterpriseStandardLevel::getDeptId).distinct().collect(Collectors.toList());
|
||||
List<SysDepart> sysDepartList = sysDepartService.listByIds(collect);
|
||||
String departNames = sysDepartList.stream().map(SysDepart::getDepartName).collect(Collectors.joining(","));
|
||||
String departIds = sysDepartList.stream().map(SysDepart::getId).collect(Collectors.joining(","));
|
||||
grade.setDeptNames(departNames);
|
||||
grade.setDeptIds(departIds);
|
||||
}
|
||||
}
|
||||
grades.get(0).setDeptNames("供应商");
|
||||
grades.get(3).setDeptNames("主起草部门");
|
||||
grades.get(3).setDeptIds(null);
|
||||
return grades;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(LawsGrade lawsGrade) {
|
||||
//每次更新都删除原有的所有关联部门,重新添加
|
||||
LambdaQueryWrapper<LawsEnterpriseStandardLevel> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsEnterpriseStandardLevel::getGradeId, lawsGrade.getId());
|
||||
lawsEnterpriseStandardLevelService.remove(wrapper);
|
||||
|
||||
List<LawsEnterpriseStandardLevel> levels = new ArrayList<>();
|
||||
String deptIds = lawsGrade.getDeptIds();
|
||||
String id = lawsGrade.getId();
|
||||
List<String> deptIdList = Arrays.stream(deptIds.split(",")).distinct().collect(Collectors.toList());
|
||||
for (String deptId : deptIdList) {
|
||||
LawsEnterpriseStandardLevel level = new LawsEnterpriseStandardLevel();
|
||||
level.setDeptId(deptId);
|
||||
level.setGradeId(id);
|
||||
levels.add(level);
|
||||
}
|
||||
lawsEnterpriseStandardLevelService.saveBatch(levels);
|
||||
lawsGradeService.updateById(lawsGrade);
|
||||
}
|
||||
}
|
||||
-234
@@ -1,234 +0,0 @@
|
||||
package com.jero.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroup;
|
||||
import com.jero.modules.sys.mapper.LawsWorkingGroupMapper;
|
||||
import com.jero.modules.sys.service.ILawsWorkingGroupService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class LawsWorkingGroupServiceImpl extends ServiceImpl<LawsWorkingGroupMapper, LawsWorkingGroup> implements ILawsWorkingGroupService {
|
||||
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@Override
|
||||
public List<LawsWorkingGroup> queryList() {
|
||||
LambdaQueryWrapper<LawsWorkingGroup> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsWorkingGroup::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
return list(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsWorkingGroup
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsWorkingGroup lawsWorkingGroup) {
|
||||
Date now = new Date();
|
||||
lawsWorkingGroup.setCreateTime(now);
|
||||
lawsWorkingGroup.setUpdateTime(now);
|
||||
save(lawsWorkingGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsWorkingGroup
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsWorkingGroup lawsWorkingGroup) {
|
||||
Date now = new Date();
|
||||
lawsWorkingGroup.setUpdateTime(now);
|
||||
saveOrUpdate(lawsWorkingGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsWorkingGroup queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LawsWorkingGroup> realList() {
|
||||
LambdaQueryWrapper<LawsWorkingGroup> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsWorkingGroup::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
List<LawsWorkingGroup> list = list(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对列表数据转树结构列表(pid为空当作开始节点)
|
||||
*/
|
||||
@Override
|
||||
public List<LawsWorkingGroup> convertToTree(List<LawsWorkingGroup> list, String name) {
|
||||
List<LawsWorkingGroup> matchedNodes = list.stream().filter(node -> node.getName().contains(name)).collect(Collectors.toList());
|
||||
if (matchedNodes.isEmpty()) {
|
||||
return Collections.singletonList(list.get(0));
|
||||
}
|
||||
Set<LawsWorkingGroup> nodesSet = new HashSet<>();
|
||||
for (LawsWorkingGroup matchedNode : matchedNodes) {
|
||||
nodesSet.addAll(findPathToRoot(list, matchedNode));
|
||||
nodesSet.addAll(findAllChildren(list, matchedNode));
|
||||
}
|
||||
List<LawsWorkingGroup> LawsWorkingGroups = new ArrayList<>(nodesSet);
|
||||
return this.convertToTree(LawsWorkingGroups);
|
||||
}
|
||||
private Set<LawsWorkingGroup> findPathToRoot(List<LawsWorkingGroup> list, LawsWorkingGroup node) {
|
||||
Set<LawsWorkingGroup> pathNodes = new HashSet<>();
|
||||
LawsWorkingGroup currentHolder = node;
|
||||
while (currentHolder != null) {
|
||||
pathNodes.add(currentHolder);
|
||||
LawsWorkingGroup finalCurrentHolder = currentHolder;
|
||||
currentHolder = list.stream()
|
||||
.filter(n -> n.getId().equals(finalCurrentHolder.getPid()))
|
||||
.findFirst().orElse(null);
|
||||
}
|
||||
return pathNodes;
|
||||
}
|
||||
private Set<LawsWorkingGroup> findAllChildren(List<LawsWorkingGroup> list, LawsWorkingGroup node) {
|
||||
Set<LawsWorkingGroup> childrenSet = new HashSet<>();
|
||||
List<LawsWorkingGroup> directChildren = list.stream().filter(n -> n.getPid().equals(node.getId())).collect(Collectors.toList());
|
||||
for (LawsWorkingGroup child : directChildren) {
|
||||
childrenSet.add(child);
|
||||
childrenSet.addAll(findAllChildren(list, child));
|
||||
}
|
||||
return childrenSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LawsWorkingGroup> convertToTree(List<LawsWorkingGroup> list) {
|
||||
if (list == null || list.size() == 0){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<LawsWorkingGroup> treeList = new ArrayList<>();
|
||||
List<SysUser> listSysUser = sysUserService.list();
|
||||
for (LawsWorkingGroup group : list) {
|
||||
if (StringUtils.isBlank(group.getPid())) {
|
||||
group.setLevel(1);
|
||||
addChildGroups(group, list, listSysUser);
|
||||
treeList.add(group);
|
||||
}
|
||||
}
|
||||
return treeList;
|
||||
}
|
||||
private void addChildGroups(LawsWorkingGroup parentGroup, List<LawsWorkingGroup> list, List<SysUser> listSysUser) {
|
||||
List<LawsWorkingGroup> childGroups = new ArrayList<>();
|
||||
for (LawsWorkingGroup group : list) {
|
||||
if (StringUtils.isNotBlank(group.getPid()) && parentGroup.getId().equals(group.getPid())) {
|
||||
group.setLevel(parentGroup.getLevel() + 1);
|
||||
if(!CollectionUtils.isEmpty(listSysUser) && !StringUtils.isBlank(group.getUserId())){
|
||||
Optional<SysUser> op = listSysUser.stream().filter(o->Objects.equals(o.getId(),group.getUserId())).findFirst();
|
||||
op.ifPresent(sysUser -> group.setUserName(sysUser.getRealname() + "(" + sysUser.getUsername() + ")"));
|
||||
}
|
||||
addChildGroups(group, list, listSysUser);
|
||||
childGroups.add(group);
|
||||
}
|
||||
}
|
||||
parentGroup.setSubset(childGroups);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对列表数据转树结构列表(指定开始节点)
|
||||
*/
|
||||
@Override
|
||||
public LawsWorkingGroup convertToTreeById(List<LawsWorkingGroup> list, String id) {
|
||||
if (list == null || list.size() == 0 || StringUtils.isBlank(id)){
|
||||
return null;
|
||||
}
|
||||
LawsWorkingGroup root = null;
|
||||
for (LawsWorkingGroup group : list) {
|
||||
if (group.getId().equals(id)) {
|
||||
root = group;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (root == null) {
|
||||
return null; // 如果没有找到指定的id,返回null
|
||||
}
|
||||
addChildGroupsById(root, list);
|
||||
return root;
|
||||
}
|
||||
private void addChildGroupsById(LawsWorkingGroup parentGroup, List<LawsWorkingGroup> list) {
|
||||
List<LawsWorkingGroup> childGroups = new ArrayList<>();
|
||||
for (LawsWorkingGroup group : list) {
|
||||
if (StringUtils.isNotBlank(group.getPid()) && parentGroup.getId().equals(group.getPid())) {
|
||||
addChildGroupsById(group, list);
|
||||
childGroups.add(group);
|
||||
}
|
||||
}
|
||||
parentGroup.setSubset(childGroups);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定节点以及所有子节点ID
|
||||
*/
|
||||
@Override
|
||||
public List<String> allChildIdById(List<LawsWorkingGroup> list, String id, List<String> ids) {
|
||||
if (list == null || list.size() == 0){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<String> collect = list.stream().filter(LawsWorkingGroup -> id.equals(LawsWorkingGroup.getPid())).map(LawsWorkingGroup::getId).collect(Collectors.toList());
|
||||
for (String s : collect) {
|
||||
allChildIdById(list, s, ids);
|
||||
}
|
||||
ids.add(id);
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
-336
@@ -1,336 +0,0 @@
|
||||
package com.jero.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroup;
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroupUser;
|
||||
import com.jero.modules.sys.mapper.LawsWorkingGroupUserMapper;
|
||||
import com.jero.modules.sys.service.ILawsWorkingGroupService;
|
||||
import com.jero.modules.sys.service.ILawsWorkingGroupUserService;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.entity.SysUserRole;
|
||||
import com.jero.modules.system.service.ISysRoleService;
|
||||
import com.jero.modules.system.service.ISysUserRoleService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 内部工作组人员关联表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class LawsWorkingGroupUserServiceImpl extends ServiceImpl<LawsWorkingGroupUserMapper, LawsWorkingGroupUser> implements ILawsWorkingGroupUserService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private ISysRoleService sysRoleService;
|
||||
@Autowired
|
||||
private ISysUserRoleService sysUserRoleService;
|
||||
@Resource
|
||||
private ILawsWorkingGroupService lawsWorkingGroupService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询, TODO 改为一个联表查询不行吗??
|
||||
*/
|
||||
@Override
|
||||
public IPage<LawsWorkingGroupUser> queryPage(LawsWorkingGroupUser lawsWorkingGroupUser, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<LawsWorkingGroupUser> page = new Page<>(pageNo, pageSize);
|
||||
String realname = lawsWorkingGroupUser.getRealname();
|
||||
String userName = lawsWorkingGroupUser.getUsername();
|
||||
String userRoleName = lawsWorkingGroupUser.getUserRoleName();
|
||||
String userPostName = lawsWorkingGroupUser.getUserPostName();
|
||||
String workingGroupId = lawsWorkingGroupUser.getWorkingGroupId();
|
||||
|
||||
QueryWrapper<LawsWorkingGroupUser> wrapper = getWrapper(realname, userName, userRoleName, userPostName, workingGroupId);
|
||||
// 没选上面四个筛选条件时
|
||||
return page(page, wrapper);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private QueryWrapper<LawsWorkingGroupUser> getWrapper(String realname, String userName, String userRoleName, String userPostName, String workingGroupId) {
|
||||
List<String> workingGroupIds = getWorkingGroupIds(workingGroupId);
|
||||
QueryWrapper<LawsWorkingGroupUser> wrapper = new QueryWrapper<>();
|
||||
wrapper.select("user_id","max(working_group_id) as working_group_id","max(id) as id");
|
||||
if(!CollectionUtils.isEmpty(workingGroupIds)){
|
||||
wrapper.in("working_group_id", workingGroupIds);
|
||||
}
|
||||
if (!StringUtils.isAllBlank(realname, userName, userRoleName, userPostName)){
|
||||
List<String> ids = lawsWorkingGroupUserSearch(realname, userName, userRoleName, userPostName);
|
||||
if (CollectionUtils.isEmpty(ids)){
|
||||
ids.add("-1");
|
||||
}
|
||||
ids = ids.stream().distinct().collect(Collectors.toList());
|
||||
wrapper.in("user_id", ids);
|
||||
}
|
||||
wrapper.groupBy("user_id");
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<String> getWorkingGroupIds(String workingGroupId) {
|
||||
List<String> workingGroupIds = new ArrayList<>();
|
||||
if(!StringUtils.isBlank(workingGroupId)){
|
||||
LawsWorkingGroup lawsWorkingGroup = lawsWorkingGroupService.queryById(workingGroupId);
|
||||
if(Objects.isNull(lawsWorkingGroup)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
// 层级二查看分会下所有工作组数据
|
||||
if(Objects.equals(lawsWorkingGroup.getLevel(),2)){
|
||||
LambdaQueryWrapper<LawsWorkingGroup> queryLawsWorkingGroup = new LambdaQueryWrapper<>();
|
||||
queryLawsWorkingGroup.eq(LawsWorkingGroup::getPid,lawsWorkingGroup.getId());
|
||||
List<LawsWorkingGroup> listLawsWorkingGroup = lawsWorkingGroupService.list(queryLawsWorkingGroup);
|
||||
if(!CollectionUtils.isEmpty(listLawsWorkingGroup)){
|
||||
workingGroupIds.addAll(listLawsWorkingGroup.stream().map(LawsWorkingGroup::getId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
// 层级3 直接查工作组数据
|
||||
if(Objects.equals(lawsWorkingGroup.getLevel(),3)){
|
||||
workingGroupIds.add(workingGroupId);
|
||||
}
|
||||
}
|
||||
return workingGroupIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部工作组模糊搜索获取满足条件的用户id集合
|
||||
* @param userName 姓名
|
||||
* @param userWorkNo 工号
|
||||
* @param userRoleName 角色
|
||||
* @param userPostName 职位
|
||||
* @return 满足条件的用户id集合
|
||||
*/
|
||||
@Override
|
||||
public List<String> lawsWorkingGroupUserSearch(String userName, String userWorkNo, String userRoleName, String userPostName) {
|
||||
if (StringUtils.isAllBlank(userName, userWorkNo, userRoleName, userPostName)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<SysRole> roles;
|
||||
List<String> userIds = new ArrayList<>();
|
||||
userIds.add("-1");
|
||||
if (StringUtils.isNotBlank(userRoleName)) {
|
||||
LambdaQueryWrapper<SysRole> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(SysRole::getRoleName, userRoleName);
|
||||
roles = sysRoleService.list(wrapper);
|
||||
if (roles.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<SysUserRole> sysUserRoles = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getRoleId, roles.stream().map(SysRole::getId).collect(Collectors.toList())));
|
||||
if (sysUserRoles.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
userIds = sysUserRoles.stream().map(SysUserRole::getUserId).distinct().collect(Collectors.toList());
|
||||
if (userIds.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotBlank(userName), SysUser::getRealname, userName)
|
||||
.like(StringUtils.isNotBlank(userWorkNo), SysUser::getUsername, userWorkNo)
|
||||
.in(!userIds.isEmpty() && StringUtils.isNotBlank(userRoleName), SysUser::getId, userIds)
|
||||
.like(StringUtils.isNotBlank(userPostName), SysUser::getPost, userPostName);
|
||||
|
||||
List<SysUser> userRoles = sysUserService.list(wrapper);
|
||||
return userRoles.stream().map(SysUser::getId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAuth(String workingGroupId) {
|
||||
// 验证当前登录人员是否可以维护人员
|
||||
LawsWorkingGroup lawsWorkingGroup = lawsWorkingGroupService.queryById(workingGroupId);
|
||||
if(Objects.isNull(lawsWorkingGroup)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
if(!Objects.equals(lawsWorkingGroup.getLevel(),2) && !Objects.equals(lawsWorkingGroup.getLevel(),3)){
|
||||
throw new JeroBootException(ResultCommon.HORIZONTAL_TRANSGRESSION);
|
||||
}
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(!Objects.equals(lawsWorkingGroup.getUserId(),loginUser.getId())){
|
||||
throw new JeroBootException(ResultCommon.HORIZONTAL_TRANSGRESSION);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView export(String workingGroupId, String realname, String userName, String userRoleName, String userPostName, HttpServletRequest request) {
|
||||
if (StringUtils.isBlank(workingGroupId)) {
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_A_WORKGROUP_TO_EXPORT);
|
||||
}
|
||||
|
||||
//获取数据,分为三种情况:1、选中ID;2、没选ID且选了姓名、工号、角色、岗位四个筛选框;3、没选ID且没选四个筛选框
|
||||
List<LawsWorkingGroupUser> dos;
|
||||
|
||||
QueryWrapper<LawsWorkingGroupUser> wrapper = getWrapper(realname, userName, userRoleName, userPostName, workingGroupId);
|
||||
|
||||
//获取选中数据
|
||||
String selections = request.getParameter("selections");
|
||||
if (StringUtils.isNotBlank(selections)) {
|
||||
wrapper.in("id",Arrays.asList(selections.split(",")));
|
||||
}
|
||||
dos = list(wrapper);
|
||||
|
||||
userAssignment(dos);
|
||||
|
||||
// AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
String title = "内部工作组人员表";
|
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(JeroController.FILE_NAME, title);
|
||||
mv.addObject(JeroController.CLASS, LawsWorkingGroupUser.class);
|
||||
ExportParams exportParams = new ExportParams(null, title);
|
||||
// 导出xls
|
||||
mv.addObject(JeroController.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, dos);
|
||||
return mv;
|
||||
}
|
||||
|
||||
|
||||
private List<LawsWorkingGroupUser> queryDataByUserId(String userId) {
|
||||
LambdaQueryWrapper<LawsWorkingGroupUser> queryLawsWorkingGroupUser = new LambdaQueryWrapper<>();
|
||||
queryLawsWorkingGroupUser.in(LawsWorkingGroupUser::getUserId,Arrays.asList(userId.split(",")));
|
||||
queryLawsWorkingGroupUser.orderByDesc(LawsWorkingGroupUser::getCreateTime);
|
||||
return list(queryLawsWorkingGroupUser);
|
||||
}
|
||||
|
||||
private List<LawsWorkingGroupUser> queryDataByConditions(String userName, String userWorkNo, String userRoleName, String userPostName, String workingGroupId) {
|
||||
List<String> ids = lawsWorkingGroupUserSearch(userName, userWorkNo, userRoleName, userPostName);
|
||||
List<LawsWorkingGroupUser> list = new ArrayList<>();
|
||||
if (!ids.isEmpty()) {
|
||||
LambdaQueryWrapper<LawsWorkingGroupUser> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsWorkingGroupUser::getWorkingGroupId, workingGroupId);
|
||||
wrapper.eq(LawsWorkingGroupUser::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
wrapper.in(LawsWorkingGroupUser::getUserId, ids);
|
||||
wrapper.orderByDesc(LawsWorkingGroupUser::getCreateTime);
|
||||
list = list(wrapper);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<LawsWorkingGroupUser> queryDataByTree(String workingGroupId) {
|
||||
LambdaQueryWrapper<LawsWorkingGroupUser> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsWorkingGroupUser::getWorkingGroupId, workingGroupId);
|
||||
wrapper.eq(LawsWorkingGroupUser::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
wrapper.orderByDesc(LawsWorkingGroupUser::getCreateTime);
|
||||
return list(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@Override
|
||||
public List<LawsWorkingGroupUser> queryList(LawsWorkingGroupUser lawsWorkingGroupUser, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(lawsWorkingGroupUser, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsWorkingGroupUser lawsWorkingGroupUser) {
|
||||
Date now = new Date();
|
||||
lawsWorkingGroupUser.setCreateTime(now);
|
||||
lawsWorkingGroupUser.setUpdateTime(now);
|
||||
save(lawsWorkingGroupUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsWorkingGroupUser lawsWorkingGroupUser) {
|
||||
Date now = new Date();
|
||||
lawsWorkingGroupUser.setUpdateTime(now);
|
||||
saveOrUpdate(lawsWorkingGroupUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*/
|
||||
@Override
|
||||
public LawsWorkingGroupUser queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为人员赋值姓名、工号、角色、岗位
|
||||
*/
|
||||
@Override
|
||||
public void userAssignment(List<LawsWorkingGroupUser> list) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
// 获取用户ID列表
|
||||
List<String> userIds = list.stream().map(LawsWorkingGroupUser::getUserId).distinct().collect(Collectors.toList());
|
||||
// 批量查询用户信息
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIds);
|
||||
// 构建用户ID和用户信息的映射关系
|
||||
Map<String, SysUser> userMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getId, Function.identity()));
|
||||
// 遍历赋值
|
||||
for (LawsWorkingGroupUser user : list) {
|
||||
SysUser sysUser = userMap.get(user.getUserId());
|
||||
if (sysUser != null) {
|
||||
user.setRealname(sysUser.getRealname());
|
||||
user.setUsername(sysUser.getUsername());
|
||||
user.setUserPostName(sysUser.getPost());
|
||||
}
|
||||
LambdaQueryWrapper<SysUserRole> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(SysUserRole::getUserId, user.getUserId());
|
||||
List<SysUserRole> sysUserRoles = sysUserRoleService.list(wrapper);
|
||||
if (!CollectionUtils.isEmpty(sysUserRoles)){
|
||||
List<SysRole> roles = sysRoleService.listByIds(sysUserRoles.stream().map(SysUserRole::getRoleId).distinct().collect(Collectors.toList()));
|
||||
String roleNames = roles.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
|
||||
user.setUserRoleName(roleNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-251
@@ -1,251 +0,0 @@
|
||||
package com.jero.modules.tag.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.system.vo.IdMapBody;
|
||||
import com.jero.modules.system.vo.IdsMapBody;
|
||||
import com.jero.modules.tag.entity.LawsArea;
|
||||
import com.jero.modules.tag.service.ILawsAreaService;
|
||||
import com.jero.modules.tag.service.ILawsTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 区域管理表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="区域管理表")
|
||||
@RestController
|
||||
@RequestMapping("/tag/LawsArea")
|
||||
@Slf4j
|
||||
public class LawsAreaController extends JeroController<LawsArea, ILawsAreaService> {
|
||||
@Autowired
|
||||
private ILawsAreaService lawsAreaService;
|
||||
@Autowired
|
||||
private ISysDictItemService sysDictItemService;
|
||||
@Autowired
|
||||
private ILawsTagService lawsTagService;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
private static final String REDIS_KEY = "laws_area,show_area,id";
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-分页列表查询")
|
||||
@ApiOperation(value="区域管理表-分页列表查询", notes="区域管理表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(LawsArea lawsArea,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsArea> pageList= lawsAreaService.queryPageList(lawsArea, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-列表查询")
|
||||
@ApiOperation(value="区域管理表-列表查询", notes="区域管理表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsArea>> queryList(LawsArea lawsArea){
|
||||
List<LawsArea> list = lawsAreaService.queryList(lawsArea);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-查询展示区域")
|
||||
@ApiOperation(value="区域管理表-查询展示区域", notes="区域管理表-查询展示区域")
|
||||
@GetMapping(value = "/queryShowArea")
|
||||
public Result<List<LawsArea>> queryShowArea(HttpServletRequest req, LawsArea lawsArea){
|
||||
List<LawsArea> list = lawsAreaService.queryShowArea(req, lawsArea);
|
||||
return Result.OK(list);
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param lawsArea
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-添加")
|
||||
@ApiOperation(value="区域管理表-添加", notes="区域管理表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("area:add")
|
||||
public Result<?> add(@Validated @RequestBody LawsArea lawsArea) {
|
||||
int count= lawsAreaService.queryExitAreaName(lawsArea);
|
||||
if (count > 0) {
|
||||
return Result.error(ResultCommon.TAG_ERROR_1);
|
||||
}else {
|
||||
lawsAreaService.add(lawsArea);
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsArea
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-编辑")
|
||||
@ApiOperation(value="区域管理表-编辑", notes="区域管理表-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
@RequiresPermissions("area:edit")
|
||||
public Result<?> edit(@Validated @RequestBody LawsArea lawsArea) {
|
||||
|
||||
QueryWrapper<LawsArea> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("show_area", lawsArea.getShowArea()).eq("is_model", lawsArea.getIsModel());
|
||||
List<LawsArea> existAreaList = lawsAreaService.list(queryWrapper);
|
||||
//有同名数据
|
||||
if (!existAreaList.isEmpty()) {
|
||||
//已存在同名的数据,就是正在编辑的这个
|
||||
if (existAreaList.get(0).getId().equals(lawsArea.getId())) {
|
||||
lawsAreaService.editById(lawsArea);
|
||||
} else {
|
||||
return Result.error(ResultCommon.TAG_ERROR_1);
|
||||
}
|
||||
} else {
|
||||
lawsAreaService.editById(lawsArea);
|
||||
}
|
||||
//编辑后要清除redis缓存
|
||||
redisUtil.del(String.format(CacheConstant.SYS_DICT_TABLE_CACHE_SIMPLE_KEY,REDIS_KEY,lawsArea.getId()));
|
||||
return Result.OK(ResultCommon.EDIT_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-通过id删除")
|
||||
@ApiOperation(value="区域管理表-通过id删除", notes="区域管理表-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
@RequiresPermissions("area:delete")
|
||||
public Result<?> delete(@RequestBody IdMapBody map) {
|
||||
String id = map.getId();
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
LawsArea lawsArea = lawsAreaService.queryById(id);
|
||||
int count= lawsTagService.queryExitArea(lawsArea);
|
||||
if (count > 0) {
|
||||
return Result.error(ResultCommon.TAG_DELETE_ERROR_2);
|
||||
}else {
|
||||
lawsAreaService.deleteById(id);
|
||||
return Result.OK(ResultCommon.SUCCESSFULLY_DELETED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-批量删除")
|
||||
@ApiOperation(value="区域管理表-批量删除", notes="区域管理表-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
@RequiresPermissions("area:delete")
|
||||
public Result<?> deleteBatch(@RequestBody IdsMapBody map) {
|
||||
String ids = map.getIds();
|
||||
if(oConvertUtils.isEmpty(ids)) {
|
||||
return Result.error(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
List<LawsArea> lawsAreas = lawsAreaService.listByIds(idList);
|
||||
for (LawsArea lawsArea : lawsAreas) {
|
||||
int count= lawsTagService.queryExitArea(lawsArea);
|
||||
if (count > 0) {
|
||||
return Result.error(ResultCommon.TAG_DELETE_ERROR_2);
|
||||
}
|
||||
}
|
||||
this.lawsAreaService.deleteByIds(idList);
|
||||
return Result.OK(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-通过id查询")
|
||||
@ApiOperation(value="区域管理表-通过id查询", notes="区域管理表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
LawsArea lawsArea = lawsAreaService.queryById(id);
|
||||
if(lawsArea ==null) {
|
||||
return Result.error(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
return Result.OK(lawsArea);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param lawsArea
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, LawsArea lawsArea) {
|
||||
return super.exportXls(request, lawsArea, LawsArea.class, "区域管理表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, LawsArea.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示区域查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-展示区域查询")
|
||||
@ApiOperation(value="区域管理表-展示区域查询", notes="区域管理表-展示区域查询")
|
||||
@GetMapping(value = "/selectShowAreaById")
|
||||
public Result<?> selectShowAreaById(@RequestParam(name="id",required=true) String id) {
|
||||
LawsArea lawsArea = (LawsArea) lawsAreaService.selectShowAreaById(id);
|
||||
if(lawsArea ==null) {
|
||||
return Result.error(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
return Result.OK(lawsArea);
|
||||
}
|
||||
}
|
||||
-116
@@ -1,116 +0,0 @@
|
||||
package com.jero.modules.tag.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
*展示区域
|
||||
*@author liJiaRao
|
||||
*@date 2023-11-20 15:58
|
||||
*/
|
||||
@ApiModel(description = "展示区域")
|
||||
@Data
|
||||
@TableName("laws_area")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LawsArea implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "create_by")
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "update_by")
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@TableField(value = "update_time")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField(value = "sys_org_code")
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**
|
||||
* 展示区域(1基本信息,2文本信息,3关联关系)
|
||||
*/
|
||||
@TableField(value = "show_area")
|
||||
@ApiModelProperty(value = "展示区域(1基本信息,2文本信息,3关联关系)")
|
||||
private String showArea;
|
||||
|
||||
/**
|
||||
* 英文名称
|
||||
*/
|
||||
@TableField(value = "en_name")
|
||||
@ApiModelProperty(value = "英文名称")
|
||||
private String enName;
|
||||
|
||||
/**
|
||||
* 所属模块(1文档库,0文档拆分)
|
||||
*/
|
||||
@TableField(value = "is_model")
|
||||
@Dict(dicCode = "module")
|
||||
@ApiModelProperty(value = "所属模块(1文档库,0文档拆分)")
|
||||
private String isModel;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 所属模块名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Dict(dictTable = "sys_dict_item", dicText = "item_text", dicCode = "item_text")
|
||||
private String isModelName;
|
||||
/**
|
||||
* 所属模块英文名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Dict(dictTable = "sys_dict_item", dicText = "en_name", dicCode = "en_name")
|
||||
private String isModelEnName;
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.jero.modules.tag.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.tag.entity.LawsArea;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 区域管理表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsAreaMapper extends BaseMapper<LawsArea> {
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Select("select a.id,a.create_by,a.create_time,a.update_by,a.update_time,\n" +
|
||||
"a.is_model,i.item_text as is_model_name,i.en_name as is_model_en_name,a.show_area,a.sort,a.en_name\n" +
|
||||
"from onl_cgform_area as a left join sys_dict_item as i \n" +
|
||||
"on a.is_model=i.item_value \n" +
|
||||
"where i.dict_id=1493096744092102657 order by a.sort ")
|
||||
IPage<LawsArea> queryPageList(IPage page, @Param("params") Map<String,Object> params);
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
<?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.jero.modules.tag.mapper.LawsAreaMapper">
|
||||
<resultMap id="OnlCgformAreaResultMap" type="com.jero.modules.tag.entity.LawsArea">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="show_area" property="showArea" />
|
||||
<result column="en_name" property="enName" />
|
||||
<result column="is_model" property="isModel" />
|
||||
<result column="sort" property="sort" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
package com.jero.modules.tag.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.tag.entity.LawsArea;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 区域管理表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsAreaService extends IService<LawsArea> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsArea
|
||||
* @return
|
||||
*/
|
||||
void add(LawsArea lawsArea);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsArea
|
||||
* @return
|
||||
*/
|
||||
void editById(LawsArea lawsArea);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsArea queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<LawsArea> queryList(LawsArea lawsArea);
|
||||
|
||||
/**
|
||||
* 查询展示区域
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<LawsArea> queryShowArea(HttpServletRequest req, LawsArea lawsArea);
|
||||
|
||||
/**
|
||||
* 展示区域查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<LawsArea> selectShowAreaById(String id);
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IPage<LawsArea> queryPageList(LawsArea lawsArea, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 同一所属模块下,展示区域名称不能重复
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Integer queryExitAreaName(LawsArea lawsArea);
|
||||
}
|
||||
-9
@@ -2,7 +2,6 @@ package com.jero.modules.tag.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.tag.entity.LawsArea;
|
||||
import com.jero.modules.tag.entity.LawsTag;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -71,12 +70,4 @@ public interface ILawsTagService extends IService<LawsTag> {
|
||||
*/
|
||||
public void updateDictDelFlag(int isDelete,String id);
|
||||
|
||||
|
||||
/**
|
||||
* 若区域下有标签字段 则无法删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Integer queryExitArea(LawsArea lawsArea);
|
||||
|
||||
}
|
||||
|
||||
-21
@@ -16,7 +16,6 @@ import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServi
|
||||
import com.jero.modules.enums.FixedFieldEnum;
|
||||
import com.jero.modules.system.service.impl.SysDictServiceImpl;
|
||||
import com.jero.modules.system.util.HanYuPinYinUtil;
|
||||
import com.jero.modules.tag.entity.LawsArea;
|
||||
import com.jero.modules.tag.entity.LawsTag;
|
||||
import com.jero.modules.tag.enums.LawsFieldTypeEnum;
|
||||
import com.jero.modules.tag.enums.TableNameEnum;
|
||||
@@ -46,9 +45,6 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
|
||||
@Autowired
|
||||
private OnlCgformFieldServiceImpl onlCgformFieldService;
|
||||
|
||||
@Autowired
|
||||
private LawsAreaServiceImpl onlCgformAreaService;
|
||||
|
||||
@Autowired
|
||||
private SysDictServiceImpl sysDictService;
|
||||
|
||||
@@ -268,21 +264,4 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
|
||||
IPage<LawsTag> result = page(page, queryWrapper);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 若区域下有标签字段 则无法删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer queryExitArea(LawsArea lawsArea) {
|
||||
LambdaQueryWrapper<LawsTag> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(lawsArea.getShowArea())) {
|
||||
queryWrapper.select(LawsTag::getShowArea)
|
||||
.eq(LawsTag::getShowArea, lawsArea.getId())
|
||||
.eq(LawsTag::getDelFlag,0);
|
||||
}
|
||||
Integer count = lawsTagMapper.selectCount(queryWrapper);
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
-172
@@ -1,172 +0,0 @@
|
||||
package com.jero.modules.tag.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.tag.entity.LawsArea;
|
||||
import com.jero.modules.tag.mapper.LawsAreaMapper;
|
||||
import com.jero.modules.tag.service.ILawsAreaService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 区域管理表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class LawsAreaServiceImpl extends ServiceImpl<LawsAreaMapper, LawsArea> implements ILawsAreaService {
|
||||
@Autowired
|
||||
private OnlCgformFieldServiceImpl onlCgformFieldService;
|
||||
|
||||
@Autowired
|
||||
private LawsAreaServiceImpl onlCgformAreaService;
|
||||
|
||||
@Resource
|
||||
private LawsAreaMapper lawsAreaMapper;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsArea
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsArea lawsArea) {
|
||||
save(lawsArea);
|
||||
}
|
||||
/**
|
||||
* 同一所属模块下,展示区域名称不能重复
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer queryExitAreaName(LawsArea lawsArea) {
|
||||
LambdaQueryWrapper<LawsArea> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(lawsArea.getShowArea())) {
|
||||
queryWrapper.eq(LawsArea::getShowArea, lawsArea.getShowArea())
|
||||
.eq(LawsArea::getIsModel, lawsArea.getIsModel());
|
||||
}
|
||||
Integer count = lawsAreaMapper.selectCount(queryWrapper);
|
||||
return count;
|
||||
}
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsArea
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsArea lawsArea) {
|
||||
saveOrUpdate(lawsArea);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsArea queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsArea> queryList(LawsArea lawsArea) {
|
||||
LambdaQueryWrapper<LawsArea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(lawsArea.getIsModel())) {
|
||||
lambdaQueryWrapper.eq(LawsArea::getIsModel, lawsArea.getIsModel());
|
||||
}
|
||||
lambdaQueryWrapper.orderByAsc(LawsArea::getSort);
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询展示区域
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsArea> queryShowArea(HttpServletRequest req, LawsArea lawsArea) {
|
||||
QueryWrapper<LawsArea> queryWrapper = QueryGenerator.initQueryWrapper(lawsArea,req.getParameterMap());
|
||||
if (LanguageEnum.CN.equals(MessageUtils.getLanguage())) {
|
||||
queryWrapper.select("id", "show_area").orderByAsc("sort");
|
||||
return list(queryWrapper);
|
||||
} else {
|
||||
queryWrapper.select("id", "en_name").orderByAsc("sort");
|
||||
List<LawsArea> resetlist = list(queryWrapper);
|
||||
resetlist.stream().forEach(f -> f.setShowArea(f.getEnName()));
|
||||
return resetlist;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示区域查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsArea> selectShowAreaById(String id) {
|
||||
QueryWrapper<LawsArea> list = new QueryWrapper<LawsArea>().select(id, "showArea");
|
||||
return list(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<LawsArea> queryPageList(LawsArea lawsArea, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<LawsArea> queryWrapper = QueryGenerator.initQueryWrapper(lawsArea, req.getParameterMap());
|
||||
Page<LawsArea> page = new Page<>(pageNo, pageSize);
|
||||
Page<LawsArea> result = page(page, queryWrapper);
|
||||
List<LawsArea> records = result.getRecords();
|
||||
LanguageEnum language = MessageUtils.getLanguage();
|
||||
//中英切换-所属模块
|
||||
if(LanguageEnum.EN.equals(language)){
|
||||
for(LawsArea data:records){
|
||||
data.setIsModelName(data.getIsModelEnName());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user