From 230889c3ff8186f35d2d0f4f05e4ea5e4b237e7f Mon Sep 17 00:00:00 2001 From: super_liu <396572590@qq.com> Date: Mon, 31 May 2021 17:18:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0slrs=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E5=AD=90=E9=A1=B9=E7=9B=AE=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/adc/da/http/PageInfo.java | 168 +++++ .../java/com/adc/da/http/ResponseMessage.java | 58 ++ .../adc/da/http/ResponseMessageCodeEnum.java | 20 + .../src/main/java/com/adc/da/http/Result.java | 42 ++ .../main/java/com/adc/da/util/DateUtils.java | 48 ++ .../main/java/com/adc/da/util/Digests.java | 83 +++ .../main/java/com/adc/da/util/Encodes.java | 92 +++ .../main/java/com/adc/da/util/FileUtil.java | 253 ++++++++ .../main/java/com/adc/da/util/IOUtils.java | 14 + .../src/main/java/com/adc/da/util/IpUtil.java | 49 ++ .../java/com/adc/da/util/LoginUserUtil.java | 53 ++ .../main/java/com/adc/da/util/MD5Util.java | 71 +++ .../java/com/adc/da/util/PasswordUtils.java | 23 + .../java/com/adc/da/util/RequestUtils.java | 35 ++ .../com/adc/da/util/SpringContextHolder.java | 47 ++ .../main/java/com/adc/da/util/UUIDUtils.java | 78 +++ .../java/com/adc/da/util/ValidateDatas.java | 94 +++ .../java/com/adc/da/util/WaterMarkUtil.java | 72 +++ .../com/adc/da/main/generate/CodeGen.java | 31 +- adc-da-slrs/pom.xml | 23 + .../SarStandardsInfoController.java | 23 + .../dao/SarStandardsInfoDao.java | 16 + .../entity/SarStandardsInfo.java | 117 ++++ .../service/ISarStandardsInfoService.java | 16 + .../impl/SarStandardsInfoServiceImpl.java | 20 + .../SarStandardsInfoMapper.xml | 5 + .../service/impl/AttFileEOServiceImpl.java | 2 +- .../adc/da/person/dao/PersonCollectEODao.java | 13 +- .../adc/da/person/dao/PersonShareEODao.java | 2 + .../service/IPersonCollectEOService.java | 2 + .../person/service/IPersonConfEOService.java | 4 +- .../person/service/IPersonShareEOService.java | 2 + .../impl/PersonCollectEOServiceImpl.java | 5 + .../impl/PersonShareEOServiceImpl.java | 5 + .../adc/da/sys/common/SelectionResult.java | 29 + .../com/adc/da/sys/constant/CollectEnum.java | 29 + .../adc/da/sys/constant/FactoryTypeEnum.java | 28 + .../com/adc/da/sys/constant/GenderEnum.java | 22 + .../com/adc/da/sys/constant/OrgTypeEnum.java | 24 + .../adc/da/sys/constant/PersonModelEnum.java | 2 +- .../adc/da/sys/constant/ResourceTypeEnum.java | 30 + .../com/adc/da/sys/constant/RoleEnum.java | 21 + .../da/sys/constant/UserDisableFlagEnum.java | 27 + .../adc/da/sys/constant/ValidFlagEnum.java | 22 + .../adc/da/sys/constant/ValueStateEnum.java | 28 + .../com/adc/da/sys/constant/WarnTimeEnum.java | 32 + .../sys/controller/DicEORestController.java | 133 ++++ .../controller/DicTypeEORestController.java | 377 ++++++++++++ .../da/sys/controller/RoleEOController.java | 2 +- .../da/sys/controller/UserEOController.java | 2 +- .../sys/controller/UserInfoEOController.java | 2 +- .../java/com/adc/da/sys/dao/DicEODao.java | 48 ++ .../java/com/adc/da/sys/dao/DicTypeEODao.java | 78 +++ .../com/adc/da/sys/dao/FeedbackInfoEODao.java | 25 + .../com/adc/da/sys/dao/LinkInfoEODao.java | 27 + .../com/adc/da/sys/dao/LoginInfoEODao.java | 29 + .../java/com/adc/da/sys/dao/MenuEODao.java | 75 +++ .../java/com/adc/da/sys/dao/OrgEODao.java | 162 +++++ .../java/com/adc/da/sys/dao/RoleEODao.java | 86 +++ .../com/adc/da/sys/dao/RoleSarMenuEODao.java | 32 + .../com/adc/da/sys/dao/UserConfigEODao.java | 27 + .../java/com/adc/da/sys/dao/UserEODao.java | 163 +++++ .../com/adc/da/sys/dao/UserInfoEODao.java | 35 ++ .../com/adc/da/sys/dao/UserRoleEODao.java | 16 + .../com/adc/da/sys/dao/WarnTimeEODao.java | 23 + .../java/com/adc/da/sys/entity/DicTypeEO.java | 236 +++++++ .../com/adc/da/sys/entity/DictionaryEO.java | 186 ++++++ .../com/adc/da/sys/page/DicTypeEOPage.java | 149 +++++ .../com/adc/da/sys/page/DictionaryEOPage.java | 185 ++++++ .../java/com/adc/da/sys/page/MenuEOPage.java | 266 ++++++++ .../java/com/adc/da/sys/page/OrgEOPage.java | 312 ++++++++++ .../com/adc/da/sys/page/OrgMenuEOPage.java | 87 +++ .../com/adc/da/sys/service/IDicEOService.java | 52 ++ .../adc/da/sys/service/IDicTypeEOService.java | 89 +++ .../adc/da/sys/service/IRoleEOService.java | 2 +- .../da/sys/service/IRoleSarMenuEOService.java | 2 +- .../da/sys/service/IUserConfigEOService.java | 2 +- .../da/sys/service/impl/DicEOServiceImpl.java | 233 +++++++ .../service/impl/DicTypeEOServiceImpl.java | 414 +++++++++++++ .../sys/service/impl/MenuEOServiceImpl.java | 2 +- .../da/sys/service/impl/OrgEOServiceImpl.java | 2 +- .../sys/service/impl/RoleEOServiceImpl.java | 7 +- .../sys/service/impl/UserEOServiceImpl.java | 2 +- .../java/com/adc/da/sys/vo/DicTypeVO.java | 122 ++++ .../main/java/com/adc/da/sys/vo/OrgVO.java | 111 ++++ .../main/java/com/adc/da/sys/vo/RoleVO.java | 209 +++++++ .../da/websocket/service/WebSocketServer.java | 4 +- .../mapper/person/PersonCollectEOMapper.xml | 6 + .../mapper/person/PersonShareEOMapper.xml | 6 + .../mybatis/mapper/sys/DicTypeEOMapper.xml | 582 ++++++++++++++++++ .../mybatis/mapper/sys/DictionaryEOMapper.xml | 305 +++++++++ pom.xml | 1 + 92 files changed, 6765 insertions(+), 31 deletions(-) create mode 100644 adc-da-base/src/main/java/com/adc/da/http/PageInfo.java create mode 100644 adc-da-base/src/main/java/com/adc/da/http/ResponseMessage.java create mode 100644 adc-da-base/src/main/java/com/adc/da/http/ResponseMessageCodeEnum.java create mode 100644 adc-da-base/src/main/java/com/adc/da/http/Result.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/DateUtils.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/Digests.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/Encodes.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/FileUtil.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/IOUtils.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/IpUtil.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/LoginUserUtil.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/MD5Util.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/PasswordUtils.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/RequestUtils.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/SpringContextHolder.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/UUIDUtils.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/ValidateDatas.java create mode 100644 adc-da-base/src/main/java/com/adc/da/util/WaterMarkUtil.java create mode 100644 adc-da-slrs/pom.xml create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/dao/SarStandardsInfoDao.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/entity/SarStandardsInfo.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/ISarStandardsInfoService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java create mode 100644 adc-da-slrs/src/main/resources/mybatis/mapper/sarStandardsInfo/SarStandardsInfoMapper.xml create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/common/SelectionResult.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/CollectEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/FactoryTypeEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/GenderEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/OrgTypeEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/ResourceTypeEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/RoleEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/UserDisableFlagEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/ValidFlagEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/ValueStateEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/constant/WarnTimeEnum.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/controller/DicEORestController.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/controller/DicTypeEORestController.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/DicEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/DicTypeEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/FeedbackInfoEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/LinkInfoEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/LoginInfoEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/MenuEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/OrgEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/RoleEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/RoleSarMenuEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/UserConfigEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/UserEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/UserInfoEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/UserRoleEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/dao/WarnTimeEODao.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/entity/DicTypeEO.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/entity/DictionaryEO.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/page/DicTypeEOPage.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/page/DictionaryEOPage.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/page/MenuEOPage.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/page/OrgEOPage.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/page/OrgMenuEOPage.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/service/IDicEOService.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/service/IDicTypeEOService.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/service/impl/DicEOServiceImpl.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/service/impl/DicTypeEOServiceImpl.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/vo/DicTypeVO.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/vo/OrgVO.java create mode 100644 adc-da-sys/src/main/java/com/adc/da/sys/vo/RoleVO.java create mode 100644 adc-da-sys/src/main/resources/mybatis/mapper/sys/DicTypeEOMapper.xml create mode 100644 adc-da-sys/src/main/resources/mybatis/mapper/sys/DictionaryEOMapper.xml diff --git a/adc-da-base/src/main/java/com/adc/da/http/PageInfo.java b/adc-da-base/src/main/java/com/adc/da/http/PageInfo.java new file mode 100644 index 00000000..828e9e0d --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/http/PageInfo.java @@ -0,0 +1,168 @@ +package com.adc.da.http; + +import org.apache.commons.lang3.StringUtils; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PageInfo { + private Integer pageNo; + private Integer pageSize; + private Long count; + private Long pageCount; + private List list; + private List> title; + private Map ext; + private String orderBy; + + public PageInfo() { + this.pageNo = 1; + this.pageSize = 10; + this.list = new ArrayList(); + this.title = new ArrayList(); + this.ext = new HashMap(); + this.orderBy = ""; + this.pageSize = 1; + } + + public PageInfo(HttpServletRequest request) { + this.pageNo = 1; + this.pageSize = 10; + this.list = new ArrayList(); + this.title = new ArrayList(); + this.ext = new HashMap(); + this.orderBy = ""; + String no = request.getParameter("pageNo"); + if (StringUtils.isEmpty(no)) { + this.setPageNo(1); + } else if (StringUtils.isNumeric(no)) { + this.setPageNo(Integer.parseInt(no)); + } + + String size = request.getParameter("pageSize"); + if (StringUtils.isEmpty(size)) { + this.setPageSize(10); + } + + if (StringUtils.isNumeric(size)) { + this.setPageSize(Integer.parseInt(size)); + } + + String orderByParam = request.getParameter("orderBy"); + if (StringUtils.isNotBlank(orderByParam)) { + this.setOrderBy(orderByParam); + } + + } + + public PageInfo(Integer pageNo, Integer pageSize) { + this(pageNo, pageSize, 0L); + } + + public PageInfo(Integer pageNo, Integer pageSize, Long count) { + this(pageNo, pageSize, count, new ArrayList()); + } + + public PageInfo(Integer pageNo, Integer pageSize, Long count, List list) { + this.pageNo = 1; + this.pageSize = 10; + this.list = new ArrayList(); + this.title = new ArrayList(); + this.ext = new HashMap(); + this.orderBy = ""; + if (pageNo == null) { + pageNo = 1; + } + + if (pageSize == null) { + pageSize = 10; + } + + this.setCount(count); + this.setPageNo(Math.abs(pageNo)); + this.setPageSize(Math.abs(pageSize)); + this.setList(list); + } + + public Long getCount() { + return this.count; + } + + public void setCount(Long count) { + this.count = count; + if ((long) this.pageSize >= count) { + this.pageNo = 1; + } + + } + + public Integer getPageNo() { + return this.pageNo; + } + + public void setPageNo(Integer pageNo) { + this.pageNo = pageNo; + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize <= 0 ? 10 : pageSize; + } + + public List getList() { + return this.list; + } + + public PageInfo setList(List list) { + this.list = list; + return this; + } + + public String getOrderBy() { + return this.orderBy; + } + + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + public Map getExt() { + return this.ext; + } + + public void setExt(Map ext) { + this.ext = ext; + } + + public Long getPageCount() { + if (this.count % (long) this.pageSize != 0L) { + this.pageCount = this.count / (long) this.pageSize + 1L; + } else { + this.pageCount = this.count / (long) this.pageSize; + } + + if (this.pageCount < 1L) { + this.pageCount = 1L; + } + + return this.pageCount; + } + + public void setPageCount(Long pageCount) { + this.pageCount = pageCount; + } + + public List> getTitle() { + return this.title; + } + + public void setTitle(List> title) { + this.title = title; + } +} \ No newline at end of file diff --git a/adc-da-base/src/main/java/com/adc/da/http/ResponseMessage.java b/adc-da-base/src/main/java/com/adc/da/http/ResponseMessage.java new file mode 100644 index 00000000..19300a12 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/http/ResponseMessage.java @@ -0,0 +1,58 @@ +package com.adc.da.http; + +public class ResponseMessage { + private String respCode; + private String respMsg; + private T data; + private boolean ok; + + public ResponseMessage() { + } + + public ResponseMessage(String respCode, String message) { + this.respCode = respCode; + this.respMsg = message; + } + + public ResponseMessage(String respCode, String message, boolean ok) { + this.respCode = respCode; + this.respMsg = message; + this.ok = ok; + } + + public ResponseMessage(String respCode, String message, boolean ok, T data) { + this.respCode = respCode; + this.respMsg = message; + this.ok = ok; + this.data = data; + } + + public String getRespCode() { + return this.respCode; + } + + public void setRespCode(String respCode) { + this.respCode = respCode; + } + + public String getMessage() { + return this.respMsg; + } + + public void setMessage(String message) { + this.respMsg = message; + } + + public T getData() { + return this.data; + } + + public void setData(T data) { + this.data = data; + } + + public boolean isOk() { + return this.ok; + } +} + diff --git a/adc-da-base/src/main/java/com/adc/da/http/ResponseMessageCodeEnum.java b/adc-da-base/src/main/java/com/adc/da/http/ResponseMessageCodeEnum.java new file mode 100644 index 00000000..e4a0eff3 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/http/ResponseMessageCodeEnum.java @@ -0,0 +1,20 @@ +package com.adc.da.http; + +public enum ResponseMessageCodeEnum { + SUCCESS("0"), + ERROR("-1"), + VALID_ERROR("1000"), + SAVE_SUCCESS("r0001"), + UPDATE_SUCCESS("r0002"), + REMOVE_SUCCESS("r0003"); + + private String code; + + private ResponseMessageCodeEnum(String code) { + this.code = code; + } + + public String getCode() { + return this.code; + } +} diff --git a/adc-da-base/src/main/java/com/adc/da/http/Result.java b/adc-da-base/src/main/java/com/adc/da/http/Result.java new file mode 100644 index 00000000..77ffe02d --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/http/Result.java @@ -0,0 +1,42 @@ +package com.adc.da.http; + +public class Result { + public Result() { + } + + public static ResponseMessage success() { + return new ResponseMessage(ResponseMessageCodeEnum.SUCCESS.getCode(), "", true); + } + + public static ResponseMessage success(String code, T t) { + return new ResponseMessage(code, "", true, t); + } + + public static ResponseMessage success(String code, String message) { + return new ResponseMessage(code, message); + } + + public static ResponseMessage success(String code, String message, T t) { + return new ResponseMessage(code, message, true, t); + } + + public static ResponseMessage success(T t) { + return new ResponseMessage(ResponseMessageCodeEnum.SUCCESS.getCode(), "", true, t); + } + + public static ResponseMessage error() { + return error(""); + } + + public static ResponseMessage error(String message) { + return error(ResponseMessageCodeEnum.ERROR.getCode(), message); + } + + public static ResponseMessage error(String code, String message) { + return error(code, message, (Object)null); + } + + public static ResponseMessage error(String code, String message, T t) { + return new ResponseMessage(code, message, false, t); + } +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/DateUtils.java b/adc-da-base/src/main/java/com/adc/da/util/DateUtils.java new file mode 100644 index 00000000..46d6dc7d --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/DateUtils.java @@ -0,0 +1,48 @@ +package com.adc.da.util; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class DateUtils extends org.apache.commons.lang3.time.DateUtils { + public static final String yyyy_MM_dd_EN = "yyyy-MM-dd"; + public static final String yyyy_MM_dd_HH_mm_ss_EN = "yyyy-MM-dd HH:mm:ss"; + public static final String yyyy_MM_dd_CN = "yyyy年MM月dd日"; + public static final String yyyy_MM_dd_HH_mm_ss_CN = "yyyy年MM月dd日HH时mm分ss秒"; + private static Map dateFormatMap = new HashMap(); + + public DateUtils() { + } + + public static DateFormat getDateFormat(String formatStr) { + DateFormat df = (DateFormat)dateFormatMap.get(formatStr); + if (df == null) { + df = new SimpleDateFormat(formatStr); + dateFormatMap.put(formatStr, df); + } + + return (DateFormat)df; + } + + public static String dateToString(Date date, String dateFormatStr) { + DateFormat format = getDateFormat(dateFormatStr); + return date != null ? format.format(date) : null; + } + + public static Date stringToDate(String dateTimeStr, String dateFormatStr) { + try { + if (dateTimeStr != null && !dateTimeStr.equals("")) { + DateFormat format = getDateFormat(dateFormatStr); + Date date = format.parse(dateTimeStr); + return date; + } else { + return null; + } + } catch (ParseException var4) { + throw new RuntimeException(var4); + } + } +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/Digests.java b/adc-da-base/src/main/java/com/adc/da/util/Digests.java new file mode 100644 index 00000000..c8404e2d --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/Digests.java @@ -0,0 +1,83 @@ +package com.adc.da.util; + +import org.apache.commons.lang3.Validate; +import java.io.IOException; +import java.io.InputStream; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; + +public class Digests { + private static final String SHA1 = "SHA-1"; + private static final String MD5 = "MD5"; + private static SecureRandom random = new SecureRandom(); + + public Digests() { + } + + public static byte[] sha1(byte[] input) { + return digest(input, "SHA-1", (byte[])null, 1); + } + + public static byte[] sha1(byte[] input, byte[] salt) { + return digest(input, "SHA-1", salt, 1); + } + + public static byte[] sha1(byte[] input, byte[] salt, int iterations) { + return digest(input, "SHA-1", salt, iterations); + } + + private static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations){ + + try { + MessageDigest digest = MessageDigest.getInstance(algorithm); + if (salt != null) { + digest.update(salt); + } + + byte[] result = digest.digest(input); + + for(int i = 1; i < iterations; ++i) { + digest.reset(); + result = digest.digest(result); + } + return result; + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException(e); + } + } + + public static byte[] generateSalt(int numBytes) { + Validate.isTrue(numBytes > 0, "numBytes argument must be a positive integer (1 or larger)", (long)numBytes); + byte[] bytes = new byte[numBytes]; + random.nextBytes(bytes); + return bytes; + } + + public static byte[] md5(InputStream input) throws IOException { + return digest(input, "MD5"); + } + + public static byte[] sha1(InputStream input) throws IOException { + return digest(input, "SHA-1"); + } + + private static byte[] digest(InputStream input, String algorithm) throws IOException { + try { + MessageDigest messageDigest = MessageDigest.getInstance(algorithm); + int bufferLength = 8192; + byte[] buffer = new byte[bufferLength]; + + for(int read = input.read(buffer, 0, bufferLength); read > -1; read = input.read(buffer, 0, bufferLength)) { + messageDigest.update(buffer, 0, read); + } + + return messageDigest.digest(); + + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException(e); + } + } + + +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/Encodes.java b/adc-da-base/src/main/java/com/adc/da/util/Encodes.java new file mode 100644 index 00000000..ecd99a05 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/Encodes.java @@ -0,0 +1,92 @@ +package com.adc.da.util; + +import com.adc.da.exception.AdcDaBaseException; +import org.apache.commons.codec.DecoderException; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.codec.binary.Hex; +import org.apache.commons.lang3.StringEscapeUtils; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.net.URLEncoder; + +public class Encodes { + + private static final String DEFAULT_URL_ENCODING = "UTF-8"; + private static final char[] BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".toCharArray(); + + public Encodes() { + } + + public static String encodeHex(byte[] input) { + return Hex.encodeHexString(input); + } + + public static byte[] decodeHex(String input) { + + try { + return Hex.decodeHex(input.toCharArray()); + } catch (DecoderException e) { + throw new AdcDaBaseException(e.getMessage()); + } + + } + + public static String encodeBase64(byte[] input) { + return Base64.encodeBase64String(input); + } + + public static String encodeUrlSafeBase64(byte[] input) { + return Base64.encodeBase64URLSafeString(input); + } + + public static byte[] decodeBase64(String input) { + return Base64.decodeBase64(input); + } + + public static String encodeBase62(byte[] input) { + char[] chars = new char[input.length]; + + for(int i = 0; i < input.length; ++i) { + chars[i] = BASE62[(input[i] & 255) % BASE62.length]; + } + + return new String(chars); + } + + public static String escapeHtml(String html) { + return StringEscapeUtils.escapeHtml4(html); + } + + public static String unescapeHtml(String htmlEscaped) { + return StringEscapeUtils.unescapeHtml4(htmlEscaped); + } + + public static String escapeXml(String xml) { + return StringEscapeUtils.escapeXml(xml); + } + + public static String unescapeXml(String xmlEscaped) { + return StringEscapeUtils.unescapeXml(xmlEscaped); + } + + public static String urlEncode(String part) { + try { + return URLEncoder.encode(part, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + + } + + public static String urlDecode(String part) { + try { + return URLDecoder.decode(part, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + + } + + +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/FileUtil.java b/adc-da-base/src/main/java/com/adc/da/util/FileUtil.java new file mode 100644 index 00000000..fb033767 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/FileUtil.java @@ -0,0 +1,253 @@ +package com.adc.da.util; + +import org.apache.commons.io.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; +import java.util.ArrayList; +import java.util.List; + +public class FileUtil extends FileUtils { + + private static final int BUFF_SIZE = 1024; + private static Logger log = LoggerFactory.getLogger(FileUtil.class); + + public FileUtil() { + } + + public static void copyFile(String src, String target) { + InputStream in = null; + BufferedOutputStream out = null; + + try { + in = new BufferedInputStream(new FileInputStream(src)); + out = new BufferedOutputStream(new FileOutputStream(target)); + byte[] buffer = new byte[1024]; + + int len; + while((len = in.read(buffer, 0, 1024)) > 0) { + out.write(buffer, 0, len); + out.flush(); + } + } catch (IOException var9) { + var9.printStackTrace(); + } finally { + IOUtils.closeQuietly(in); + IOUtils.closeQuietly(out); + } + + } + + public static List readAsStringList(String fileName) { + List list = new ArrayList(); + BufferedReader reader = null; + FileInputStream fis = null; + + try { + File f = new File(fileName); + if (f.isFile() && f.exists()) { + fis = new FileInputStream(f); + reader = new BufferedReader(new InputStreamReader(fis, "UTF-8")); + + String line; + while((line = reader.readLine()) != null) { + if (!"".equals(line)) { + list.add(line); + } + } + } + } catch (Exception var18) { + log.error("readFile", var18); + } finally { + try { + if (reader != null) { + reader.close(); + } + } catch (IOException var17) { + log.error("InputStream关闭异常", var17); + } + + try { + if (fis != null) { + fis.close(); + } + } catch (IOException var16) { + log.error("FileInputStream关闭异常", var16); + } + + } + + return list; + } + + public static byte[] readFile(File file) { + byte[] bytes = null; + + try { + bytes = IOUtils.readFully(new FileInputStream(file)); + } catch (Exception var3) { + var3.printStackTrace(); + } + + return bytes; + } + + public static byte[] readFile(String fileName) { + return readFile(new File(fileName)); + } + + public static void writeFile(byte[] bytes, String outputFile) { + FileOutputStream os = null; + + try { + os = new FileOutputStream(outputFile); + os.write(bytes); + } catch (Exception var7) { + var7.printStackTrace(); + } finally { + IOUtils.closeQuietly(os); + } + + } + + public static File mkdir(String folderPath) { + File file = new File(folderPath); + if (!file.exists() || !file.isDirectory()) { + boolean success = false; + + do { + success = file.mkdirs(); + } while(success); + } + + return file; + } + + public static void delFolder(String folderPath) throws Exception { + delAllFile(folderPath); + File myFilePath = new File(folderPath); + myFilePath.delete(); + } + + public static boolean delAllFile(String path) throws Exception { + boolean flag = false; + File file = new File(path); + if (!file.exists()) { + return flag; + } else if (!file.isDirectory()) { + return flag; + } else { + String[] tempList = file.list(); + File temp = null; + + for(int i = 0; i < tempList.length; ++i) { + if (path.endsWith(File.separator)) { + temp = new File(path + tempList[i]); + } else { + temp = new File(path + File.separator + tempList[i]); + } + + if (temp.isFile()) { + temp.delete(); + } + + if (temp.isDirectory()) { + delAllFile(path + "/" + tempList[i]); + delFolder(path + "/" + tempList[i]); + flag = true; + } + } + + return flag; + } + } + + public static boolean delFile(String fileName) { + File file = new File(fileName); + if (!file.exists()) { + log.info(fileName + " 文件不存在!"); + return true; + } else { + return file.isFile() ? deleteFile(fileName) : deleteDirectory(fileName); + } + } + + public static boolean deleteFile(String fileName) { + File file = new File(fileName); + if (file.exists() && file.isFile()) { + if (file.delete()) { + log.info("删除单个文件 " + fileName + " 成功!"); + return true; + } else { + log.info("删除单个文件 " + fileName + " 失败!"); + return false; + } + } else { + log.info(fileName + " 文件不存在!"); + return true; + } + } + + public static boolean deleteDirectory(String dirName) { + String dirNames = dirName; + if (!dirName.endsWith(File.separator)) { + dirNames = dirName + File.separator; + } + + File dirFile = new File(dirNames); + if (dirFile.exists() && dirFile.isDirectory()) { + boolean flag = true; + File[] files = dirFile.listFiles(); + + for(int i = 0; i < files.length; ++i) { + if (files[i].isFile()) { + flag = deleteFile(files[i].getAbsolutePath()); + if (!flag) { + break; + } + } else if (files[i].isDirectory()) { + flag = deleteDirectory(files[i].getAbsolutePath()); + if (!flag) { + break; + } + } + } + + if (!flag) { + log.info("删除目录失败!"); + return false; + } else if (dirFile.delete()) { + log.info("删除目录 " + dirName + " 成功!"); + return true; + } else { + log.info("删除目录 " + dirName + " 失败!"); + return false; + } + } else { + log.info(dirNames + " 目录不存在!"); + return true; + } + } + + public static boolean exists(String path) { + return (new File(path)).exists(); + } + + public static void checkAndMkdirs(File file) { + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + + } + + public static String getFileExtension(String fileName) { + return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); + } + + public static String getFileName(String fileName) { + return fileName.substring(0, fileName.lastIndexOf(".")); + } + + +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/IOUtils.java b/adc-da-base/src/main/java/com/adc/da/util/IOUtils.java new file mode 100644 index 00000000..b956a7e6 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/IOUtils.java @@ -0,0 +1,14 @@ +package com.adc.da.util; + +import java.io.IOException; +import java.io.InputStream; + +public class IOUtils extends org.apache.commons.io.IOUtils { + + + public static byte[] readFully(InputStream is) throws IOException { + byte[] bytes = new byte[is.available()]; + readFully(is, bytes); + return bytes; + } +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/IpUtil.java b/adc-da-base/src/main/java/com/adc/da/util/IpUtil.java new file mode 100644 index 00000000..af84d272 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/IpUtil.java @@ -0,0 +1,49 @@ +package com.adc.da.util; + +import org.apache.commons.lang3.StringUtils; + +import javax.servlet.http.HttpServletRequest; + +public class IpUtil { + private IpUtil() { + throw new IllegalStateException("Utility class"); + } + + private static boolean checkIp(String ip) { + return ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip); + } + + public static String getIpAddr(HttpServletRequest request) { + String ip = request.getHeader("X-Forwarded-For"); + if (checkIp(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + if (checkIp(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + + if (checkIp(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + + if (checkIp(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + + if (checkIp(ip)) { + ip = request.getRemoteAddr(); + } + } else if (ip.length() > 15) { + String[] ips = ip.split(","); + + for(int index = 0; index < ips.length; ++index) { + String strIp = ips[index]; + if (!"unknown".equalsIgnoreCase(strIp)) { + ip = strIp; + break; + } + } + } + + return StringUtils.trim(ip); + } +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/LoginUserUtil.java b/adc-da-base/src/main/java/com/adc/da/util/LoginUserUtil.java new file mode 100644 index 00000000..0ad74f0e --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/LoginUserUtil.java @@ -0,0 +1,53 @@ +package com.adc.da.util; + +import com.alibaba.fastjson.JSONObject; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.UnavailableSecurityManagerException; +import org.apache.shiro.session.InvalidSessionException; +import org.apache.shiro.subject.Subject; + +import java.util.Map; + +public class LoginUserUtil { + /** + * 获取当前登录用户ID + * + */ + public static String getUserId() { + String userId = null; + try { + Subject subject = SecurityUtils.getSubject(); + Object object=subject.getPrincipal(); + if(object!=null){ + String json = JSONObject.toJSONString(object); + if(json!=null && json.length()>0){ + Map userInfo=JSONObject.parseObject(json, Map.class); + userId=userInfo.get("id").toString(); + } + } + } catch (UnavailableSecurityManagerException e) { + } catch (InvalidSessionException e) { + } + return userId; + } + + public static String getUserParamValue() { + String paramValue = null; + try { + Subject subject = SecurityUtils.getSubject(); + Object object=subject.getPrincipal(); + if(object!=null){ + String json = JSONObject.toJSONString(object); + if(json!=null && json.length()>0){ + Map userInfo=JSONObject.parseObject(json, Map.class); + paramValue=userInfo.get("paramValue").toString(); + } + } + } catch (UnavailableSecurityManagerException e) { + } catch (InvalidSessionException e) { + } + return paramValue; + } + + +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/MD5Util.java b/adc-da-base/src/main/java/com/adc/da/util/MD5Util.java new file mode 100644 index 00000000..979f1ffe --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/MD5Util.java @@ -0,0 +1,71 @@ +package com.adc.da.util; + + +import java.security.MessageDigest; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * 采用MD5加密解密 + * @author tfq + * @datetime 2011-10-13 + */ +public class MD5Util { + + /*** + * MD5加码 生成32位md5码 + */ + public static String string2MD5(String inStr){ + MessageDigest md5 = null; + try{ + md5 = MessageDigest.getInstance("MD5"); + }catch (Exception e){ + System.out.println(e.toString()); + e.printStackTrace(); + return ""; + } + char[] charArray = inStr.toCharArray(); + byte[] byteArray = new byte[charArray.length]; + + for (int i = 0; i < charArray.length; i++) + byteArray[i] = (byte) charArray[i]; + byte[] md5Bytes = md5.digest(byteArray); + StringBuffer hexValue = new StringBuffer(); + for (int i = 0; i < md5Bytes.length; i++){ + int val = ((int) md5Bytes[i]) & 0xff; + if (val < 16) + hexValue.append("0"); + hexValue.append(Integer.toHexString(val)); + } + return hexValue.toString(); + + } + + /** + * 加密解密算法 执行一次加密,两次解密 + */ + public static String convertMD5(String inStr){ + + char[] a = inStr.toCharArray(); + for (int i = 0; i < a.length; i++){ + a[i] = (char) (a[i] ^ 't'); + } + String s = new String(a); + return s; + + } + + // 测试主函数 + public static void main(String args[]) { + /* String s = new String("tangfuqiang"); + System.out.println("原始:" + s); + System.out.println("MD5后:" + string2MD5(s)); + + System.out.println("加密的:" + convertMD5(s)); + + System.out.println("解密的:" + convertMD5(convertMD5(s)));*/ + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH"); + String time = df.format(new Date()); + System.out.println(time); + } +} \ No newline at end of file diff --git a/adc-da-base/src/main/java/com/adc/da/util/PasswordUtils.java b/adc-da-base/src/main/java/com/adc/da/util/PasswordUtils.java new file mode 100644 index 00000000..2fe7a487 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/PasswordUtils.java @@ -0,0 +1,23 @@ +package com.adc.da.util; + +import cn.hutool.crypto.digest.DigestAlgorithm; +import cn.hutool.crypto.digest.Digester; + +public class PasswordUtils { + + public PasswordUtils() { + } + + public static String encryptPassword(String plainPassword) { + byte[] salt = Digests.generateSalt(8); + byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, 1024); + return Encodes.encodeHex(salt) + Encodes.encodeHex(hashPassword); + } + + public static boolean validatePassword(String plainPassword, String password) { + byte[] salt = Encodes.decodeHex(password.substring(0, 16)); + byte[] hashPassword = Digests.sha1(plainPassword.getBytes(), salt, 1024); + return password.equals(Encodes.encodeHex(salt) + Encodes.encodeHex(hashPassword)); + } + +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/RequestUtils.java b/adc-da-base/src/main/java/com/adc/da/util/RequestUtils.java new file mode 100644 index 00000000..884b779f --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/RequestUtils.java @@ -0,0 +1,35 @@ +package com.adc.da.util; + +import org.apache.commons.lang3.StringUtils; + +import javax.servlet.http.HttpServletRequest; + +public class RequestUtils { + public static final String LOGIN_USER = "LOGIN_USER"; + public static final String LOGIN_USER_ID = "LOGIN_USER_ID"; + public static final String LOGIN_ROLE_ID = "LOGIN_ROLE_ID"; + + private RequestUtils() { + throw new IllegalStateException("RequestUtils"); + } + + public static String getClientIp(HttpServletRequest request) { + String remoteAddr = ""; + if (request != null) { + remoteAddr = request.getHeader("X-FORWARDED-FOR"); + if (StringUtils.isEmpty(remoteAddr)) { + remoteAddr = request.getRemoteAddr(); + } + } + + return remoteAddr; + } + + public static String getLoginUserId(HttpServletRequest request) { + return (String)request.getSession().getAttribute("LOGIN_USER_ID"); + } + + public static String getLoginRoleId(HttpServletRequest request) { + return (String)request.getSession().getAttribute("LOGIN_ROLE_ID"); + } +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/SpringContextHolder.java b/adc-da-base/src/main/java/com/adc/da/util/SpringContextHolder.java new file mode 100644 index 00000000..99581cb6 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/SpringContextHolder.java @@ -0,0 +1,47 @@ +package com.adc.da.util; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +@Component +public class SpringContextHolder implements ApplicationContextAware { + + + private static ApplicationContext applicationContext; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } + + /** + * 获取applicationContext + * @return + */ + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + /** + * 通过name获取 Bean. + * @param name 参数传入要获取的实例的类名 首字母小写,这是默认的 + * @return + */ + public static Object getBean(String name){ + return getApplicationContext().getBean(name); + } + + /** + * 通过class获取Bean. + * @param clazz + * @param + * @return + */ + public static T getBean(Class clazz){ + return getApplicationContext().getBean(clazz); + } + + +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/UUIDUtils.java b/adc-da-base/src/main/java/com/adc/da/util/UUIDUtils.java new file mode 100644 index 00000000..48ee3cbe --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/UUIDUtils.java @@ -0,0 +1,78 @@ +package com.adc.da.util; + + + +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; +import org.springframework.beans.factory.annotation.Value; + +public class UUIDUtils { + + public static Snowflake snowflake; + + public static Snowflake getSnowflake() { + return snowflake; + } + + /** + * 服务编码 + */ + private static long serverCode; + + /** + * 中心端编码 + * + */ + private static long appCenter; + + @Value("${application.code}") + public static void setServerCode(long serverCode) { + UUIDUtils.serverCode = serverCode; + } + + @Value("${application.center}") + public static void setAppCenter(long appCenter) { + UUIDUtils.appCenter = appCenter; + } + + + public static void setSnowflake(Snowflake snowflake) { + IdUtil.getSnowflake(serverCode,appCenter); + } + + public static String randomUUID10() { + return RandomUtil.randomString(10); + } + + public static String randomUUID20() { + return RandomUtil.randomString(20); + } + + public static String randomUUID(int length) { + return RandomUtil.randomString(length); + } + + public static String randomSnowflakeID(){ + return snowflake.nextIdStr(); + } + + + public static String getUUIDPath(String uuid){ + StringBuilder builder=new StringBuilder(); + builder.append("/"); + builder.append((uuid.substring(0, 3).hashCode())%100+"").append("/"); + builder.append((uuid.substring(7,10).hashCode())%100+"").append("/"); + builder.append((uuid.substring(11,14).hashCode())%100+"").append("/"); + return builder.toString(); + } + + public static String getAttTable(){ + int nextInt = RandomUtil.randomInt(10)+1; + StringBuilder builder=new StringBuilder(); + builder.append("ATT_FILE_").append(String.format("%02d", nextInt)); + return builder.toString(); + } + + +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/ValidateDatas.java b/adc-da-base/src/main/java/com/adc/da/util/ValidateDatas.java new file mode 100644 index 00000000..350dcce9 --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/ValidateDatas.java @@ -0,0 +1,94 @@ +package com.adc.da.util; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ValidateDatas { + + /** + * @param 待验证的字符串 + * @return 如果是符合邮箱格式的字符串,返回true,否则为false + */ + public static boolean isEmail(String str) { + //String regex = "[a-zA-Z_]{1,}[0-9]{0,}@(([a-zA-z0-9]-*){1,}\\.){1,3}[a-zA-z\\-]{1,}"; + String regex = "([a-zA-Z0-9_-])*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+(com|cn|net|org)"; + return match(regex, str); + } + + /** + * 汉字和字母 + * @param str + * @return + */ + public static boolean isenOrch(String str) { + String pattern = "[\u4e00-\u9fa5A-Za-z]+"; + return match(pattern, str); + } + + /** + * 汉字,字母,括号,-,下划线 + * @param str + * @return + */ + public static boolean isDuty(String str) { + String pattern = "[\u4e00-\u9fa5A-Za-z0-9_\\-\\(\\)\\(\\)]+"; + return match(pattern, str); + } + + /** + * 是否是手机号 + * @param str + * @return + */ + public static boolean isPhone(String str) { + String pattern = "0?(13|14|15|18)[0-9]{9}"; + return match(pattern, str); + } + + /** + * @param regex 正则表达式字符串 + * @param str 要匹配的字符串 + * @return 如果str 符合 regex的正则表达式格式,返回true, 否则返回 false; + */ + private static boolean match(String regex ,String str){ + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(str); + return matcher.matches(); + } + + public static boolean isNumber(String str) { + String pattern = "-?[1-9]\\d*"; + return match(pattern, str); + } + + + /** + * 汉字、字母、() + * + * @MethodName:isLetterOrChineseOrChar1 + * @author: DuYunbao + * @date: 2018/5/30 15:53 + */ + public static boolean isLetterOrChineseOrChar1(String str) { + String pattern = "^[\\u4E00-\\u9FA5A-Za-z\\(\\)]+$"; + return !str.matches(pattern); + } + + /** + * 汉字、数字、字母、()、-、下划线 + * + * @MethodName:isChineseOrNumberOrLetterOrUnderlineOrChar + * @author: DuYunbao + * @date: 2018/5/30 16:45 + */ + public static boolean isChineseOrNumberOrLetterOrUnderlineOrChar(String str) { + String regex = "^[\\u4E00-\\u9FA5A-Za-z0-9_\\-\\(\\)]+$"; + return !str.matches(regex); + } + + + public static void main(String[] args) { + String aa = "9aa"; + System.out.println(isNumber(aa)); + } +} diff --git a/adc-da-base/src/main/java/com/adc/da/util/WaterMarkUtil.java b/adc-da-base/src/main/java/com/adc/da/util/WaterMarkUtil.java new file mode 100644 index 00000000..5cf6f56a --- /dev/null +++ b/adc-da-base/src/main/java/com/adc/da/util/WaterMarkUtil.java @@ -0,0 +1,72 @@ +package com.adc.da.util; + +/** + * @Description:水印 + * @Author: yangxuenan + * date: 2020/1/10 15:42 + */ +public class WaterMarkUtil { + + /** + * @param inputFile 你的PDF文件地址 + * @param outputFile 添加水印后生成PDF存放的地址 + * @param waterMarkName 你的水印 + * @return + */ + public static boolean waterMark(String inputFile, + String outputFile, String waterMarkName) { +/* try { + PdfReader reader = new PdfReader(inputFile); + Field f = PdfReader.class.getDeclaredField("encrypted"); + f.setAccessible(true); + f.set(reader, Boolean.FALSE); + PdfStamper stamper = new PdfStamper(reader, new FileOutputStream( + outputFile)); + //这里的字体设置比较关键,这个设置是支持中文的写法 + BaseFont base = BaseFont.createFont("STSong-Light", + "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);// 使用系统字体 + int total = reader.getNumberOfPages() + 1; + + PdfContentByte under; + Rectangle pageRect = null; + for (int i = 1; i < total; i++) { + pageRect = stamper.getReader(). + getPageSizeWithRotation(i); + // 计算水印X,Y坐标 +// float x = pageRect.getWidth()/10; +// float y = pageRect.getHeight()/10-10; + // 获得PDF最顶层 + under = stamper.getOverContent(i); + under.saveState(); + // set Transparency + PdfGState gs = new PdfGState(); + // 设置透明度为0.2 + gs.setFillOpacity(0.5f); + under.setGState(gs); + under.restoreState(); + under.beginText(); + under.setFontAndSize(base, 13); + under.setTextMatrix(30, 30); + under.setColorFill(BaseColor.LIGHT_GRAY); + for (int y = 0; y < 10; y++) { + for (int x = 0; x < 8; x++) { + // 水印文字成45度角倾斜 + under.showTextAligned(Element.ALIGN_LEFT + , waterMarkName, 100 + 300 * x, 300 * y, 45); } + } + + // 添加水印文字 + under.endText(); + under.setLineWidth(1f); + under.stroke(); + } + stamper.close(); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + }*/ +return false; + } + +} diff --git a/adc-da-main/src/main/java/com/adc/da/main/generate/CodeGen.java b/adc-da-main/src/main/java/com/adc/da/main/generate/CodeGen.java index ed1cb70c..40e96151 100644 --- a/adc-da-main/src/main/java/com/adc/da/main/generate/CodeGen.java +++ b/adc-da-main/src/main/java/com/adc/da/main/generate/CodeGen.java @@ -16,15 +16,17 @@ import java.util.Scanner; public class CodeGen { - private static final String PACKAGE_PATH="/adc-da-sys/src/main"; + private static final String PACKAGE_PATH="/adc-da-slrs/src/main"; - private static final String AUTHOR="91isoft"; + private static final String AUTHOR="super_liu"; - private static final String DB_IP="192.168.10.140:1521:orcl"; + // x.x.x.x:3306/xxxx --MYSQL + // 192.168.10.140:1521:foton_slrs_test + private static final String DB_IP="127.0.0.1:3306/foton_slrs"; - private static final String DB_USER="GSAR_TEST"; + private static final String DB_USER="root"; - private static final String DB_PWD="1q2w3e4r"; + private static final String DB_PWD="root"; /** @@ -60,11 +62,20 @@ public class CodeGen { gc.setMapperName("%sDao"); mpg.setGlobalConfig(gc); - // 数据源配置 + // 数据源配置 ORACLE +// DataSourceConfig dsc = new DataSourceConfig(); +// dsc.setUrl("jdbc:oracle:thin:@"+DB_IP); +// // dsc.setSchemaName("public"); +// dsc.setDriverName("oracle.jdbc.OracleDriver"); +// dsc.setUsername(DB_USER); +// dsc.setPassword(DB_PWD); +// mpg.setDataSource(dsc); + + // 数据源配置 MYSQL DataSourceConfig dsc = new DataSourceConfig(); - dsc.setUrl("jdbc:oracle:thin:@"+DB_IP); - // dsc.setSchemaName("public"); - dsc.setDriverName("oracle.jdbc.OracleDriver"); + dsc.setUrl("jdbc:mysql://"+DB_IP+"?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false"); + //dsc.setSchemaName("public");//PostgreSQL schemaName + dsc.setDriverName("com.mysql.jdbc.Driver"); dsc.setUsername(DB_USER); dsc.setPassword(DB_PWD); mpg.setDataSource(dsc); @@ -73,7 +84,7 @@ public class CodeGen { PackageConfig pc = new PackageConfig(); pc.setModuleName(scanner("模块名")); pc.setMapper("dao"); - pc.setParent("com.adc.da"); + pc.setParent("com.adc.da.slrs"); mpg.setPackageInfo(pc); // 自定义配置 diff --git a/adc-da-slrs/pom.xml b/adc-da-slrs/pom.xml new file mode 100644 index 00000000..deed6c60 --- /dev/null +++ b/adc-da-slrs/pom.xml @@ -0,0 +1,23 @@ + + + + foton-slrs-system-rest + com.adc + 3.0.0 + + 4.0.0 + + adc-da-slrs + + + com.adc + adc-da-base + 3.0.0 + compile + + + + + \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java new file mode 100644 index 00000000..7d370774 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/controller/SarStandardsInfoController.java @@ -0,0 +1,23 @@ +package com.adc.da.slrs.sarStandardsInfo.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; +import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RestController; +import com.adc.da.base.web.BaseController; + +/** +*

+ * 前端控制器 + *

+* +* @author super_liu +* @since 2021-05-31 +*/ +@RestController +@Api(description = "|SarStandardsInfo|") +@RequestMapping("/sarStandardsInfo/sar-standards-info") +public class SarStandardsInfoController extends BaseController { + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/dao/SarStandardsInfoDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/dao/SarStandardsInfoDao.java new file mode 100644 index 00000000..d5d1accb --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/dao/SarStandardsInfoDao.java @@ -0,0 +1,16 @@ +package com.adc.da.slrs.sarStandardsInfo.dao; + +import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author super_liu + * @since 2021-05-31 + */ +public interface SarStandardsInfoDao extends BaseMapper { + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/entity/SarStandardsInfo.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/entity/SarStandardsInfo.java new file mode 100644 index 00000000..46e69548 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/entity/SarStandardsInfo.java @@ -0,0 +1,117 @@ +package com.adc.da.slrs.sarStandardsInfo.entity; + +import com.adc.da.base.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * + *

+ * + * @author super_liu + * @since 2021-05-31 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@ApiModel(value="SarStandardsInfo对象", description="") +public class SarStandardsInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + @TableId("ID") + private String id; + + @ApiModelProperty(value = "标准分类") + @TableField("STAND_TYPE") + private String standType; + + @ApiModelProperty(value = "国家地区") + @TableField("COUNTRY") + private String country; + + @ApiModelProperty(value = "标准类别") + @TableField("STAND_SORT") + private String standSort; + + @ApiModelProperty(value = "标准编号") + @TableField("STAND_NUMBER") + private String standNumber; + + @ApiModelProperty(value = "标准年份") + @TableField("STAND_YEAR") + private String standYear; + + @ApiModelProperty(value = "标准名称") + @TableField("STAND_NAME") + private String standName; + + @ApiModelProperty(value = "标准英文名称") + @TableField("STAND_EN_NAME") + private String standEnName; + + @ApiModelProperty(value = "标准状态") + @TableField("STAND_STATE") + private String standState; + + @ApiModelProperty(value = "标准性质") + @TableField("STAND_NATURE") + private String standNature; + + @ApiModelProperty(value = "发布日期") + @TableField("ISSUE_TIME") + private String issueTime; + + @ApiModelProperty(value = "实施日期") + @TableField("PUT_TIME") + private LocalDateTime putTime; + + @ApiModelProperty(value = "内容摘要") + @TableField("SYNOPSIS") + private String synopsis; + + @ApiModelProperty(value = "代替标准号") + @TableField("REPLACE_STAND_NUM") + private String replaceStandNum; + + @ApiModelProperty(value = "被代替标准号") + @TableField("REPLACED_STAND_NUM") + private String replacedStandNum; + + @TableField("CREATION_USER") + private String creationUser; + + @ApiModelProperty(value = "是否有效") + @TableField("VALID_FLAG") + private String validFlag; + + @ApiModelProperty(value = "创建时间") + @TableField("CREATION_TIME") + private LocalDateTime creationTime; + + @ApiModelProperty(value = "修改时间") + @TableField("MODIFY_TIME") + private LocalDateTime modifyTime; + + @ApiModelProperty(value = "是否法规清单相关(0否 1是)") + @TableField("IS_RELATE_ACCESS") + private String isRelateAccess; + + @ApiModelProperty(value = "引用标准") + @TableField("CITE_STAND") + private String citeStand; + + @ApiModelProperty(value = "被引用标准") + @TableField("CITED_STAND") + private String citedStand; + + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/ISarStandardsInfoService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/ISarStandardsInfoService.java new file mode 100644 index 00000000..1d9558ed --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/ISarStandardsInfoService.java @@ -0,0 +1,16 @@ +package com.adc.da.slrs.sarStandardsInfo.service; + +import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author super_liu + * @since 2021-05-31 + */ +public interface ISarStandardsInfoService extends IService { + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java new file mode 100644 index 00000000..06e09598 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.adc.da.slrs.sarStandardsInfo.service.impl; + +import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo; +import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao; +import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author super_liu + * @since 2021-05-31 + */ +@Service +public class SarStandardsInfoServiceImpl extends ServiceImpl implements ISarStandardsInfoService { + +} diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarStandardsInfo/SarStandardsInfoMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarStandardsInfo/SarStandardsInfoMapper.xml new file mode 100644 index 00000000..9eae18bc --- /dev/null +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarStandardsInfo/SarStandardsInfoMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/adc-da-sys/src/main/java/com/adc/da/att/service/impl/AttFileEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/att/service/impl/AttFileEOServiceImpl.java index 07f8c0c0..2d60007c 100644 --- a/adc-da-sys/src/main/java/com/adc/da/att/service/impl/AttFileEOServiceImpl.java +++ b/adc-da-sys/src/main/java/com/adc/da/att/service/impl/AttFileEOServiceImpl.java @@ -4,7 +4,7 @@ import com.adc.da.att.dao.AttFileEODao; import com.adc.da.att.entity.AttFileEO; import com.adc.da.att.service.IAttFileEOService; import com.adc.da.att.vo.AttFileVo; -import com.adc.da.common.ValidFlagEnum; +import com.adc.da.sys.constant.ValidFlagEnum; import com.adc.da.util.FileUtil; import com.adc.da.util.UUIDUtils; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; diff --git a/adc-da-sys/src/main/java/com/adc/da/person/dao/PersonCollectEODao.java b/adc-da-sys/src/main/java/com/adc/da/person/dao/PersonCollectEODao.java index cd1fe6e9..9b744f0d 100644 --- a/adc-da-sys/src/main/java/com/adc/da/person/dao/PersonCollectEODao.java +++ b/adc-da-sys/src/main/java/com/adc/da/person/dao/PersonCollectEODao.java @@ -18,15 +18,18 @@ import java.util.List; */ public interface PersonCollectEODao extends BaseMapper { - List queryByList(BasePage page); + public List queryByList(BasePage page); - int queryByCount(BasePage var1); + public int queryByCount(BasePage var1); - List queryByPage(BasePage page); + public List queryByPage(BasePage page); public List queryByPersonCollectPage(PersonCollectEOPage page); - int queryByPersonCollectPageCount(PersonCollectEOPage page); + public int queryByPersonCollectPageCount(PersonCollectEOPage page); + + public int deleteByIdList(@Param("idList") List idList); + + public int deleteByResId(@Param("resId") String resId); - int deleteByIdList(@Param("idList") List idList); } diff --git a/adc-da-sys/src/main/java/com/adc/da/person/dao/PersonShareEODao.java b/adc-da-sys/src/main/java/com/adc/da/person/dao/PersonShareEODao.java index 926fa370..d1d0a883 100644 --- a/adc-da-sys/src/main/java/com/adc/da/person/dao/PersonShareEODao.java +++ b/adc-da-sys/src/main/java/com/adc/da/person/dao/PersonShareEODao.java @@ -26,4 +26,6 @@ public interface PersonShareEODao extends BaseMapper { void deleteByIdList(@Param("idList") List idList); void deleteByIdListForward(@Param("idList") List idList); + + int deleteByResId(@Param("resId") String resId); } diff --git a/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonCollectEOService.java b/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonCollectEOService.java index 37ddc989..9e3a673b 100644 --- a/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonCollectEOService.java +++ b/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonCollectEOService.java @@ -18,4 +18,6 @@ public interface IPersonCollectEOService extends IService { public int deleteByIdList(List idList); + public int deleteByResId(String resId); + } diff --git a/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonConfEOService.java b/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonConfEOService.java index 3bf183e5..dbb2a53b 100644 --- a/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonConfEOService.java +++ b/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonConfEOService.java @@ -16,13 +16,13 @@ public interface IPersonConfEOService extends IService { public PersonConfEO saveBean(PersonConfEO personConfEO); - public PersonConfEO insert1(PersonConfEO personConfEO ); + public PersonConfEO insert1(PersonConfEO personConfEO); public List selectByUserid(String userId); public Map selectPersonConfByUserid(String userId); - public String[] updatePersonConfList(String[] kes,String userId); + public String[] updatePersonConfList(String[] kes, String userId); public List saveConfList(String userId); diff --git a/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonShareEOService.java b/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonShareEOService.java index 53125c08..a68826b2 100644 --- a/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonShareEOService.java +++ b/adc-da-sys/src/main/java/com/adc/da/person/service/IPersonShareEOService.java @@ -19,4 +19,6 @@ public interface IPersonShareEOService extends IService { public void deleteByIdListForward(List idList); + public int deleteByResId(String resId); + } diff --git a/adc-da-sys/src/main/java/com/adc/da/person/service/impl/PersonCollectEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/person/service/impl/PersonCollectEOServiceImpl.java index c8c256a4..ed0d425f 100644 --- a/adc-da-sys/src/main/java/com/adc/da/person/service/impl/PersonCollectEOServiceImpl.java +++ b/adc-da-sys/src/main/java/com/adc/da/person/service/impl/PersonCollectEOServiceImpl.java @@ -91,4 +91,9 @@ public class PersonCollectEOServiceImpl extends ServiceImpl idList){ return this.baseMapper.deleteByIdList(idList); } + + @Override + public int deleteByResId(String resId) { + return this.baseMapper.deleteByResId(resId); + } } diff --git a/adc-da-sys/src/main/java/com/adc/da/person/service/impl/PersonShareEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/person/service/impl/PersonShareEOServiceImpl.java index 93008101..5d079b95 100644 --- a/adc-da-sys/src/main/java/com/adc/da/person/service/impl/PersonShareEOServiceImpl.java +++ b/adc-da-sys/src/main/java/com/adc/da/person/service/impl/PersonShareEOServiceImpl.java @@ -48,4 +48,9 @@ public class PersonShareEOServiceImpl extends ServiceImpl { + private static final Logger logger = LoggerFactory.getLogger(DictionaryEO.class); + + @Autowired + private IDicEOService dicEOService; + + @ApiOperation(value = "|DictionaryEO|分页查询") + @GetMapping("/page") +// @RequiresPermissions("lawssBase:dictionary:page") + public ResponseMessage> page(DictionaryEOPage page) throws Exception { + page.setDictionaryCodeOperator("like"); + page.setDictionaryNameOperator("like"); + List rows = dicEOService.queryAllDicByPage(page); + return Result.success(getPageInfo(page.getPager(), rows)); + } + + @ApiOperation(value = "|DictionaryEO|查询") + @GetMapping("/queryByList") +// @RequiresPermissions("lawssBase:dictionary:list") + public ResponseMessage> list(DictionaryEOPage page) throws Exception { + return Result.success(dicEOService.queryByList(page)); + } + + @ApiOperation(value = "|DictionaryEO|详情") + @GetMapping("/{id}") +// @RequiresPermissions("lawssBase:dictionary:get") + public ResponseMessage find(@PathVariable String id) throws Exception { + return Result.success(dicEOService.getById(id)); + } + + @ApiOperation(value = "|DictionaryEO|新增") + @PostMapping("/addDictionary") +// @RequiresPermissions("lawssBase:dictionary:save") + public ResponseMessage addDictionary(@RequestBody DictionaryEO dictionaryEO) throws Exception { + String resultMsg = dicEOService.createDictionary(dictionaryEO); + if ("success".equals(resultMsg)) { + return Result.success("0","新增成功",dictionaryEO); + } else { + return Result.error("新增失败," + resultMsg); + } + } + + @ApiOperation(value = "|DictionaryEO|修改") + @PutMapping("/updateDictionary") +// @RequiresPermissions("lawssBase:dictionary:update") + public ResponseMessage updateDictionary(@RequestBody DictionaryEO dictionaryEO) throws Exception { + String resultMsg = dicEOService.updateDictionary(dictionaryEO); + if ("success".equals(resultMsg)) { + return Result.success("0","修改成功",dictionaryEO); + } else { + return Result.error("修改失败," + resultMsg); + } + } + + @ApiOperation(value = "|DictionaryEO|删除") + @PutMapping("/deleteByIds") +// @RequiresPermissions("lawssBase:dictionary:delete") + public ResponseMessage deleteByIds(String id) throws Exception { + int countRes = dicEOService.queryUseByCount(id); + if (countRes > 0) { + return Result.error("0","有引用,无法删除",null); + } else { + dicEOService.deleteDicAndType(id); + return Result.success("0","删除成功",null); + } + } + + @ApiOperation(value = "|DictionaryEO|删除字典和相关明细") + @DeleteMapping("/deleteDicAndType/{id}") +// @RequiresPermissions("sys:dic:delete") + public ResponseMessage deleteDicAndType(@NotNull @PathVariable(value = "id") String id) throws Exception { + dicEOService.deleteDicAndType(id); + return Result.success(); + } + + /* + * 数据字典下拉框接口(通用) + * @MethodName:getByDicCode + * @author: DuYunbao + * @date: 2018/5/3 10:36 + */ + @ApiOperation(value = "数据字典下拉框接口") + @GetMapping("/dicCode/{dicCode}") +// @RequiresPermissions("sys:dic:getByDicCode") + public ResponseMessage getByDicCode(@NotNull @PathVariable("dicCode") String dicCode) throws Exception { + DictionaryEO dictionaryVO = dicEOService.getDicEOAndTypeEoByDicCode(dicCode); + return Result.success(dictionaryVO); + } + + @ApiOperation(value = "以下拉框格式查询所有类别") + @GetMapping("/getDictionarySelList") +// @RequiresPermissions("sys:dic:getByDicCode") + public ResponseMessage> getDictionarySelList(String id) { + List getList = dicEOService.getDictionarySelList(id); + return Result.success(getList); + } + + @ApiOperation(value = "以下拉框格式查询所有类别Code") + @GetMapping("/getDictionaryCodeSelList") +// @RequiresPermissions("sys:dic:getByDicCode") + public ResponseMessage> getDictionaryCodeSelList(String id) { + List getList = dicEOService.getDictionaryCodeSelList(id); + return Result.success(getList); + } + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/controller/DicTypeEORestController.java b/adc-da-sys/src/main/java/com/adc/da/sys/controller/DicTypeEORestController.java new file mode 100644 index 00000000..8d79b324 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/controller/DicTypeEORestController.java @@ -0,0 +1,377 @@ +package com.adc.da.sys.controller; + +import com.adc.da.base.page.Pager; +import com.adc.da.base.web.BaseController; +import com.adc.da.http.PageInfo; +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; +import com.adc.da.sys.common.SelectionResult; +import com.adc.da.sys.entity.DicTypeEO; +import com.adc.da.sys.page.DicTypeEOPage; +import com.adc.da.sys.service.IDicTypeEOService; +import com.adc.da.sys.vo.DicTypeVO; +import com.adc.da.util.UUIDUtils; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.constraints.NotNull; +import java.util.*; + +import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE; + +@RestController +@RequestMapping("/${restPath}/sys/dictype") +@Api(description = "字典类型明细管理") +public class DicTypeEORestController extends BaseController { + private static final Logger logger = LoggerFactory.getLogger(DicTypeEO.class); + @Autowired + private IDicTypeEOService dicTypeEOService; + + List dicTypeEOTypeNameAndCode = new ArrayList<>(); + + /** + * @return com.adc.da.util.http.ResponseMessage + * @Author liwenxuan + * @Description 新增数据字典,必填字段:字典类型编码、字典类型名称 + * @Date Administrator 2018/9/17 + * @Param [dicTypeVO] + **/ + @ApiOperation(value = "|DicTypeEO|新增") + @PostMapping("/create") + @RequiresPermissions("sys:dicType:create") + public ResponseMessage create(@RequestBody DicTypeEO dicTypeVO) throws Exception { + + //通过传入的code获取对象(此时id为空,sql做了判断) +// List dicTypeEOList = dicTypeEOService.getDicTypeEOByDicTypeCode(dicTypeVO.getDicId(),dicTypeVO.getId(),dicTypeVO.getDicTypeCode(),dicTypeVO.getParentId()); + //通过传入的name和数据字典id获取对象 + dicTypeVO.setId(null); + List dicTypeEOS = dicTypeEOService.getTypeIdByDicIdAndTypeName(dicTypeVO.getDicId(), dicTypeVO.getId(), dicTypeVO.getDicTypeName(), dicTypeVO.getParentId()); + if (dicTypeEOS != null && !dicTypeEOS.isEmpty()) { + return Result.error("选项已存在"); + } + //前台需要返回message和true,底层封装的返回方法只有这个返回值能用(返回的对象t:1前台不需要) + Integer dicTypeEO = dicTypeEOService.saveDictype(dicTypeVO); + if (dicTypeEO > 0) { + return Result.success("", "新增成功", 1); + } + return Result.error("新增失败"); + } + + /** + * @return com.adc.da.util.http.ResponseMessage + * @Author liwenxuan + * @Description 企业标准大类 + * @Date Administrator 2018/10/9 + * @Param [dicTypeVO] + **/ + @ApiOperation(value = "|DicTypeEO|企标大类新增") + @PostMapping("/createEnterpriseStandard") + @RequiresPermissions("sys:dicType:createEnterpriseStandard") + public ResponseMessage createEnterpriseStandard(@RequestBody DicTypeEO dicTypeVO) throws Exception { + dicTypeVO.setId(UUIDUtils.randomUUID20()); +// liwenxuan:用来企业大类判断新增是否重复 有parentId代表查询里面的数据 (企业大类分页查找只显示根节点,编辑每条数据里面是他对应的孩子节点,是dicTypeEOService.getDicTypeEOTypeNameAndCode1方法) + if (dicTypeVO.getParentId() != null) { + dicTypeEOTypeNameAndCode = dicTypeEOService.getDicTypeEOTypeNameAndCode(dicTypeVO.getId(), dicTypeVO.getDicTypeName(), dicTypeVO.getDicTypeCode(), dicTypeVO.getParentId()); + } else { + dicTypeEOTypeNameAndCode = dicTypeEOService.getDicTypeEOTypeNameAndCode1(dicTypeVO.getId(), dicTypeVO.getDicTypeName(), dicTypeVO.getDicTypeCode(), dicTypeVO.getParentId()); + } + if (dicTypeEOTypeNameAndCode.size() != 0) { + for (DicTypeEO dicTypeEO : dicTypeEOTypeNameAndCode) { + if (dicTypeEO.getDicTypeName().equals(dicTypeVO.getDicTypeName())) { + return Result.error("选项已存在"); + } + } + } + Integer dicTypeEO = dicTypeEOService.saveDictype(dicTypeVO); + if (dicTypeEO > 0) { + return Result.success("", "新增成功", 1); + } + + return Result.error("新增失败"); + } + + + /** + * @return com.adc.da.util.http.ResponseMessage> + * @Author liwenxuan + * @Description 分页查询(根据code也可以进行模糊查找) + * 1.供所有的数据字典参照表使用 + * 2.供国家地区的编辑和查看的回显使用(需要传入id作为parentId进行查找国家地区下面的孩子节点) + * @Date Administrator 2018/9/17 + * @Param [pageNo, pageSize, dicId, dicTypeName, dicTypeCode] + **/ + @ApiOperation(value = "|DicTypeEO|分页列表") + @GetMapping("/page") + //@RequiresPermissions("sys:dicType:pageListByDicId") + public ResponseMessage> pageListByDicId(DicTypeEOPage page) throws Exception { + page.setPager(new Pager()); + page.setValidFlag("0"); + page.setOrderBy("show_index,modify_time desc"); + List rows = dicTypeEOService.queryByPage(page); + /*企标细类加入分类代号*/ + if("FGFBTYGHGHMB".equals(page.getDicId()) && rows!=null && rows.size()>0){ + for(DicTypeEO row:rows){ + List getClassify = dicTypeEOService.getDicTypeEOByDicTypeCode(null,null,null,row.getId()); + if(getClassify!=null && getClassify.size()>0){ + row.setClassifyCode(getClassify.get(0).getDicTypeName()); + row.setClassifyCodeId(getClassify.get(0).getId()); + } + } + } + return Result.success(getPageInfo(page.getPager(), rows)); + } + + @ApiOperation(value = "|DicTypeEO|国家/地区分页列表") + @GetMapping("/pageCountry") + @RequiresPermissions("sys:dicType:pageListByDicIdAndNoParentId") + public ResponseMessage> pageListByDicIdAndNoParentId(DicTypeEOPage page) throws Exception { + page.setPager(new Pager()); + page.setValidFlag("0"); + page.setOrderBy("show_index,modify_time desc"); + List rows = dicTypeEOService.queryByPageNoParentId(page); + return Result.success(getPageInfo(page.getPager(), rows)); + } + + /*** + * 获取数据字典属性所有内容 + * @MethodName:getDicTypeList + * @author: zhangyanduan + * @param:[dicId] + * @return:com.adc.da.util.http.ResponseMessage> + * date: 2018/11/1 15:42 + */ + @ApiOperation(value = "|DicTypeEO|查询所有数据字典数据") + @GetMapping("/getDicTypeList") +// @RequiresPermissions("sys:dicType:getDicTypeList") + public ResponseMessage> getDicTypeList(String dicId) throws Exception { + DicTypeEOPage page = new DicTypeEOPage(); + page.setDicId(dicId); + page.setValidFlag("0"); + List typeEOList = dicTypeEOService.queryByList(page); + return Result.success(typeEOList); + } + + + /** + * @return com.adc.da.util.http.ResponseMessage + * @Author liwenxuan + * @Description 修改数据字典编码和名称 + * 1.如果修改的字典类型编码不改变也可以进行修改 通过用户id获得字段名字和输入的名字一致也可以 + * 2.原name和新输入的name进行对比,如果一样不算在字典类型编码重复 + * @Date Administrator 2018/9/17 + * @Param [dicTypeVO] + **/ + @ApiOperation(value = "|DicTypeEO|修改") + @PutMapping(consumes = APPLICATION_JSON_UTF8_VALUE) + @RequiresPermissions("sys:dicType:update") + public ResponseMessage update(@RequestBody DicTypeEO dicTypeVO) throws Exception { + // liwenxuan:用来企业大类判断新增是否重复 有parentId代表查询里面的数据 + if (dicTypeVO.getParentId() != null) { + dicTypeEOTypeNameAndCode = dicTypeEOService.getDicTypeEOTypeNameAndCode(dicTypeVO.getId(), dicTypeVO.getDicTypeName(), dicTypeVO.getDicTypeCode(), dicTypeVO.getParentId()); + } else { + dicTypeEOTypeNameAndCode = dicTypeEOService.getTypeIdByDicIdAndTypeName(dicTypeVO.getDicId(), dicTypeVO.getId(), dicTypeVO.getDicTypeName(), dicTypeVO.getParentId()); + } + for (DicTypeEO dicTypeEO : dicTypeEOTypeNameAndCode) { + if (dicTypeEO.getDicTypeName().equals(dicTypeVO.getDicTypeName())) { + return Result.error("选项已存在"); + } + } + dicTypeVO.setModifyTime(new Date()); + int i = dicTypeEOService.updateByPrimaryKeySelective(dicTypeVO); + //如果修改数据为标准类别,将国家地区关联的标准类别同时修改 + if ("JKSADFH564S".equals(dicTypeVO.getDicId())) { + dicTypeEOService.updateByDicTypeCode(dicTypeVO); + } + //修改细类中分类代号 + if(StringUtils.isNotEmpty(dicTypeVO.getClassifyCode()) && StringUtils.isNotEmpty(dicTypeVO.getClassifyCodeId())){ + DicTypeEO upClassiEo = new DicTypeEO(); + upClassiEo.setId(dicTypeVO.getClassifyCodeId()); + upClassiEo.setDicTypeName(dicTypeVO.getClassifyCode()); + upClassiEo.setModifyTime(new Date()); + dicTypeEOService.updateByPrimaryKeySelective(upClassiEo); + } else if(StringUtils.isNotEmpty(dicTypeVO.getClassifyCodeId()) && StringUtils.isEmpty(dicTypeVO.getClassifyCode())){ + DicTypeEO upClassiEo = new DicTypeEO(); + upClassiEo.setId(dicTypeVO.getClassifyCodeId()); + upClassiEo.setValidFlag(1); + dicTypeEOService.updateByPrimaryKeySelective(upClassiEo); + }else if(StringUtils.isEmpty(dicTypeVO.getClassifyCodeId()) && StringUtils.isNotEmpty(dicTypeVO.getClassifyCode())){ + DicTypeEO dicClassifyCode = new DicTypeEO(); + dicClassifyCode.setDicTypeName(dicTypeVO.getClassifyCode()); + dicClassifyCode.setDicId("YDWVSVOAQG"); + dicClassifyCode.setParentId(dicTypeVO.getId()); + dicClassifyCode.setId(UUIDUtils.randomUUID20()); + dicClassifyCode.setValidFlag(0); + dicClassifyCode.setCreationTime(new Date()); + dicClassifyCode.setModifyTime(new Date()); + dicClassifyCode.setDicTypeCode(UUIDUtils.randomUUID10()); + dicTypeEOService.insertSelective(dicClassifyCode); + } + if (i == 0) { + return Result.error("修改失败"); + } + return Result.success("true", "修改成功", 1); + } + + /** + * @return com.adc.da.util.http.ResponseMessage + * @Author liwenxuan + * @Description 根据数据字典参数表id获取数据字典参数表信息 + * @Date Administrator 2018/9/17 + * @Param [id] + **/ + @ApiOperation(value = "|DicTypeEO|详情") + @GetMapping("/{id}") + @RequiresPermissions("sys:dicType:get") + public ResponseMessage getById(@NotNull @PathVariable("id") String id) throws Exception { + DicTypeEO dicTypeVO = dicTypeEOService.getDicTypeById(id); + return Result.success(dicTypeVO); + } + + + /** + * @return com.adc.da.util.http.ResponseMessage + * @Author liwenxuan + * @Description 删除多条数据 ,实际上设置vilid_flag=1 + * @Date Administrator 2018/9/17 + * @Param [ids] + **/ + @ApiOperation(value = "|DicTypeEO|删除多条数据") + //@DeleteMapping("/deleteArr/{ids}") + @DeleteMapping("/deleteArr") + //@RequiresPermissions("sys:dicType:deleteArr") + public ResponseMessage deleteArr(String[] ids, String[] dicTypeCodes) throws Exception { + if (dicTypeCodes != null) { + List list = Arrays.asList(dicTypeCodes); + for (String dicTypeCode : list) { + boolean dicTypeByDicTypeCode = dicTypeEOService.getDicTypeByDicTypeCode(dicTypeCode); + if (dicTypeByDicTypeCode == false) { + return Result.error("有引用,无法删除"); + } + } + } else { + // 标准类别判断 + List list = Arrays.asList(ids); + for (String id : list) { + DicTypeEO dicTypeEO = dicTypeEOService.getDicTypeById(id); + // 通过对应的国家code,和 标准类别code 判断是否被引用 + DicTypeEO countryEO = dicTypeEOService.getDicTypeById(dicTypeEO.getParentId()); + //在主表中,标准类别的code和name 是同一个是 + boolean dicTypeByDicTypeCode = dicTypeEOService.judgeHaveUse(dicTypeEO.getDicTypeCode(),countryEO.getDicTypeCode()); + if (!dicTypeByDicTypeCode) { + return Result.error("有引用,无法删除"); + } + } + } + dicTypeEOService.delete(Arrays.asList(ids)); + if (dicTypeCodes != null) { + // 如果dicTypeCode不为空,说明删除标准类别,国家下的标准类别也需要同步删除 + dicTypeEOService.deleteDicTypeByCodeAndParentid(Arrays.asList(dicTypeCodes)); + } + return Result.success("", "删除成功", null); + } + + + /** + * @return com.adc.da.util.http.ResponseMessage + * @Author liwenxuan + * @Description 删除一条数据 + * @Date Administrator 2018/9/17 + * @Param [id] + **/ + @ApiOperation(value = "|DicTypeEO|删除一条数据") + @DeleteMapping("/delete") + //@RequiresPermissions("sys:dicType:removeDicType") + public ResponseMessage delete(String dicTypeEOId, String dicTypeCode) throws Exception { + if (dicTypeCode != null) { + boolean dicTypeByDicTypeCode = dicTypeEOService.getDicTypeByDicTypeCode(dicTypeCode); + if (dicTypeByDicTypeCode == false) { + return Result.error("有引用,无法删除"); + } + }else { + // 标准类别判断 + DicTypeEO dicTypeEO = dicTypeEOService.getDicTypeById(dicTypeEOId); + // 通过对应的国家code,和 标准类别code 判断是否被引用 + DicTypeEO countryEO = dicTypeEOService.getDicTypeById(dicTypeEO.getParentId()); + //在主表中,标准类别的code和name 是同一个是 + boolean dicTypeByDicTypeCode = dicTypeEOService.judgeHaveUse(dicTypeEO.getDicTypeName(),countryEO.getDicTypeCode()); + if (!dicTypeByDicTypeCode) { + return Result.error("有引用,无法删除"); + } + } + dicTypeEOService.deleteDicTypeByDicId(dicTypeEOId); + if (dicTypeCode != null) { + // 如果dicTypeCode不为空,说明删除标准类别,国家下的标准类别也需要同步删除 + List codes = new ArrayList<>(); + codes.add(dicTypeCode); + dicTypeEOService.deleteDicTypeByCodeAndParentid(codes); + } + return Result.success("", "删除成功", null); + } + + /** + * @return com.adc.da.util.http.ResponseMessage> + * @Author yangxuenan + * @Description 根据数据字典编码查询字典类型 + * Date 2018/9/12 10:12 + * @Param [dicCode] + **/ + @ApiOperation(value = "|DicTypeEO|查询字典类型") + @GetMapping("/getDicTypeByDicCode") + // @RequiresPermissions("sys:dicType:getDicTypeByDicCode") + public ResponseMessage>> getDicTypeByDicCode(@RequestParam String dicCode) throws Exception { + List> dicTypeEO = dicTypeEOService.getDicTypeByDicCode(dicCode); + return Result.success(dicTypeEO); + } + + /** + * @return com.adc.da.util.http.ResponseMessage> + * @Author gaoyan + * @Description 分组查询全部字典类型 + * Date 2018/9/11 19:09 + * @Param [dicCode] + **/ + @ApiOperation(value = "|DicTypeEO|查询字典类型") + @GetMapping("/getDicTypeListCode") + //@RequiresPermissions("sys:dicType:getDicTypeListCode") + public ResponseMessage> getDicTypeListCode() throws Exception { + Map dicTypeEO = dicTypeEOService.getDicTypeListCode(); + return Result.success(dicTypeEO); + } + + /** + * @return com.adc.da.util.http.ResponseMessage>> + * @Author yangxuenan + * @Description 根据父级code查询 + * Date 2018/10/9 14:11 + * @Param [dicTypeCode] + **/ + @ApiOperation(value = "|DicTypeEO|根据父级code查询") + @GetMapping("/getDicTypeByParentCode") + // @RequiresPermissions("sys:dicType:getDicTypeByParentCode") + public ResponseMessage>> getDicTypeByParentCode(@RequestParam String dicTypeCode) throws Exception { + List> dicTypeEO = dicTypeEOService.getDicTypeByParentCode(dicTypeCode); + return Result.success(dicTypeEO); + } + + @ApiOperation(value = "|DicTypeEO|根据父级多个code查询") + @GetMapping("/getDicTypeByParentCodes") + // @RequiresPermissions("sys:dicType:getDicTypeByParentCode") + public ResponseMessage>> getDicTypeByParentCodes(@RequestParam String dicTypeCode) throws Exception { + List> dicTypeEO = dicTypeEOService.getDicTypeByParentCodes(dicTypeCode); + return Result.success(dicTypeEO); + } + + @ApiOperation(value = "|DicTypeEO|根据DicId查询下拉列表") + @GetMapping("/getDicTypeByDicId") + public ResponseMessage> getDicTypeByDicId(String dicId) { + List dicTypeEO = dicTypeEOService.getDicTypeByDicId(dicId); + return Result.success(dicTypeEO); + } + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/controller/RoleEOController.java b/adc-da-sys/src/main/java/com/adc/da/sys/controller/RoleEOController.java index 6012f1b3..7a456af7 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/controller/RoleEOController.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/controller/RoleEOController.java @@ -3,11 +3,11 @@ package com.adc.da.sys.controller; import cn.hutool.core.bean.BeanUtil; import com.adc.da.base.page.Pager; import com.adc.da.base.web.BaseController; -import com.adc.da.common.ValidFlagEnum; import com.adc.da.http.PageInfo; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; import com.adc.da.sys.constant.IsBelongEnum; +import com.adc.da.sys.constant.ValidFlagEnum; import com.adc.da.sys.entity.RoleEO; import com.adc.da.sys.entity.UserEO; import com.adc.da.sys.entity.UserRoleEO; diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/controller/UserEOController.java b/adc-da-sys/src/main/java/com/adc/da/sys/controller/UserEOController.java index 77f627d8..50b89956 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/controller/UserEOController.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/controller/UserEOController.java @@ -3,10 +3,10 @@ package com.adc.da.sys.controller; import cn.hutool.core.bean.BeanUtil; import com.adc.da.base.page.Pager; import com.adc.da.base.web.BaseController; -import com.adc.da.common.ValidFlagEnum; import com.adc.da.http.PageInfo; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; +import com.adc.da.sys.constant.ValidFlagEnum; import com.adc.da.sys.entity.RoleEO; import com.adc.da.sys.entity.UserEO; import com.adc.da.sys.page.UserEOPage; diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/controller/UserInfoEOController.java b/adc-da-sys/src/main/java/com/adc/da/sys/controller/UserInfoEOController.java index 4692a62d..d4aeb11c 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/controller/UserInfoEOController.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/controller/UserInfoEOController.java @@ -1,10 +1,10 @@ package com.adc.da.sys.controller; import com.adc.da.base.web.BaseController; -import com.adc.da.common.ValidFlagEnum; import com.adc.da.http.PageInfo; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; +import com.adc.da.sys.constant.ValidFlagEnum; import com.adc.da.sys.entity.RoleEO; import com.adc.da.sys.entity.UserEO; import com.adc.da.sys.entity.UserInfoEO; diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/DicEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/DicEODao.java new file mode 100644 index 00000000..feeb2652 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/DicEODao.java @@ -0,0 +1,48 @@ +package com.adc.da.sys.dao; + +import com.adc.da.sys.common.SelectionResult; +import com.adc.da.sys.entity.DictionaryEO; +import com.adc.da.sys.page.DictionaryEOPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface DicEODao extends BaseMapper { + + public DictionaryEO getDictionaryEOById(String id); + + public DictionaryEO getDictionaryEOByDicCode(String dictionaryCode); + + public DictionaryEO getDicEOAndTypeEoByDicCode(String dictionaryCode); + + public DictionaryEO getDictionaryEOByDicName(String dictionaryName); + + public void deleteDic(String id); + + //gaoyan + public List getDictionaryEO(); + + public Integer countByCodeOrName(DictionaryEOPage page); + + public List queryAllDicByPage(DictionaryEOPage page); + + public Integer queryAllDicByCount(DictionaryEOPage page); + + public List getDictionarySelList(@Param("id") String id); + + public List getDictionaryCodeSelList(@Param("id") String id); + + public int queryUseByCount(@Param("id") String id); + + public int insertSelective(DictionaryEO dictionaryEO); + + public int updateByPrimaryKeySelective(DictionaryEO dictionaryEO); + + public List queryByPage(DictionaryEOPage page); + + public int queryByCount(DictionaryEOPage page); + + public List queryByList(DictionaryEOPage page); + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/DicTypeEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/DicTypeEODao.java new file mode 100644 index 00000000..2203bcf4 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/DicTypeEODao.java @@ -0,0 +1,78 @@ +package com.adc.da.sys.dao; + +import com.adc.da.sys.common.SelectionResult; +import com.adc.da.sys.entity.DicTypeEO; +import com.adc.da.sys.page.DicTypeEOPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface DicTypeEODao extends BaseMapper { + + public DicTypeEO getDicTypeEOById(String id); + + public void deleteDicTypeByIdInBatch(List ids); + + public List getTypeIdByDicIdAndTypeName(@Param("dicId") String dicId, @Param("id") String id, @Param("typeName") String typeName, @Param("parentId") String parentId); + + + public List getDicTypeEOByDicTypeCode(@Param("dicId") String dicId, @Param("id") String id, @Param("dicTypeCode") String dicTypeCode, @Param("parentId") String parentId); + + public void batchInsertTypeEo(List ModelType); + + public void deleteDicTypeByDicId(String id); + + /** + * @Author yangxuenan + * @Description 根据数据字典编码查询字典类型 + * Date 2018/9/11 15:09 + * @Param [dictionaryCode] + * @return java.util.List + **/ + public List getDicTypeByDicCode(String dictionaryCode); + + public List getFineDicTypeByDicCode(String dictionaryCode); + + //liwenxuan:国家地区新增 + public List queryByPageNoParentId(DicTypeEOPage page); + + public int queryByCountCounter(DicTypeEOPage page); + public List getDicTypeByParentCode(String dicTypeCode); + + public List getDicTypeByDicTypeName(DicTypeEO dicTypeEO); + + public List getDicTypeEOTypeNameAndCode(@Param("id") String id, @Param("dicTypeName") String dicTypeName, @Param("dicTypeCode") String dicTypeCode, @Param("parentId") String parentId); + public List getDicTypeEOTypeNameAndCode1(@Param("id") String id, @Param("dicTypeName") String dicTypeName, @Param("dicTypeCode") String dicTypeCode, @Param("parentId") String parentId); + + // 标准法规属性管理中删除之前查看其它地方是否引用 + public List getDicTypeByDicTypeCode(String dicTypeCode); + + public List getDicEOByDicTypeCode(String dicTypeCode); + + public List getDicEOByDicTypeCodeParent(String dicTypeCode); + + public int deleteByDicIdAndDicTypeCode(DicTypeEO dicTypeEO); + + public int updateByDicTypeCode(DicTypeEO dicTypeEO); + + public int judgeHaveUse(@Param("sortCode") String sortCode, @Param("countryCode") String countryCode); + + public void deleteDicTypeByCodeAndParentid(List codes); + + public int deleteByDictionaryId(@Param("dicId") String dicId); + + public List getDicTypeByDicId(@Param("dicId") String dicId); + + public String getDicNamesByCodes(@Param("codeList") List codeList); + + public int insertSelective(DicTypeEO dictionaryEO); + + public int updateByPrimaryKeySelective(DicTypeEO dictionaryEO); + + public List queryByPage(DicTypeEOPage page); + + public int queryByCount(DicTypeEOPage page); + + public List queryByList(DicTypeEOPage page); +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/FeedbackInfoEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/FeedbackInfoEODao.java new file mode 100644 index 00000000..65f04ba4 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/FeedbackInfoEODao.java @@ -0,0 +1,25 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.FeedbackInfoEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** + * + *
+ * 功能:TS_FEEDBACK_INFO FeedbackInfoEODao
+ * 作者:code generator
+ * 日期: 2018-09-17
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface FeedbackInfoEODao extends BaseMapper { + + List queryByList(BasePage page); + + int queryByCount(BasePage var1); + + List queryByPage(BasePage page); + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/LinkInfoEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/LinkInfoEODao.java new file mode 100644 index 00000000..3e9c8d92 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/LinkInfoEODao.java @@ -0,0 +1,27 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.LinkInfoEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + *
+ * 功能:TS_LINK_INFO LinkInfoEODao
+ * 作者:code generator
+ * 日期: 2020-01-13
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface LinkInfoEODao extends BaseMapper { + + List queryByList(BasePage page); + + int queryByCount(BasePage page); + + List queryByPage(BasePage page); + + int deleteByIds(@Param("idList") List idList); +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/LoginInfoEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/LoginInfoEODao.java new file mode 100644 index 00000000..4221bff0 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/LoginInfoEODao.java @@ -0,0 +1,29 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.LoginInfoEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.Date; +import java.util.List; + +/** + * Created by Administrator on 2018/10/11 17:36 + */ +public interface LoginInfoEODao extends BaseMapper { + + List queryByList(BasePage page); + + int queryByCount(BasePage page); + + List queryByPage(BasePage page); + +// liwenxuan:系统用户访问数量 和 Top10 + List sysUserVisitCount(Date visitTime); + List sysUserVisitCountTop10(); + int count(); + + LoginInfoEO sysUserVisitCountByDate(LoginInfoEO loginInfoEO); + + int sysUserVisitCountByAll(LoginInfoEO loginInfoEO); +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/MenuEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/MenuEODao.java new file mode 100644 index 00000000..4852b16e --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/MenuEODao.java @@ -0,0 +1,75 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.MenuEO; +import com.adc.da.sys.page.MenuEOPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *
+ * 功能:TS_MENU MenuEODao
+ * 作者:code generator
+ * 日期: 2017-11-06
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface MenuEODao extends BaseMapper { + + List queryByList(BasePage page); + + int queryByCount(BasePage page); + + /** + * 获取所有的菜单 + * @return 所有菜单 + */ + List findAll(); + + /** + * 获取角色对应的所有菜单 + * @param roleId 角色ID + * @return 角色对应的所有菜单 + */ + List listMenuEOByRoleID(String roleId); + + /** + * 获取用户的所有菜单 + * @param userId 用户ID + * @return 用户的所有菜单 + */ + List listMenuEOByUserId(String userId); + + /** + * 获取当前节点的所有子节点 + * @param parentId 当前节点 + * @return 返回所有子节点 + */ + List getChildMenus(String parentId); + + /** + * 逻辑删除所有菜单 + * @param ids 菜单ID + */ + void deleteMenuLogic(String[] ids); + + /** + * 删除角色与当前菜单以及子菜单关系 + * @param ids + */ + void deleteRoleMenus(String[] ids); + + /** + * 判定菜单是否属于角色 + * @param roleId 角色ID + * @param menuId 菜单ID + * @return 如果>0说明存在记录,菜单属于角色 + */ + int isBelong(@Param("roleId") String roleId, @Param("menuId") String menuId); + + List selectPersonalByUserId(String userId); + + List queryByAllMenu(MenuEOPage page); + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/OrgEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/OrgEODao.java new file mode 100644 index 00000000..6a30117b --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/OrgEODao.java @@ -0,0 +1,162 @@ +package com.adc.da.sys.dao; + +import com.adc.da.sys.entity.OrgEO; +import com.adc.da.sys.entity.UserOrgEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.LinkedList; +import java.util.List; + + +public interface OrgEODao extends BaseMapper { + + public List listOrgEOByOrgName(@Param("orgName") String orgName); + + public OrgEO getOrgEOByNameAndPid(@Param("orgName") String orgName, @Param("pId") String pId); + + //liwenxuan:判断组织机构名称不重复 + public OrgEO getOrgEOByorgNameAndPidAndId(@Param("orgName") String orgName, @Param("pId") String pId, @Param("id") String id); + + //liwenxuan:判断组织机构简称不重复 + public OrgEO getOrgEOByShotNameAndPidAndId(@Param("shotName") String shotName, @Param("pId") String pId, @Param("id") String id); + + + public List getOrgEOByPid(@Param("pId") String pId); + + public OrgEO getOrgEOById(String id); + + public int deleteLogic(String id); + + //获取根节点, pid 和 CORP_ID 为 null + public LinkedList selectOrgAllNode(); + + List getChildDept(@Param("orgId") String orgId); + + public LinkedList selectRootNode(); + + public LinkedList selectNodeByPid(String id); + + public List queryByObject(OrgEO eo); + + public int delOrgRelatedUser(UserOrgEO userOrgEO); + + public int addOrgRelatedUsers(List userOrgEOs); + + public int delOrgRelatedUserByUserId(String usId); + + public int addOrgRelatedUser(UserOrgEO userOrgEO); + + public int updateUserOrg(UserOrgEO userOrgEO); + + public int deleteUserOrgByOrgId(String orgId); + /*** + * SSO查询组织机构 + * @MethodName:getOrgListOfSSO + * @author: zhangyanduan + * @param:[] + * @return:java.util.List + * date: 2018/10/16 19:18 + */ + public List getOrgListOfSSO(); + + /*** + * 从SSO添加组织机构 + * @MethodName:addOrgOfSSO + * @author: zhangyanduan + * @param:[orgEO] + * @return:void + * date: 2018/10/16 19:19 + */ + public void addOrgOfSSO(OrgEO orgEO); + + /*** + * SSO更新组织机构 + * @MethodName:updateOrgOfSSO + * @author: zhangyanduan + * @param:[orgEO] + * @return:void + * date: 2018/10/16 20:42 + */ + public void updateOrgOfSSO(OrgEO orgEO); + + /** + * @Author liwenxuan + * @Description //根据角色名称,查找该角色的用户(用于流程中心) + * @Date Administrator 2018/10/24 + * @Param [roleName] + * @return java.lang.String + **/ + public List getTreeByRole1(String roleName); + + /** + * @Author liwenxuan + * @Description //根据用户查找其组织结构,筛选出唯一的组织结构 + * @Date Administrator 2018/10/24 + * @Param + * @return + **/ + public List getTreeByRole2(String roleName); + + + // liwenxuan:1.查找该用户所在的组织结构,拿到parent_ids +// liwenxuan:2.根据第一步返回的parent_ids,和id 组成list ,使用in查询,筛选组织结构 +// liwenxuan:3.根据2中获取的组织结构id,和角色名称roleName删选用户 + public OrgEO getLeaderByUserId1(String usId); + public List getLeaderByUserId2(@Param("orgType") String orgType, @Param("parentIds") List parentIds); + public List getLeaderByUserId3(@Param("roleName") String roleName, @Param("id") String id); + + + // liwenxuan:根据orgId获取其所在的组织结构 + public List getTreeByRoleAndOrgId1(@Param("orgId") String orgId); + //liwenxuan:根据parentIds获取当前组织结构树分支 此parentIds中封装了id + public List getTreeByRoleAndOrgId2(@Param("ids") List ids); + // liwenxuan:使用mybatis的foreach标签,遍历list + public List getTreeByRoleAndOrgId3(@Param("roleName") String roleName, @Param("orgEOList") List orgEOList); + + List getManagerByOrgId(@Param("roleName") String roleName, @Param("orgId") String orgId); + + //根据orgType查询部及以上组织结构 + public List getIdsByorgType(); + /** + * @Author gaoyan + * @Description //根据不忙部门名称查询部门id + * @Date Administrator 2018/10/24 + * @Param + * @return + **/ + public List getIdByName(String orgName); + + //liwenxuan:1.根据orgId,roleId查看用户 + public List getLeaderByOrgIdAndRoleId(@Param("orgIds") List orgIds); + + //根据orgId查找所有组织结构 + public OrgEO getAllOrgbyOrgId(String orgId); + + // 根据orgIds查询下面的用户集合 + public List getLeaderByUserId4(@Param("id") List id); + + // 查找科级部门下的科级负责人,根据orgId和roleId确定是否有一个用户 + public OrgEO getHeadOfSection(@Param("orgId") String orgId, @Param("userId") String userId); + + // 查找部门下的部门负责人,根据orgId和roleId确定是否有一个用户 + public OrgEO getDepartmentHeads(@Param("orgId") String orgId, @Param("userId") String userId); + + // 根据SSOOrgId获取OrgEO对象 + public OrgEO getOrgInfoBySSOOrgId(String SSOOrgId); + + + public void updateOrgOfSSOById(OrgEO orgEO); + + List queryOrgByList(@Param("orgName") String orgName); + + List getTreeByRole3(String roleId); + + List getTreeByRole4(String roleId); + + public OrgEO getOrgInfoByOrgId(String OrgId); + + public OrgEO getOrgParentInfoOrgId(OrgEO orgEO); + + public List getOrgRootTree(); +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/RoleEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/RoleEODao.java new file mode 100644 index 00000000..ddd40b51 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/RoleEODao.java @@ -0,0 +1,86 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.RoleEO; +import com.adc.da.sys.entity.UserRoleEO; +import com.adc.da.sys.vo.RoleVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *
+ * 功能:TS_ROLE RoleEODao
+ * 作者:code generator
+ * 日期: 2017-11-06
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface RoleEODao extends BaseMapper { + + List queryByList(BasePage page); + + int queryByCount(BasePage page); + + List queryByPage(BasePage page); + + + public void save(RoleEO sysRoleEO); + + public RoleEO getRoleWithMenus(String id); + + public List getRoleListByUserId(String userId); + + public void deleteLogic(String roleId); + + public void deleteRoleMenuByRoleId(String roleId); + + public List findAll(RoleVO roleVO); + + /** + * 查询角色所对应的用户 + */ + public List getUserRoleListByRoleId(String roleId); + + public List getMenuIdListByRoleId(String roleId); + + public void saveRoleMenu(@Param("roleId") String roleId, @Param("menuId") String menuId); + + /** + * 判断角色是否属于相应用户 + */ + public int isBelong(@Param("userId") String userId, @Param("roleId") String roleId); + + public List findByUserId(String userId); + + /** + * 通过用户名查询所有用户信息 + */ + public List selectByNameAndId(@Param("id") String id, @Param("name") String name); + + /** + * @return + * @Author liwenxuan + * @Description //根据角色id判断此角色对应的用户数量 + * @Date Administrator 2018/11/5 + * @Param + **/ + public int countByRoleId(@Param("roleId") String roleId, @Param("userId") String userId); + /** + * @Author liwenxuan + * @Description //所在组织组织机构下科级负责人和部门负责人的个数 + * @Date Administrator 2018/11/5 + * @Param + * @return + **/ + /*public int countByOrgId(String orgId);*/ + +//查找部门负责人和科级负责人 + public int countByRoleIdOfDepartmentAndSection(String roleId); + //查找科级负责人 + public int querySectionCount(String roleId); + //查找部门负责人 + public int querySectionCount1(String roleId); + + public List selectIdByNames(@Param("nameList") List nameList); +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/RoleSarMenuEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/RoleSarMenuEODao.java new file mode 100644 index 00000000..14e934be --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/RoleSarMenuEODao.java @@ -0,0 +1,32 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.RoleSarMenuEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** + * + *
+ * 功能:TS_ROLE_SAR_MENU RoleSarMenuEODao
+ * 作者:code generator
+ * 日期: 2019-02-19
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface RoleSarMenuEODao extends BaseMapper { + + List queryByList(BasePage page); + + int queryByCount(BasePage page); + + List queryByPage(BasePage page); + + List findRoleSarMenu(String roleId); + + String queryBusinessStandRootId(String sorDivide); + + List selectSarMenuRoots(); + + int insertSubMenu(RoleSarMenuEO roleSarMenuEO); +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserConfigEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserConfigEODao.java new file mode 100644 index 00000000..2898b1a2 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserConfigEODao.java @@ -0,0 +1,27 @@ +package com.adc.da.sys.dao; + + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.LoginInfoEO; +import com.adc.da.sys.entity.UserConfigEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** + * + *
+ * 功能:TS_USER_CONFIG UserConfigEODao
+ * 作者:code generator
+ * 日期: 2018-09-03
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface UserConfigEODao extends BaseMapper { + + List queryByList(BasePage page); + + int queryByCount(BasePage page); + + List queryByPage(BasePage page); + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserEODao.java new file mode 100644 index 00000000..f47cf1c6 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserEODao.java @@ -0,0 +1,163 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.UserEO; +import com.adc.da.sys.page.UserEOPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + *
+ * 功能:TS_USER UserEODao
+ * 作者:code generator
+ * 日期: 2017-12-18
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface UserEODao extends BaseMapper { + + public void updatePassword(@Param("usid") String usid, @Param("oldPassword") String oldPassword, + @Param("newPassword") String newPassword); + + public void updateUserEO(UserEO userEO); + + public List getRoleIdListByUserId(Integer usid); + + public void saveUserRole(@Param("usid") String usid, @Param("roleId") String roleId); + + public void saveUserOrg(@Param("usid") String usid, @Param("orgId") String orgId); + + public int queryByCount(BasePage queryPage); + + public List queryByPage(BasePage queryPage); + + /*** + * 用户管理查询分页 + * @MethodName:queryUserInfoByCount + * @author: zhangyanduan + * @param:[basePage] + * @return:int + * date: 2018/9/15 15:59 + */ + public int queryUserInfoByCount(BasePage basePage); + + public List queryUserInfoByPage(BasePage basePage); + + /** + * 物理删除用户角色关联 + * + * @param usid + * 用户ID + */ + public void deleteUserRoleByUsid(String usid); + /** + * 物理删除用户组织机构关联 + * + * @param usid + * 用户ID + */ + public void deleteUserOrgByUsid(String usid); + + public int deleteLogicInBatch(List usids); + + /** + * 批量删除用户角色关联 + * + * @param usids + * 用户ID集合 + */ + public int deleteUserRoleByUsidInBatch(List usids); + + /** + * 批量删除用户组织机构关联 + * + * @param usids + * 用户ID集合 + */ + public int deleteUserOrgByUsidInBatch(List usids); + + public UserEO getUserEOByAccount(@Param("account") String account, @Param("usid") String usid); + + /** + * 查询用户及用户所对应的角色 + */ + public UserEO getUserWithRoles(String id); + + public UserEO getUserWithRolesAll(String id); + + public UserEO get(String id); + + /** + * 根据当前登录用户id查询个人信息及部门 + * @param usid + * @return + */ + UserEO selectOrgByPrimaryKey(String usid); + + Integer selectOrgCountByPrimaryKey(String usid); + + UserEO selectRoleMessageByPrimaryKey(String usid); + + public List queryByOrg(BasePage basePage); + + public UserEO selectByUnameAndPwd(UserEO userEO); + public int queryByOrgCount(BasePage basePage); + + public int updatePasswordByPrimaryKey(UserEO userEO); + + //liwenxuan:查找未分配组织结构的用户的行数 + public int findBySetOrgCount(BasePage basePage); + //liwenxuan:查询未分配组织机构人员信息 + public List findBySetOrg(BasePage basePage); + + List selectThatOrgUser(String orgId); + + String selectOrgByUserId(String userId); + + List queryUserEoList(UserEOPage page); + /*** + * 添加SSO来源用户 + * @MethodName:addSSOUser + * @author: zhangyanduan + * @param:[userEO] + * @return:void + * date: 2018/10/23 20:17 + */ + public void addSSOUser(UserEO userEO); + /*** + * 根据工号查询用户信息 + * @MethodName:selectUserByWorkNum + * @author: zhangyanduan + * @param:[workNum] + * @return:java.util.List + * date: 2018/10/25 16:20 + */ + public List selectUserByWorkNum(String workNum); + + /*** + * 根据对接ID获取用户信息 + * @MethodName:getUserBySSOId + * @author: DuYunbao + * @param:[ssoId] + * @return:com.adc.da.sys.entity.UserEO + * date: 2018/11/1 21:23 + */ + public List getUserBySSOId(String ssoId); + + public List getUserListByRoleName(String RoleName); +//根据角色id查询用户信息 + public List getUserListByUserId(String userId); + + public List getUserEOBySpecRole(@Param("orgId") String orgId, @Param("userId") String userId); + + public List selectAllUserInfoBySSO(); + + //根据用户id查部门id + public UserEO getOrgIdByUserId(String userId); + + public UserEO getUserEOByAccountNotDeleted(String account); + + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserInfoEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserInfoEODao.java new file mode 100644 index 00000000..10462c2e --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserInfoEODao.java @@ -0,0 +1,35 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.UserEO; +import com.adc.da.sys.entity.UserInfoEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** + * + *
+ * 功能:TS_USER_INFO UserInfoEODao
+ * 作者:code generator
+ * 日期: 2018-09-03
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface UserInfoEODao extends BaseMapper { + + List queryByList(BasePage page); + + int queryByCount(BasePage page); + + List queryByPage(BasePage page); + + + UserInfoEO getUserInfoByUserId(UserInfoEO userInfo); + + + int updateByUserId(UserInfoEO userId); + +// liwenxuan:修改用户详细信息 + int updateByPrimaryKey(UserInfoEO userInfoEO); + +} \ No newline at end of file diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserRoleEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserRoleEODao.java new file mode 100644 index 00000000..3548546e --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/UserRoleEODao.java @@ -0,0 +1,16 @@ +package com.adc.da.sys.dao; + +import com.adc.da.sys.entity.UserRoleEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * + *
+ * 功能:TR_USER_ROLE UserRoleEODao
+ * 作者:code generator
+ * 日期: 2017-11-07
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface UserRoleEODao extends BaseMapper { + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/dao/WarnTimeEODao.java b/adc-da-sys/src/main/java/com/adc/da/sys/dao/WarnTimeEODao.java new file mode 100644 index 00000000..df7f38bb --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/dao/WarnTimeEODao.java @@ -0,0 +1,23 @@ +package com.adc.da.sys.dao; + +import com.adc.da.base.page.BasePage; +import com.adc.da.sys.entity.WarnTimeEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** + * + *
+ * 功能:TS_WARN_TIME WarnTimeEODao
+ * 作者:code generator
+ * 日期: 2018-09-17
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public interface WarnTimeEODao extends BaseMapper { + List queryByList(BasePage page); + + int queryByCount(BasePage page); + + List queryByPage(BasePage page); +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/entity/DicTypeEO.java b/adc-da-sys/src/main/java/com/adc/da/sys/entity/DicTypeEO.java new file mode 100644 index 00000000..89485ad5 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/entity/DicTypeEO.java @@ -0,0 +1,236 @@ +package com.adc.da.sys.entity; + +import com.adc.da.base.entity.BaseEntity; + +import java.util.Date; + + +/** + * 功能:TS_DICTYPE DictypeEOEntity
+ * 作者:code generator
+ * 日期: 2018-09-03
+ * 版权所有:版权归北京卡达克数据技术中心所有。
+ */ +public class DicTypeEO extends BaseEntity { + + private Integer validFlag; + private String parentId; + private String dicTypeCode; + private String dicTypeName; + private String dicId; + private String id; + private String describes; + private Integer showIndex; + private String addCountrySortFlag; + +// 新增字段 + private Date creationTime; + private Date modifyTime; + + private String classifyCode; + private String classifyCodeId; + + //新增字段用于存储企业细类父ID + private String businessParentId; + private String treePid; + private String others; + private String creationUser; + + + /** + * java字段名转换为原始数据库列名。如果不存在则返回null
+ *

字段列表:

+ *
  • validFlag -> valid_flag
  • + *
  • parentId -> parent_id
  • + *
  • dicTypeCode -> dic_type_code
  • + *
  • dicTypeName -> dic_type_name
  • + *
  • dicId -> dic_id
  • + *
  • id -> id
  • + */ + public static String fieldToColumn(String fieldName) { + if (fieldName == null){ return null;} + switch (fieldName) { + case "showIndex": return "show_index"; + case "validFlag": return "valid_flag"; + case "parentId": return "parent_id"; + case "dicTypeCode": return "dic_type_code"; + case "dicTypeName": return "dic_type_name"; + case "dicId": return "dic_id"; + case "id": return "id"; + default: return null; + } + } + + /** + * 原始数据库列名转换为java字段名。如果不存在则返回null
    + *

    字段列表:

    + *
  • valid_flag -> validFlag
  • + *
  • parent_id -> parentId
  • + *
  • dic_type_code -> dicTypeCode
  • + *
  • dic_type_name -> dicTypeName
  • + *
  • dic_id -> dicId
  • + *
  • id -> id
  • + */ + public static String columnToField(String columnName) { + if (columnName == null){ return null;} + switch (columnName) { + case "show_index": return "showIndex"; + case "valid_flag": return "validFlag"; + case "parent_id": return "parentId"; + case "dic_type_code": return "dicTypeCode"; + case "dic_type_name": return "dicTypeName"; + case "dic_id": return "dicId"; + case "id": return "id"; + default: return null; + } + } + + /** **/ + public Integer getValidFlag() { + return this.validFlag; + } + + /** **/ + public void setValidFlag(Integer validFlag) { + this.validFlag = validFlag; + } + + /** **/ + public String getParentId() { + return this.parentId; + } + + /** **/ + public void setParentId(String parentId) { + this.parentId = parentId; + } + + /** **/ + public String getDicTypeCode() { + return this.dicTypeCode; + } + + /** **/ + public void setDicTypeCode(String dicTypeCode) { + this.dicTypeCode = dicTypeCode; + } + + /** **/ + public String getDicTypeName() { + return this.dicTypeName; + } + + /** **/ + public void setDicTypeName(String dicTypeName) { + this.dicTypeName = dicTypeName; + } + + /** **/ + public String getDicId() { + return this.dicId; + } + + /** **/ + public void setDicId(String dicId) { + this.dicId = dicId; + } + + /** **/ + public String getId() { + return this.id; + } + + /** **/ + public void setId(String id) { + this.id = id; + } + + + public Date getCreationTime() { + return creationTime; + } + + public void setCreationTime(Date creationTime) { + this.creationTime = creationTime; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public String getDescribes() { + return describes; + } + + public void setDescribes(String describes) { + this.describes = describes; + } + + public String getClassifyCode() { + return classifyCode; + } + + public void setClassifyCode(String classifyCode) { + this.classifyCode = classifyCode; + } + + public String getClassifyCodeId() { + return classifyCodeId; + } + + public void setClassifyCodeId(String classifyCodeId) { + this.classifyCodeId = classifyCodeId; + } + + public Integer getShowIndex() { + return showIndex; + } + + public void setShowIndex(Integer showIndex) { + this.showIndex = showIndex; + } + + public String getAddCountrySortFlag() { + return addCountrySortFlag; + } + + public void setAddCountrySortFlag(String addCountrySortFlag) { + this.addCountrySortFlag = addCountrySortFlag; + } + + public String getBusinessParentId() { + return businessParentId; + } + + public void setBusinessParentId(String businessParentId) { + this.businessParentId = businessParentId; + } + + public String getTreePid() { + return treePid; + } + + public void setTreePid(String treePid) { + this.treePid = treePid; + } + + public String getOthers() { + return others; + } + + public void setOthers(String others) { + this.others = others; + } + + public String getCreationUser() { + return creationUser; + } + + public void setCreationUser(String creationUser) { + this.creationUser = creationUser; + } +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/entity/DictionaryEO.java b/adc-da-sys/src/main/java/com/adc/da/sys/entity/DictionaryEO.java new file mode 100644 index 00000000..1eae4b23 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/entity/DictionaryEO.java @@ -0,0 +1,186 @@ +package com.adc.da.sys.entity; + +import com.adc.da.base.entity.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * 功能:TS_DICTIONARY DictionaryEOEntity
    + * 作者:code generator
    + * 日期: 2018-09-03
    + * 版权所有:版权归北京卡达克数据技术中心所有。
    + */ +public class DictionaryEO extends BaseEntity { + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date modifyTime; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date creationTime; + private String validFlag; + private String dictionaryName; + private String dictionaryCode; + private String id; + private Integer orderNum; + private String enable; + private String dictionType; + private String creationUser; + private String isRelate; + private String relateDicId; + + /** + * java字段名转换为原始数据库列名。如果不存在则返回null
    + *

    字段列表:

    + *
  • modifyTime -> modify_time
  • + *
  • creationTime -> creation_time
  • + *
  • validFlag -> valid_flag
  • + *
  • dictionarySeq -> dictionary_seq
  • + *
  • dictionaryName -> dictionary_name
  • + *
  • dictionaryCode -> dictionary_code
  • + *
  • id -> id
  • + */ + public static String fieldToColumn(String fieldName) { + if (fieldName == null){ return null;} + switch (fieldName) { + case "modifyTime": return "modify_time"; + case "creationTime": return "creation_time"; + case "validFlag": return "valid_flag"; + case "dictionarySeq": return "dictionary_seq"; + case "dictionaryName": return "dictionary_name"; + case "dictionaryCode": return "dictionary_code"; + case "id": return "id"; + default: return null; + } + } + + /** + * 原始数据库列名转换为java字段名。如果不存在则返回null
    + *

    字段列表:

    + *
  • modify_time -> modifyTime
  • + *
  • creation_time -> creationTime
  • + *
  • valid_flag -> validFlag
  • + *
  • dictionary_seq -> dictionarySeq
  • + *
  • dictionary_name -> dictionaryName
  • + *
  • dictionary_code -> dictionaryCode
  • + *
  • id -> id
  • + */ + public static String columnToField(String columnName) { + if (columnName == null){ return null;} + switch (columnName) { + case "modify_time": return "modifyTime"; + case "creation_time": return "creationTime"; + case "valid_flag": return "validFlag"; + case "dictionary_seq": return "dictionarySeq"; + case "dictionary_name": return "dictionaryName"; + case "dictionary_code": return "dictionaryCode"; + case "id": return "id"; + default: return null; + } + } + + /** **/ + public Date getModifyTime() { + return this.modifyTime; + } + + /** **/ + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + /** **/ + public Date getCreationTime() { + return this.creationTime; + } + + /** **/ + public void setCreationTime(Date creationTime) { + this.creationTime = creationTime; + } + + public String getValidFlag() { + return validFlag; + } + + public void setValidFlag(String validFlag) { + this.validFlag = validFlag; + } + + /** **/ + public String getDictionaryName() { + return this.dictionaryName; + } + + /** **/ + public void setDictionaryName(String dictionaryName) { + this.dictionaryName = dictionaryName; + } + + /** **/ + public String getDictionaryCode() { + return this.dictionaryCode; + } + + /** **/ + public void setDictionaryCode(String dictionaryCode) { + this.dictionaryCode = dictionaryCode; + } + + /** **/ + public String getId() { + return this.id; + } + + /** **/ + public void setId(String id) { + this.id = id; + } + + public Integer getOrderNum() { + return orderNum; + } + + public void setOrderNum(Integer orderNum) { + this.orderNum = orderNum; + } + + public String getEnable() { + return enable; + } + + public void setEnable(String enable) { + this.enable = enable; + } + + public String getDictionType() { + return dictionType; + } + + public void setDictionType(String dictionType) { + this.dictionType = dictionType; + } + + public String getCreationUser() { + return creationUser; + } + + public void setCreationUser(String creationUser) { + this.creationUser = creationUser; + } + + public String getIsRelate() { + return isRelate; + } + + public void setIsRelate(String isRelate) { + this.isRelate = isRelate; + } + + public String getRelateDicId() { + return relateDicId; + } + + public void setRelateDicId(String relateDicId) { + this.relateDicId = relateDicId; + } +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/page/DicTypeEOPage.java b/adc-da-sys/src/main/java/com/adc/da/sys/page/DicTypeEOPage.java new file mode 100644 index 00000000..d0c2aa42 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/page/DicTypeEOPage.java @@ -0,0 +1,149 @@ +package com.adc.da.sys.page; + +import com.adc.da.base.page.BasePage; + + +/** + * 功能:TS_DICTYPE DictypeEOPage
    + * 作者:code generator
    + * 日期: 2018-09-03
    + * 版权所有:版权归北京卡达克数据技术中心所有。
    + */ +public class DicTypeEOPage extends BasePage { + + private String validFlag; + private String validFlagOperator = "like"; + private String parentId; + private String parentIdOperator = "like"; + private String dicTypeCode; + private String dicTypeCodeOperator = "="; + private String dicTypeName; + private String dicTypeNameOperator = "like"; + private String dicId; + private String dicIdOperator = "like"; + private String id; + private String idOperator = "like"; + private String describes; + private String describesOperator = "like"; + private Integer showIndex; + + public String getValidFlag() { + return this.validFlag; + } + + public void setValidFlag(String validFlag) { + this.validFlag = validFlag; + } + + public String getValidFlagOperator() { + return this.validFlagOperator; + } + + public void setValidFlagOperator(String validFlagOperator) { + this.validFlagOperator = validFlagOperator; + } + + public String getParentId() { + return this.parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getParentIdOperator() { + return this.parentIdOperator; + } + + public void setParentIdOperator(String parentIdOperator) { + this.parentIdOperator = parentIdOperator; + } + + public String getDicTypeCode() { + return this.dicTypeCode; + } + + public void setDicTypeCode(String dicTypeCode) { + this.dicTypeCode = dicTypeCode; + } + + public String getDicTypeCodeOperator() { + return this.dicTypeCodeOperator; + } + + public void setDicTypeCodeOperator(String dicTypeCodeOperator) { + this.dicTypeCodeOperator = dicTypeCodeOperator; + } + + public String getDicTypeName() { + return this.dicTypeName; + } + + public void setDicTypeName(String dicTypeName) { + this.dicTypeName = dicTypeName; + } + + public String getDicTypeNameOperator() { + return this.dicTypeNameOperator; + } + + public void setDicTypeNameOperator(String dicTypeNameOperator) { + this.dicTypeNameOperator = dicTypeNameOperator; + } + + public String getDicId() { + return this.dicId; + } + + public void setDicId(String dicId) { + this.dicId = dicId; + } + + public String getDicIdOperator() { + return this.dicIdOperator; + } + + public void setDicIdOperator(String dicIdOperator) { + this.dicIdOperator = dicIdOperator; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOperator() { + return this.idOperator; + } + + public void setIdOperator(String idOperator) { + this.idOperator = idOperator; + } + + public String getDescribes() { + return describes; + } + + public void setDescribes(String describes) { + this.describes = describes; + } + + public String getDescribesOperator() { + return describesOperator; + } + + public void setDescribesOperator(String describesOperator) { + this.describesOperator = describesOperator; + } + + public Integer getShowIndex() { + return showIndex; + } + + public void setShowIndex(Integer showIndex) { + this.showIndex = showIndex; + } +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/page/DictionaryEOPage.java b/adc-da-sys/src/main/java/com/adc/da/sys/page/DictionaryEOPage.java new file mode 100644 index 00000000..d6bb4b30 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/page/DictionaryEOPage.java @@ -0,0 +1,185 @@ +package com.adc.da.sys.page; + + +import com.adc.da.base.page.BasePage; + +/** + * 功能:TS_DICTIONARY DictionaryEOPage
    + * 作者:code generator
    + * 日期: 2018-09-03
    + * 版权所有:版权归北京卡达克数据技术中心所有。
    + */ +public class DictionaryEOPage extends BasePage { + + private String modifyTime; + private String modifyTime1; + private String modifyTime2; + private String modifyTimeOperator = "="; + private String creationTime; + private String creationTime1; + private String creationTime2; + private String creationTimeOperator = "="; + private String validFlag; + private String validFlagOperator = "="; + private String dictionarySeq; + private String dictionarySeqOperator = "="; + private String dictionaryName; + private String dictionaryNameOperator = "="; + private String dictionaryCode; + private String dictionaryCodeOperator = "="; + private String id; + private String idOperator = "="; + private String notId; + + public String getModifyTime() { + return this.modifyTime; + } + + public void setModifyTime(String modifyTime) { + this.modifyTime = modifyTime; + } + + public String getModifyTime1() { + return this.modifyTime1; + } + + public void setModifyTime1(String modifyTime1) { + this.modifyTime1 = modifyTime1; + } + + public String getModifyTime2() { + return this.modifyTime2; + } + + public void setModifyTime2(String modifyTime2) { + this.modifyTime2 = modifyTime2; + } + + public String getModifyTimeOperator() { + return this.modifyTimeOperator; + } + + public void setModifyTimeOperator(String modifyTimeOperator) { + this.modifyTimeOperator = modifyTimeOperator; + } + + public String getCreationTime() { + return this.creationTime; + } + + public void setCreationTime(String creationTime) { + this.creationTime = creationTime; + } + + public String getCreationTime1() { + return this.creationTime1; + } + + public void setCreationTime1(String creationTime1) { + this.creationTime1 = creationTime1; + } + + public String getCreationTime2() { + return this.creationTime2; + } + + public void setCreationTime2(String creationTime2) { + this.creationTime2 = creationTime2; + } + + public String getCreationTimeOperator() { + return this.creationTimeOperator; + } + + public void setCreationTimeOperator(String creationTimeOperator) { + this.creationTimeOperator = creationTimeOperator; + } + + public String getValidFlag() { + return this.validFlag; + } + + public void setValidFlag(String validFlag) { + this.validFlag = validFlag; + } + + public String getValidFlagOperator() { + return this.validFlagOperator; + } + + public void setValidFlagOperator(String validFlagOperator) { + this.validFlagOperator = validFlagOperator; + } + + public String getDictionarySeq() { + return this.dictionarySeq; + } + + public void setDictionarySeq(String dictionarySeq) { + this.dictionarySeq = dictionarySeq; + } + + public String getDictionarySeqOperator() { + return this.dictionarySeqOperator; + } + + public void setDictionarySeqOperator(String dictionarySeqOperator) { + this.dictionarySeqOperator = dictionarySeqOperator; + } + + public String getDictionaryName() { + return this.dictionaryName; + } + + public void setDictionaryName(String dictionaryName) { + this.dictionaryName = dictionaryName; + } + + public String getDictionaryNameOperator() { + return this.dictionaryNameOperator; + } + + public void setDictionaryNameOperator(String dictionaryNameOperator) { + this.dictionaryNameOperator = dictionaryNameOperator; + } + + public String getDictionaryCode() { + return this.dictionaryCode; + } + + public void setDictionaryCode(String dictionaryCode) { + this.dictionaryCode = dictionaryCode; + } + + public String getDictionaryCodeOperator() { + return this.dictionaryCodeOperator; + } + + public void setDictionaryCodeOperator(String dictionaryCodeOperator) { + this.dictionaryCodeOperator = dictionaryCodeOperator; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOperator() { + return this.idOperator; + } + + public void setIdOperator(String idOperator) { + this.idOperator = idOperator; + } + + public String getNotId() { + return notId; + } + + public void setNotId(String notId) { + this.notId = notId; + } +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/page/MenuEOPage.java b/adc-da-sys/src/main/java/com/adc/da/sys/page/MenuEOPage.java new file mode 100644 index 00000000..60fbbba4 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/page/MenuEOPage.java @@ -0,0 +1,266 @@ +package com.adc.da.sys.page; + +import com.adc.da.base.page.BasePage; + +/** + * 功能:TS_MENU MenuEOPage
    + * 作者:code generator
    + * 日期: 2018-09-03
    + * 版权所有:版权归北京卡达克数据技术中心所有。
    + */ +public class MenuEOPage extends BasePage { + + private String modifyTime; + private String modifyTime1; + private String modifyTime2; + private String modifyTimeOperator = "="; + private String creationTime; + private String creationTime1; + private String creationTime2; + private String creationTimeOperator = "="; + private String validFlag; + private String validFlagOperator = "="; + private String remarks; + private String remarksOperator = "="; + private String permission; + private String permissionOperator = "="; + private String isShow; + private String isShowOperator = "="; + private String icon; + private String iconOperator = "="; + private String href; + private String hrefOperator = "="; + private String parentIds; + private String parentIdsOperator = "="; + private String parentId; + private String parentIdOperator = "="; + private String name; + private String nameOperator = "="; + private String id; + private String idOperator = "="; + + public String getModifyTime() { + return this.modifyTime; + } + + public void setModifyTime(String modifyTime) { + this.modifyTime = modifyTime; + } + + public String getModifyTime1() { + return this.modifyTime1; + } + + public void setModifyTime1(String modifyTime1) { + this.modifyTime1 = modifyTime1; + } + + public String getModifyTime2() { + return this.modifyTime2; + } + + public void setModifyTime2(String modifyTime2) { + this.modifyTime2 = modifyTime2; + } + + public String getModifyTimeOperator() { + return this.modifyTimeOperator; + } + + public void setModifyTimeOperator(String modifyTimeOperator) { + this.modifyTimeOperator = modifyTimeOperator; + } + + public String getCreationTime() { + return this.creationTime; + } + + public void setCreationTime(String creationTime) { + this.creationTime = creationTime; + } + + public String getCreationTime1() { + return this.creationTime1; + } + + public void setCreationTime1(String creationTime1) { + this.creationTime1 = creationTime1; + } + + public String getCreationTime2() { + return this.creationTime2; + } + + public void setCreationTime2(String creationTime2) { + this.creationTime2 = creationTime2; + } + + public String getCreationTimeOperator() { + return this.creationTimeOperator; + } + + public void setCreationTimeOperator(String creationTimeOperator) { + this.creationTimeOperator = creationTimeOperator; + } + + public String getValidFlag() { + return this.validFlag; + } + + public void setValidFlag(String validFlag) { + this.validFlag = validFlag; + } + + public String getValidFlagOperator() { + return this.validFlagOperator; + } + + public void setValidFlagOperator(String validFlagOperator) { + this.validFlagOperator = validFlagOperator; + } + + public String getRemarks() { + return this.remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getRemarksOperator() { + return this.remarksOperator; + } + + public void setRemarksOperator(String remarksOperator) { + this.remarksOperator = remarksOperator; + } + + public String getPermission() { + return this.permission; + } + + public void setPermission(String permission) { + this.permission = permission; + } + + public String getPermissionOperator() { + return this.permissionOperator; + } + + public void setPermissionOperator(String permissionOperator) { + this.permissionOperator = permissionOperator; + } + + public String getIsShow() { + return this.isShow; + } + + public void setIsShow(String isShow) { + this.isShow = isShow; + } + + public String getIsShowOperator() { + return this.isShowOperator; + } + + public void setIsShowOperator(String isShowOperator) { + this.isShowOperator = isShowOperator; + } + + public String getIcon() { + return this.icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getIconOperator() { + return this.iconOperator; + } + + public void setIconOperator(String iconOperator) { + this.iconOperator = iconOperator; + } + + public String getHref() { + return this.href; + } + + public void setHref(String href) { + this.href = href; + } + + public String getHrefOperator() { + return this.hrefOperator; + } + + public void setHrefOperator(String hrefOperator) { + this.hrefOperator = hrefOperator; + } + + public String getParentIds() { + return this.parentIds; + } + + public void setParentIds(String parentIds) { + this.parentIds = parentIds; + } + + public String getParentIdsOperator() { + return this.parentIdsOperator; + } + + public void setParentIdsOperator(String parentIdsOperator) { + this.parentIdsOperator = parentIdsOperator; + } + + public String getParentId() { + return this.parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getParentIdOperator() { + return this.parentIdOperator; + } + + public void setParentIdOperator(String parentIdOperator) { + this.parentIdOperator = parentIdOperator; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNameOperator() { + return this.nameOperator; + } + + public void setNameOperator(String nameOperator) { + this.nameOperator = nameOperator; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOperator() { + return this.idOperator; + } + + public void setIdOperator(String idOperator) { + this.idOperator = idOperator; + } + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/page/OrgEOPage.java b/adc-da-sys/src/main/java/com/adc/da/sys/page/OrgEOPage.java new file mode 100644 index 00000000..f00456b9 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/page/OrgEOPage.java @@ -0,0 +1,312 @@ +package com.adc.da.sys.page; + +import com.adc.da.base.page.BasePage; + +/** + * 功能:TS_ORG OrgEOPage
    + * 作者:code generator
    + * 日期: 2018-09-03
    + * 版权所有:版权归北京卡达克数据技术中心所有。
    + */ +public class OrgEOPage extends BasePage { + + private String modifyTime; + private String modifyTime1; + private String modifyTime2; + private String modifyTimeOperator = "like"; + private String creationTime; + private String creationTime1; + private String creationTime2; + private String creationTimeOperator = "like"; + private String validFlag; + private String validFlagOperator = "like"; + private String isShow; + private String isShowOperator = "like"; + private String parentIds; + private String parentIdsOperator = "like"; + private String parentId; + private String parentIdOperator = "like"; + private String shotName; + private String shotNameOperator = "like"; + private String remarks; + private String remarksOperator = "like"; + private String orgDesc; + private String orgDescOperator = "like"; + private String orgType; + private String orgTypeOperator = "like"; + private String orgCode; + private String orgCodeOperator = "like"; + private String orgName; + private String orgNameOperator = "like"; + private String id; + private String idOperator = "like"; + + private String orgId; + private String roleName; + + private String processFlag; + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getOrgId() { + return orgId; + } + + public void setOrgId(String orgId) { + this.orgId = orgId; + } + + public String getModifyTime() { + return this.modifyTime; + } + + public void setModifyTime(String modifyTime) { + this.modifyTime = modifyTime; + } + + public String getModifyTime1() { + return this.modifyTime1; + } + + public void setModifyTime1(String modifyTime1) { + this.modifyTime1 = modifyTime1; + } + + public String getModifyTime2() { + return this.modifyTime2; + } + + public void setModifyTime2(String modifyTime2) { + this.modifyTime2 = modifyTime2; + } + + public String getModifyTimeOperator() { + return this.modifyTimeOperator; + } + + public void setModifyTimeOperator(String modifyTimeOperator) { + this.modifyTimeOperator = modifyTimeOperator; + } + + public String getCreationTime() { + return this.creationTime; + } + + public void setCreationTime(String creationTime) { + this.creationTime = creationTime; + } + + public String getCreationTime1() { + return this.creationTime1; + } + + public void setCreationTime1(String creationTime1) { + this.creationTime1 = creationTime1; + } + + public String getCreationTime2() { + return this.creationTime2; + } + + public void setCreationTime2(String creationTime2) { + this.creationTime2 = creationTime2; + } + + public String getCreationTimeOperator() { + return this.creationTimeOperator; + } + + public void setCreationTimeOperator(String creationTimeOperator) { + this.creationTimeOperator = creationTimeOperator; + } + + public String getValidFlag() { + return this.validFlag; + } + + public void setValidFlag(String validFlag) { + this.validFlag = validFlag; + } + + public String getValidFlagOperator() { + return this.validFlagOperator; + } + + public void setValidFlagOperator(String validFlagOperator) { + this.validFlagOperator = validFlagOperator; + } + + public String getIsShow() { + return this.isShow; + } + + public void setIsShow(String isShow) { + this.isShow = isShow; + } + + public String getIsShowOperator() { + return this.isShowOperator; + } + + public void setIsShowOperator(String isShowOperator) { + this.isShowOperator = isShowOperator; + } + + public String getParentIds() { + return this.parentIds; + } + + public void setParentIds(String parentIds) { + this.parentIds = parentIds; + } + + public String getParentIdsOperator() { + return this.parentIdsOperator; + } + + public void setParentIdsOperator(String parentIdsOperator) { + this.parentIdsOperator = parentIdsOperator; + } + + public String getParentId() { + return this.parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getParentIdOperator() { + return this.parentIdOperator; + } + + public void setParentIdOperator(String parentIdOperator) { + this.parentIdOperator = parentIdOperator; + } + + public String getShotName() { + return this.shotName; + } + + public void setShotName(String shotName) { + this.shotName = shotName; + } + + public String getShotNameOperator() { + return this.shotNameOperator; + } + + public void setShotNameOperator(String shotNameOperator) { + this.shotNameOperator = shotNameOperator; + } + + public String getRemarks() { + return this.remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getRemarksOperator() { + return this.remarksOperator; + } + + public void setRemarksOperator(String remarksOperator) { + this.remarksOperator = remarksOperator; + } + + public String getOrgDesc() { + return this.orgDesc; + } + + public void setOrgDesc(String orgDesc) { + this.orgDesc = orgDesc; + } + + public String getOrgDescOperator() { + return this.orgDescOperator; + } + + public void setOrgDescOperator(String orgDescOperator) { + this.orgDescOperator = orgDescOperator; + } + + public String getOrgType() { + return this.orgType; + } + + public void setOrgType(String orgType) { + this.orgType = orgType; + } + + public String getOrgTypeOperator() { + return this.orgTypeOperator; + } + + public void setOrgTypeOperator(String orgTypeOperator) { + this.orgTypeOperator = orgTypeOperator; + } + + public String getOrgCode() { + return this.orgCode; + } + + public void setOrgCode(String orgCode) { + this.orgCode = orgCode; + } + + public String getOrgCodeOperator() { + return this.orgCodeOperator; + } + + public void setOrgCodeOperator(String orgCodeOperator) { + this.orgCodeOperator = orgCodeOperator; + } + + public String getOrgName() { + return this.orgName; + } + + public void setOrgName(String orgName) { + this.orgName = orgName; + } + + public String getOrgNameOperator() { + return this.orgNameOperator; + } + + public void setOrgNameOperator(String orgNameOperator) { + this.orgNameOperator = orgNameOperator; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOperator() { + return this.idOperator; + } + + public void setIdOperator(String idOperator) { + this.idOperator = idOperator; + } + + public String getProcessFlag() { + return processFlag; + } + + public void setProcessFlag(String processFlag) { + this.processFlag = processFlag; + } +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/page/OrgMenuEOPage.java b/adc-da-sys/src/main/java/com/adc/da/sys/page/OrgMenuEOPage.java new file mode 100644 index 00000000..f9f17b2c --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/page/OrgMenuEOPage.java @@ -0,0 +1,87 @@ +package com.adc.da.sys.page; + +import com.adc.da.base.page.BasePage; + + +/** + * 功能:TS_ORG_MENU OrgMenuEOPage
    + * 作者:code generator
    + * 日期: 2020-09-23
    + * 版权所有:版权归北京卡达克数据技术中心所有。
    + */ +public class OrgMenuEOPage extends BasePage { + + private String id; + private String idOperator = "="; + private String orgId; + private String orgIdOperator = "="; + private String orgRootId; + private String orgRootIdOperator = "="; + private String validFlag; + private String validFlagOperator = "="; + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdOperator() { + return this.idOperator; + } + + public void setIdOperator(String idOperator) { + this.idOperator = idOperator; + } + + public String getOrgId() { + return this.orgId; + } + + public void setOrgId(String orgId) { + this.orgId = orgId; + } + + public String getOrgIdOperator() { + return this.orgIdOperator; + } + + public void setOrgIdOperator(String orgIdOperator) { + this.orgIdOperator = orgIdOperator; + } + + public String getOrgRootId() { + return this.orgRootId; + } + + public void setOrgRootId(String orgRootId) { + this.orgRootId = orgRootId; + } + + public String getOrgRootIdOperator() { + return this.orgRootIdOperator; + } + + public void setOrgRootIdOperator(String orgRootIdOperator) { + this.orgRootIdOperator = orgRootIdOperator; + } + + public String getValidFlag() { + return this.validFlag; + } + + public void setValidFlag(String validFlag) { + this.validFlag = validFlag; + } + + public String getValidFlagOperator() { + return this.validFlagOperator; + } + + public void setValidFlagOperator(String validFlagOperator) { + this.validFlagOperator = validFlagOperator; + } + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/IDicEOService.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/IDicEOService.java new file mode 100644 index 00000000..9d9c693c --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/IDicEOService.java @@ -0,0 +1,52 @@ +package com.adc.da.sys.service; + +import com.adc.da.sys.common.SelectionResult; +import com.adc.da.sys.entity.DictionaryEO; +import com.adc.da.sys.page.DictionaryEOPage; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +public interface IDicEOService extends IService { + + public DictionaryEO getDictionaryEOById(String id); + + public DictionaryEO getDictionaryEOByDicCode(String dictionaryCode); + + public DictionaryEO getDicEOAndTypeEoByDicCode(String dictionaryCode); + + public DictionaryEO getDictionaryEOByDicName(String dictionaryName); + + public void deleteDic(String id); + + //gaoyan + public List getDictionaryEO(); + + public Integer countByCodeOrName(DictionaryEOPage page); + + public List queryAllDicByPage(DictionaryEOPage page); + + public Integer queryAllDicByCount(DictionaryEOPage page); + + public List getDictionarySelList(String id); + + public List getDictionaryCodeSelList(String id); + + public int queryUseByCount(String id); + + public int insertSelective(DictionaryEO dictionaryEO); + + public int updateByPrimaryKeySelective(DictionaryEO dictionaryEO); + + public List queryByPage(DictionaryEOPage page); + + public int queryByCount(DictionaryEOPage page); + + public List queryByList(DictionaryEOPage page); + + public String createDictionary(DictionaryEO dictionaryEO); + + public String updateDictionary(DictionaryEO dictionaryEO); + + public void deleteDicAndType(String id); +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/IDicTypeEOService.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/IDicTypeEOService.java new file mode 100644 index 00000000..f656c0f5 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/IDicTypeEOService.java @@ -0,0 +1,89 @@ +package com.adc.da.sys.service; + +import com.adc.da.sys.common.SelectionResult; +import com.adc.da.sys.entity.DicTypeEO; +import com.adc.da.sys.page.DicTypeEOPage; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + +public interface IDicTypeEOService extends IService { + + public DicTypeEO getDicTypeEOById(String id); + + public void deleteDicTypeByIdInBatch(List ids); + + public List getTypeIdByDicIdAndTypeName(String dicId, String id, String typeName, String parentId); + + + public List getDicTypeEOByDicTypeCode(String dicId, String id, String dicTypeCode, String parentId); + + public void batchInsertTypeEo(List ModelType); + + public void deleteDicTypeByDicId(String id); + + /** + * @Author yangxuenan + * @Description 根据数据字典编码查询字典类型 + * Date 2018/9/11 15:09 + * @Param [dictionaryCode] + * @return java.util.List + **/ + public List> getDicTypeByDicCode(String dictionaryCode); + + public List getFineDicTypeByDicCode(String dictionaryCode); + + //liwenxuan:国家地区新增 + public List queryByPageNoParentId(DicTypeEOPage page); + + public int queryByCountCounter(DicTypeEOPage page); + public List> getDicTypeByParentCode(String dicTypeCode); + + public List getDicTypeByDicTypeName(DicTypeEO dicTypeEO); + + public List getDicTypeEOTypeNameAndCode(String id, String dicTypeName, String dicTypeCode, String parentId); + public List getDicTypeEOTypeNameAndCode1(String id, String dicTypeName, String dicTypeCode, String parentId); + + // 标准法规属性管理中删除之前查看其它地方是否引用 + public boolean getDicTypeByDicTypeCode(String dicTypeCode); + + public List getDicEOByDicTypeCode(String dicTypeCode); + + public List getDicEOByDicTypeCodeParent(String dicTypeCode); + + public int deleteByDicIdAndDicTypeCode(DicTypeEO dicTypeEO); + + public int updateByDicTypeCode(DicTypeEO dicTypeEO); + + public boolean judgeHaveUse(String sortCode, String countryCode); + + public void deleteDicTypeByCodeAndParentid(List codes); + + public int deleteByDictionaryId(String dicId); + + public List getDicTypeByDicId(String dicId); + + public String getDicNamesByCodes(List codeList); + + public int insertSelective(DicTypeEO dictionaryEO); + + public int updateByPrimaryKeySelective(DicTypeEO dictionaryEO); + + public List queryByPage(DicTypeEOPage page); + + public int queryByCount(DicTypeEOPage page); + + public List queryByList(DicTypeEOPage page); + + public Integer saveDictype(DicTypeEO dicTypeEO); + + public DicTypeEO getDicTypeById(String id); + + public void delete(List ids); + + public Map getDicTypeListCode(); + + public List> getDicTypeByParentCodes(String dicTypeCode); + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/IRoleEOService.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/IRoleEOService.java index 0a183788..f233379d 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/service/IRoleEOService.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/IRoleEOService.java @@ -38,6 +38,6 @@ public interface IRoleEOService extends IService { public List selectByNameAndId(String id, String name); - + public List selectIdByNames(List nameList); } diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/IRoleSarMenuEOService.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/IRoleSarMenuEOService.java index b84df62a..23a2b64c 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/service/IRoleSarMenuEOService.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/IRoleSarMenuEOService.java @@ -18,6 +18,6 @@ public interface IRoleSarMenuEOService extends IService { public List selectSarMenuRoots(); - public int insertSubMenu (RoleSarMenuEO roleSarMenuEO); + public int insertSubMenu(RoleSarMenuEO roleSarMenuEO); } diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/IUserConfigEOService.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/IUserConfigEOService.java index 567b2af3..397c094b 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/service/IUserConfigEOService.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/IUserConfigEOService.java @@ -12,6 +12,6 @@ public interface IUserConfigEOService extends IService { public List queryByList(UserConfigEOPage page); - public int createPageConfig (String userId); + public int createPageConfig(String userId); } diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/DicEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/DicEOServiceImpl.java new file mode 100644 index 00000000..31f54ad0 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/DicEOServiceImpl.java @@ -0,0 +1,233 @@ +package com.adc.da.sys.service.impl; + +import com.adc.da.sys.common.SelectionResult; +import com.adc.da.sys.dao.DicEODao; +import com.adc.da.sys.entity.DictionaryEO; +import com.adc.da.sys.page.DictionaryEOPage; +import com.adc.da.sys.service.IDicEOService; +import com.adc.da.sys.service.IDicTypeEOService; +import com.adc.da.util.LoginUserUtil; +import com.adc.da.util.UUIDUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 新增数据字典属性 +* */ +@Service("dicEOService") +@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) +@Slf4j +public class DicEOServiceImpl extends ServiceImpl implements IDicEOService { + + private static final Logger logger = LoggerFactory.getLogger(DictionaryEO.class); + + @Autowired + private DicEODao dicEODao; + @Autowired + private IDicTypeEOService dicTypeEODao; + + public DicEODao getDao() { + return dicEODao; + } + + /** + * 查询字典详情 + */ + @Transactional(readOnly = true, rollbackFor = Exception.class) + public DictionaryEO getDictionaryById(String id) { + return dicEODao.getDictionaryEOById(id); + } + + @Transactional(readOnly = true, rollbackFor = Exception.class) + public DictionaryEO getDictionaryByDicCode(String dictionaryCode) { + return dicEODao.getDictionaryEOByDicCode(dictionaryCode); + } + + @Override + public DictionaryEO getDictionaryEOById(String id) { + return dicEODao.getDictionaryEOById(id); + } + + @Override + public DictionaryEO getDictionaryEOByDicCode(String dictionaryCode) { + return dicEODao.getDictionaryEOByDicCode(dictionaryCode); + } + + @Transactional(readOnly = true, rollbackFor = Exception.class) + public DictionaryEO getDicEOAndTypeEoByDicCode(String dictionaryCode) { + return dicEODao.getDicEOAndTypeEoByDicCode(dictionaryCode); + } + + @Override + public DictionaryEO getDictionaryEOByDicName(String dictionaryName) { + return dicEODao.getDictionaryEOByDicName(dictionaryName); + } + + @Override + public void deleteDic(String id) { + dicEODao.deleteDic(id); + } + + @Override + public List getDictionaryEO() { + return dicEODao.getDictionaryEO(); + } + + @Override + public Integer countByCodeOrName(DictionaryEOPage page) { + return dicEODao.countByCodeOrName(page); + } + + @Transactional(readOnly = true, rollbackFor = Exception.class) + public DictionaryEO getDictionaryByDicName(String dictionaryName) { + return dicEODao.getDictionaryEOByDicName(dictionaryName); + } + + //删除字典 + public void delete(String id) { + dicEODao.deleteDic(id); + } + + //删除字典 + public void deleteDicAndType(String id) { + dicEODao.deleteDic(id); + dicTypeEODao.deleteByDictionaryId(id); + } + + public int queryUseByCount(String id){ + return dicEODao.queryUseByCount(id); + } + + @Override + public int insertSelective(DictionaryEO dictionaryEO) { + return dicEODao.insertSelective(dictionaryEO); + } + + @Override + public int updateByPrimaryKeySelective(DictionaryEO dictionaryEO) { + return dicEODao.updateByPrimaryKeySelective(dictionaryEO); + } + + @Override + public List queryByPage(DictionaryEOPage page) { + Integer rowCount = dicEODao.queryByCount(page); + page.getPager().setRowCount(rowCount); + return dicEODao.queryByPage(page); + } + + @Override + public int queryByCount(DictionaryEOPage page) { + return dicEODao.queryByCount(page); + } + + @Override + public List queryByList(DictionaryEOPage page) { + return dicEODao.queryByList(page); + } + + /*** + * @Description: 新增数据字典 + * @Author: yangxuenan + * @Date: 2020/8/21 14:34 + * @Param: [dictionaryEO] + * @Return: int + */ + @Override + public String createDictionary(DictionaryEO dictionaryEO){ + // 验证编码是否存在 + DictionaryEOPage page = new DictionaryEOPage(); + page.setDictionaryCode(dictionaryEO.getDictionaryCode()); + int countCode = dicEODao.countByCodeOrName(page); + if (countCode > 0) { + return "数据字典编码已存在"; + } + // 验证 + page.setDictionaryCode(null); + page.setDictionaryName(dictionaryEO.getDictionaryName()); + int countName = dicEODao.countByCodeOrName(page); + if (countName > 0) { + return "数据字典名称已存在"; + } + dictionaryEO.setId(UUIDUtils.randomUUID20()); + dictionaryEO.setEnable("1"); + dictionaryEO.setValidFlag("0"); + dictionaryEO.setCreationUser(LoginUserUtil.getUserId()); + dictionaryEO.setCreationTime(new Date()); + dictionaryEO.setModifyTime(new Date()); + int countSuc = dicEODao.insertSelective(dictionaryEO); + if (countSuc > 0) { + return "success"; + } else { + return "error"; + } + } + + /*** + * @Description: 修改数据字典 + * @Author: yangxuenan + * @Date: 2020/8/21 15:42 + * @Param: [dictionaryEO] + * @Return: java.lang.String + */ + @Override + public String updateDictionary(DictionaryEO dictionaryEO){ + // 验证编码是否存在 + DictionaryEOPage page = new DictionaryEOPage(); + page.setNotId(dictionaryEO.getId()); + page.setDictionaryCode(dictionaryEO.getDictionaryCode()); + int countCode = dicEODao.countByCodeOrName(page); + if (countCode > 0) { + return "数据字典编码已存在"; + } + // 验证 + page.setDictionaryCode(null); + page.setDictionaryName(dictionaryEO.getDictionaryName()); + int countName = dicEODao.countByCodeOrName(page); + if (countName > 0) { + return "数据字典名称已存在"; + } + dictionaryEO.setModifyTime(new Date()); + int countSuc = dicEODao.updateByPrimaryKeySelective(dictionaryEO); + if (countSuc > 0) { + return "success"; + } else { + return "error"; + } + } + + public List queryAllDicByPage (DictionaryEOPage page) { + Integer rowCount = dicEODao.queryAllDicByCount(page); + page.getPager().setRowCount(rowCount); + return dicEODao.queryAllDicByPage(page); + } + + @Override + public Integer queryAllDicByCount(DictionaryEOPage page) { + return dicEODao.queryAllDicByCount(page); + } + + /*** + * @Description: 以下拉框格式查询所有类别 + * @Author: yangxuenan + * @Date: 2020/9/3 10:08 + * @Param: [id] + * @Return: java.util.List + */ + public List getDictionarySelList(String id){ + return dicEODao.getDictionarySelList(id); + } + + public List getDictionaryCodeSelList(String id){ + return dicEODao.getDictionaryCodeSelList(id); + } + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/DicTypeEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/DicTypeEOServiceImpl.java new file mode 100644 index 00000000..461e9da3 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/DicTypeEOServiceImpl.java @@ -0,0 +1,414 @@ +package com.adc.da.sys.service.impl; + +import com.adc.da.sys.common.SelectionResult; +import com.adc.da.sys.dao.DicEODao; +import com.adc.da.sys.dao.DicTypeEODao; +import com.adc.da.sys.entity.DicTypeEO; +import com.adc.da.sys.entity.DictionaryEO; +import com.adc.da.sys.page.DicTypeEOPage; +import com.adc.da.sys.service.IDicEOService; +import com.adc.da.sys.service.IDicTypeEOService; +import com.adc.da.util.LoginUserUtil; +import com.adc.da.util.UUIDUtils; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +@Service("dicTypeEOService") +@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) +public class DicTypeEOServiceImpl extends ServiceImpl implements IDicTypeEOService { + private + static final Logger logger = LoggerFactory.getLogger(DicTypeEO.class); + + @Autowired + private DicTypeEODao dicTypeEODao; + + @Autowired + private IDicEOService dicEODao; + + + + public DicTypeEODao getDao() { + return dicTypeEODao; + } +//李文轩:此方法对应的sql语句必须有parentId,不传入parentId就会报错 + public DicTypeEO saveDic(DicTypeEO dicTypeEO) { + + String parentId = dicTypeEO.getParentId(); + + dicTypeEO.setId(UUIDUtils.randomUUID20()); + dicTypeEO.setValidFlag(0); + + if(parentId!=null){ + dicTypeEO.setParentId(parentId); + } + + dicTypeEODao.insert(dicTypeEO); + return dicTypeEO; + } + + + /** + * 查询字典详情 + */ + @Transactional(readOnly = true, rollbackFor = Exception.class) + public DicTypeEO getDicTypeById(String id) { + return dicTypeEODao.getDicTypeEOById(id); + } + + @Override + public void delete(List ids) { + dicTypeEODao.deleteDicTypeByIdInBatch(ids); + } + + @Transactional(readOnly = true, rollbackFor = Exception.class) + public List getTypeIdByDicIdAndTypeName(String dicId, String id, String typeName, String parentId) { + return dicTypeEODao.getTypeIdByDicIdAndTypeName(dicId,id, typeName,parentId); + } + + @Transactional(readOnly = true, rollbackFor = Exception.class) + public List getDicTypeEOByDicTypeCode(String dicId, String id, String dicTypeCode, String parentId) { + return dicTypeEODao.getDicTypeEOByDicTypeCode(dicId,id,dicTypeCode,parentId); + } + + @Override + public void batchInsertTypeEo(List ModelType) { + dicTypeEODao.batchInsertTypeEo(ModelType); + } + + public void deleteDicTypeByDicId(String id) { + dicTypeEODao.deleteDicTypeByDicId(id); + } + + /** + * 新增数据字典参数表 + * */ + @Override + public Integer saveDictype(DicTypeEO dicTypeEO){ + // 此处存在问题, 当当前参数为标准类别时需要输入的code为name值 + if(StringUtils.isNotEmpty(dicTypeEO.getDicId()) && !"JKSADFH564S".equals(dicTypeEO.getDicId())){ + if(!StringUtils.isNotEmpty(dicTypeEO.getDicTypeCode())){ + dicTypeEO.setDicTypeCode(UUIDUtils.randomUUID10()); + } + } + String id = UUIDUtils.randomUUID20(); + dicTypeEO.setId(id); + dicTypeEO.setValidFlag(0); + dicTypeEO.setCreationTime(new Date()); + dicTypeEO.setModifyTime(new Date()); + dicTypeEO.setCreationUser(LoginUserUtil.getUserId()); + //加分类代号 + if (StringUtils.isNotEmpty(dicTypeEO.getClassifyCode())) { + DicTypeEO dicClassifyCode = new DicTypeEO(); + dicClassifyCode.setDicTypeName(dicTypeEO.getClassifyCode()); + dicClassifyCode.setDicId("YDWVSVOAQG"); + dicClassifyCode.setParentId(id); + dicClassifyCode.setId(UUIDUtils.randomUUID20()); + dicClassifyCode.setValidFlag(0); + dicClassifyCode.setCreationTime(new Date()); + dicClassifyCode.setModifyTime(new Date()); + dicClassifyCode.setCreationUser(LoginUserUtil.getUserId()); + dicClassifyCode.setDicTypeCode(UUIDUtils.randomUUID10()); + dicTypeEODao.insertSelective(dicClassifyCode); + } + return dicTypeEODao.insertSelective(dicTypeEO); + } + + /** + * @Author yangxuenan + * @Description 根据数据字典编码查询字典类型 + * Date 2018/9/12 10:18 + * @Param [dictionaryCode] + * @return java.util.List> + **/ + public List> getDicTypeByDicCode(String dictionaryCode){ + List getDicType = new ArrayList<>(); + if ("BUSSFINECLASSSHOW".equals(dictionaryCode)) { + getDicType = dicTypeEODao.getFineDicTypeByDicCode("BUSSFINECLASS"); + } else { + getDicType = dicTypeEODao.getDicTypeByDicCode(dictionaryCode); + } + List> listMap = new ArrayList<>(); + for(int i=0;i map = new HashMap<>(); + map.put("label",getDicType.get(i).getDicTypeName()); + map.put("value",getDicType.get(i).getDicTypeCode()); + // gaoyan 新增代码开始,关于企业细类需要查父节点,即企业大类 + if(dictionaryCode.equals("BUSSFINECLASS") && StringUtils.isNotEmpty(getDicType.get(i).getParentId())){ + DicTypeEO dicTypeEO = dicTypeEODao.getDicTypeEOById(getDicType.get(i).getParentId()); + map.put("parentCode",dicTypeEO.getDicTypeCode()); + } + // gaoyan 新增代码结束 + listMap.add(map); + } + return listMap; + } + + @Override + public List getFineDicTypeByDicCode(String dictionaryCode) { + return null; + } + + /** + * @Author gaoyan + * @Description + * Date 2018/9/11 19:12 + * @Param [dictionaryCode] + * @return java.util.List + **/ + @Override + public Map getDicTypeListCode(){ + Map resultMap = new HashMap<>(); + List diclist = dicEODao.getDictionaryEO(); + for (DictionaryEO dictionaryEO : diclist){ + List> relist = getDicTypeByDicCode(dictionaryEO.getDictionaryCode()); + resultMap.put(dictionaryEO.getDictionaryCode(),relist); + } + // 查询细类 + List> relist = getDicTypeByDicCode("BUSSFINECLASSSHOW"); + resultMap.put("BUSSFINECLASSSHOW",relist); + List> arr = new ArrayList<>(); + resultMap.put("STANDCLASSIFYSHOW",arr); + return resultMap; + } + + //liwenxuan:国家地区新增 + public List queryByPageNoParentId(DicTypeEOPage page){ + Integer rowCount = dicTypeEODao.queryByCountCounter(page); + page.getPager().setRowCount(rowCount); + return dicTypeEODao.queryByPageNoParentId(page); + } + + @Override + public int queryByCountCounter(DicTypeEOPage page) { + return 0; + } + + /** + * @Author yangxuenan + * @Description 根据父级code查询 + * Date 2018/10/9 14:08 + * @Param [dicTypeCode] + * @return java.util.List> + **/ + @Transactional(rollbackFor = Exception.class) + public List> getDicTypeByParentCode(String dicTypeCode){ + List getDicType = dicTypeEODao.getDicTypeByParentCode(dicTypeCode); + List> listMap = new ArrayList<>(); + for(int i=0;i map = new HashMap<>(); + map.put("label",getDicType.get(i).getDicTypeName()); + map.put("value",getDicType.get(i).getDicTypeCode()); + listMap.add(map); + } + return listMap; + } + + /** + * @Author yangxuenan + * @Description 传递多个code值 + * Date 2019/1/2 16:38 + * @Param [dicTypeCode] + * @return java.util.List> + **/ + public List> getDicTypeByParentCodes(String dicTypeCode){ + String codes[] = dicTypeCode.split(","); + List> listMap = new ArrayList<>(); + if (codes != null && codes.length>0) { + for(int i=0;i getDicType = dicTypeEODao.getDicTypeByParentCode(codes[i]); + for(int x=0;x map = new HashMap<>(); + map.put("label",getDicType.get(x).getDicTypeName()); + map.put("value",getDicType.get(x).getDicTypeCode()); + if (!listMap.contains(map)) { + listMap.add(map); + } + } + } + } + + return listMap; + } + + /** + * @Author liwenxuan + * @Description 用来企业大类判断新增是否重复 + * @Date Administrator 2018/10/17 + * @Param [id, dicypeName, dicTypeCode] + * @return java.util.List + **/ + public List getDicTypeEOTypeNameAndCode(String id, String dicTypeName, String dicTypeCode, String parentId){ + return dicTypeEODao.getDicTypeEOTypeNameAndCode(id,dicTypeName,dicTypeCode,parentId); + } + + /** + * @Author liwenxuan + * @Description 用来企业大类判断新增是否重复 + * @Date Administrator 2018/10/17 + * @Param [id, dicypeName, dicTypeCode] + * @return java.util.List + **/ + public List getDicTypeEOTypeNameAndCode1(String id, String dicTypeName, String dicTypeCode, String parentId){ + return dicTypeEODao.getDicTypeEOTypeNameAndCode1(id,dicTypeName,dicTypeCode,parentId); + } + + // 标准法规属性管理中删除之前查看其它地方是否引用 + @Transactional(rollbackFor = Exception.class) + public boolean getDicTypeByDicTypeCode(String dicTypeCode){ + List dicTypeByDicTypeCode = dicTypeEODao.getDicTypeByDicTypeCode(dicTypeCode); + for (int count: dicTypeByDicTypeCode) { + if(count > 0){ + return false; + } + } + return true; + } + + @Override + public List getDicTypeByDicTypeName(DicTypeEO dicTypeEO){ + return dicTypeEODao.getDicTypeByDicTypeName(dicTypeEO); + } + + public DicTypeEO getDicTypeEOById(String id){ + return dicTypeEODao.getDicTypeEOById(id); + } + + @Override + public void deleteDicTypeByIdInBatch(List ids) { + dicTypeEODao.deleteDicTypeByIdInBatch(ids); + } + + public int deleteByDicIdAndDicTypeCode(DicTypeEO dicTypeEO){ + return dicTypeEODao.deleteByDicIdAndDicTypeCode(dicTypeEO); + } + + public List getDicEOByDicTypeCode(String dicTypeCode){ + return dicTypeEODao.getDicEOByDicTypeCode(dicTypeCode); + } + + + public void judgeAndUpdateDictype(List dicTypeEOList){ + List samecodeid = new ArrayList<>(); + List sameEntercodeid = new ArrayList<>(); + for(DicTypeEO dicTypeEO:dicTypeEOList){ + // 通过id判断,如果相同不做处理 + DicTypeEO dicEO = dicTypeEODao.getDicTypeEOById(dicTypeEO.getId()); + if (null == dicEO) { + if (StringUtils.isNotEmpty(dicTypeEO.getParentId()) && !"".equals(dicTypeEO.getParentId())){ + // 有父id,是标准类别,进行特殊处理 + for (DicTypeEO dicTypeJue:dicTypeEOList){ + if (dicTypeJue.getId().equals(dicTypeEO.getParentId())){ + DicTypeEOPage dicTypeEOPage = new DicTypeEOPage(); + dicTypeEOPage.setDicTypeCode(dicTypeEO.getDicTypeCode()); + if(samecodeid.contains(dicTypeEO.getParentId())){ + dicTypeEOPage.setParentId(sameEntercodeid.get(samecodeid.indexOf(dicTypeEO.getParentId()))); + dicTypeEO.setParentId(sameEntercodeid.get(samecodeid.indexOf(dicTypeEO.getParentId()))); + } else { + dicTypeEOPage.setParentId(dicTypeEO.getParentId()); + } + dicTypeEOPage.setValidFlag("0"); + List codelist = dicTypeEODao.queryByList(dicTypeEOPage); + if (codelist == null || codelist.size()==0){ + // 判断name 值是否相同,如果相同 ,加标记 + dicTypeEO.setDescribes("同步云端属性"); + dicTypeEODao.insertSelective(dicTypeEO); + } + break; + } + } + } else { + // 通过code去判断,并且parentid是空的数据,如果没有数据进行添加 + List codelist = dicTypeEODao.getDicEOByDicTypeCodeParent(dicTypeEO.getDicTypeCode()); + if (codelist == null || codelist.size()==0){ + // 判断name 值是否相同,如果相同 ,加标记 + dicTypeEO.setDescribes("同步云端属性"); + dicTypeEODao.insertSelective(dicTypeEO); + } else { + // 如果相同,记录id, + samecodeid.add(dicTypeEO.getId()); + sameEntercodeid.add(codelist.get(0).getId()); + } + } + } else { + // 执行修改语句 + DicTypeEO dicTypeEOUpdate = new DicTypeEO(); + dicTypeEOUpdate.setId(dicTypeEO.getId()); + dicTypeEOUpdate.setDicTypeName(dicTypeEO.getDicTypeName()); + dicTypeEOUpdate.setShowIndex(dicTypeEO.getShowIndex()); + dicTypeEOUpdate.setDescribes("同步云端属性"); + dicTypeEOUpdate.setValidFlag(0); + dicTypeEODao.updateByPrimaryKeySelective(dicTypeEOUpdate); + } + } + } + + @Transactional(rollbackFor = Exception.class) + public boolean judgeHaveUse(String sortCode,String countryCode){ + Integer dicTypeByDicTypeCode = dicTypeEODao.judgeHaveUse(sortCode,countryCode); + if (dicTypeByDicTypeCode != null && dicTypeByDicTypeCode>0){ + return false; + } + return true; + } + + public int updateByDicTypeCode(DicTypeEO dicTypeEO){ + return dicTypeEODao.updateByDicTypeCode(dicTypeEO); + } + + public List getDicEOByDicTypeCodeParent(String dicTypeCode){ + return dicTypeEODao.getDicEOByDicTypeCodeParent(dicTypeCode); + } + public void deleteDicTypeByCodeAndParentid(List codes) { + dicTypeEODao.deleteDicTypeByCodeAndParentid(codes); + } + + @Override + public int deleteByDictionaryId(String dicId) { + return dicTypeEODao.deleteByDictionaryId(dicId); + } + + public List getDicTypeByDicId(String dicId){ + return dicTypeEODao.getDicTypeByDicId(dicId); + } + + @Override + public String getDicNamesByCodes(List codeList) { + return dicTypeEODao.getDicNamesByCodes(codeList); + } + + @Override + public int insertSelective(DicTypeEO dictionaryEO) { + return dicTypeEODao.insertSelective(dictionaryEO); + } + + @Override + public int updateByPrimaryKeySelective(DicTypeEO dictionaryEO) { + return dicTypeEODao.updateByPrimaryKeySelective(dictionaryEO); + } + + @Override + public List queryByPage(DicTypeEOPage page) { + Integer rowCount = dicTypeEODao.queryByCount(page); + page.getPager().setRowCount(rowCount); + return dicTypeEODao.queryByPage(page); + } + + @Override + public int queryByCount(DicTypeEOPage page) { + return dicTypeEODao.queryByCount(page); + } + + @Override + public List queryByList(DicTypeEOPage page) { + return dicTypeEODao.queryByList(page); + } + +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/MenuEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/MenuEOServiceImpl.java index 0664f328..78b13cb5 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/MenuEOServiceImpl.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/MenuEOServiceImpl.java @@ -3,7 +3,7 @@ package com.adc.da.sys.service.impl; import cn.hutool.core.bean.BeanUtil; import com.adc.da.base.entity.TreeEntity; import com.adc.da.base.page.BasePage; -import com.adc.da.common.ValidFlagEnum; +import com.adc.da.sys.constant.ValidFlagEnum; import com.adc.da.sys.dao.MenuEODao; import com.adc.da.sys.entity.MenuEO; import com.adc.da.sys.page.MenuEOPage; diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/OrgEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/OrgEOServiceImpl.java index d875b440..04328068 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/OrgEOServiceImpl.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/OrgEOServiceImpl.java @@ -1,8 +1,8 @@ package com.adc.da.sys.service.impl; -import com.adc.da.common.ValidFlagEnum; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; +import com.adc.da.sys.constant.ValidFlagEnum; import com.adc.da.sys.dao.OrgEODao; import com.adc.da.sys.entity.OrgEO; import com.adc.da.sys.entity.UserEO; diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/RoleEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/RoleEOServiceImpl.java index 4c545a17..fc93f7d2 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/RoleEOServiceImpl.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/RoleEOServiceImpl.java @@ -1,7 +1,7 @@ package com.adc.da.sys.service.impl; import com.adc.da.base.page.BasePage; -import com.adc.da.common.ValidFlagEnum; +import com.adc.da.sys.constant.ValidFlagEnum; import com.adc.da.sys.dao.RoleEODao; import com.adc.da.sys.entity.RoleEO; import com.adc.da.sys.entity.UserRoleEO; @@ -179,4 +179,9 @@ public class RoleEOServiceImpl extends ServiceImpl implements public List selectByNameAndId(String id, String name){ return this.baseMapper.selectByNameAndId(id,name); } + + @Override + public List selectIdByNames(List nameList) { + return this.baseMapper.selectIdByNames(nameList); + } } diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/UserEOServiceImpl.java b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/UserEOServiceImpl.java index 2008c0c1..2de11b97 100644 --- a/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/UserEOServiceImpl.java +++ b/adc-da-sys/src/main/java/com/adc/da/sys/service/impl/UserEOServiceImpl.java @@ -1,10 +1,10 @@ package com.adc.da.sys.service.impl; import com.adc.da.base.page.BasePage; -import com.adc.da.common.ValidFlagEnum; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; import com.adc.da.sys.constant.UserSourceEnum; +import com.adc.da.sys.constant.ValidFlagEnum; import com.adc.da.sys.dao.OrgEODao; import com.adc.da.sys.dao.UserEODao; import com.adc.da.sys.dao.UserInfoEODao; diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/vo/DicTypeVO.java b/adc-da-sys/src/main/java/com/adc/da/sys/vo/DicTypeVO.java new file mode 100644 index 00000000..abe8d354 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/vo/DicTypeVO.java @@ -0,0 +1,122 @@ +package com.adc.da.sys.vo; + +import java.util.Date; + +public class DicTypeVO { + private String id; + private String dicTypeCode; + private String dicTypeName; + private String dicId; + private Integer validFlag; + private String parentId; + private Date creationTime; + private Date modifyTime; + private String describes; + private Integer showIndex; + + private String classifyCode; + private String classifyCodeId; + private String addCountrySortFlag; + + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getDicTypeCode() { + return dicTypeCode; + } + public void setDicTypeCode(String dicTypeCode) { + this.dicTypeCode = dicTypeCode; + } + + public String getDicTypeName() { + return dicTypeName; + } + public void setDicTypeName(String dicTypeName) { + this.dicTypeName = dicTypeName; + } + + public String getDicId() { + return dicId; + } + + public void setDicId(String dicId) { + this.dicId = dicId; + } + + public Integer getValidFlag() { + return validFlag; + } + + public void setValidFlag(Integer validFlag) { + this.validFlag = validFlag; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public Date getCreationTime() { + return creationTime; + } + + public void setCreationTime(Date creationTime) { + this.creationTime = creationTime; + } + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public String getDescribes() { + return describes; + } + + public void setDescribes(String describes) { + this.describes = describes; + } + + public String getClassifyCode() { + return classifyCode; + } + + public void setClassifyCode(String classifyCode) { + this.classifyCode = classifyCode; + } + + public String getClassifyCodeId() { + return classifyCodeId; + } + + public void setClassifyCodeId(String classifyCodeId) { + this.classifyCodeId = classifyCodeId; + } + + public Integer getShowIndex() { + return showIndex; + } + + public void setShowIndex(Integer showIndex) { + this.showIndex = showIndex; + } + + public String getAddCountrySortFlag() { + return addCountrySortFlag; + } + + public void setAddCountrySortFlag(String addCountrySortFlag) { + this.addCountrySortFlag = addCountrySortFlag; + } +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/vo/OrgVO.java b/adc-da-sys/src/main/java/com/adc/da/sys/vo/OrgVO.java new file mode 100644 index 00000000..245b2424 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/vo/OrgVO.java @@ -0,0 +1,111 @@ +package com.adc.da.sys.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class OrgVO extends TreeVO{ + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date modifyTime; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date creationTime; + private Integer validFlag; + private Integer isShow; + private String pId; + private String shotName; + private String remarks; + private Integer orgDesc; + private String orgType; + private String orgCode; + private String orgName; + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Date getCreationTime() { + return creationTime; + } + + public void setCreationTime(Date creationTime) { + this.creationTime = creationTime; + } + + public Integer getValidFlag() { + return validFlag; + } + + public void setValidFlag(Integer validFlag) { + this.validFlag = validFlag; + } + + public Integer getIsShow() { + return isShow; + } + + public void setIsShow(Integer isShow) { + this.isShow = isShow; + } + + public String getShotName() { + return shotName; + } + + public void setShotName(String shotName) { + this.shotName = shotName; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public Integer getOrgDesc() { + return orgDesc; + } + + public void setOrgDesc(Integer orgDesc) { + this.orgDesc = orgDesc; + } + + public String getOrgType() { + return orgType; + } + + public void setOrgType(String orgType) { + this.orgType = orgType; + } + + public String getOrgCode() { + return orgCode; + } + + public void setOrgCode(String orgCode) { + this.orgCode = orgCode; + } + + public String getOrgName() { + return orgName; + } + + public void setOrgName(String orgName) { + this.orgName = orgName; + } + + + public String getpId() { + return pId; + } + + public void setpId(String pId) { + this.pId = pId; + } +} diff --git a/adc-da-sys/src/main/java/com/adc/da/sys/vo/RoleVO.java b/adc-da-sys/src/main/java/com/adc/da/sys/vo/RoleVO.java new file mode 100644 index 00000000..8bdbf8b8 --- /dev/null +++ b/adc-da-sys/src/main/java/com/adc/da/sys/vo/RoleVO.java @@ -0,0 +1,209 @@ +package com.adc.da.sys.vo; + +import com.adc.da.sys.entity.MenuEO; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class RoleVO { + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date modifyTime; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date creationTime; + private Integer validFlag; + private String operUser; + private String extInfo; + private String remarks; + private Integer isDefault; + private Integer useFlag; + private String roleType; + private String name; + //新添字段 + private String oprUser; + private String operUserName; + + + // 扩展字段 + private List menus = new ArrayList<>(); + private List menusstr = new ArrayList<>(); + private String rid; + private Integer belong; + private String rname; + private String rdesc; + private String enabled; + + private String id; + private String roleIds; + + public Date getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + public Date getCreationTime() { + return creationTime; + } + + public void setCreationTime(Date creationTime) { + this.creationTime = creationTime; + } + + public Integer getValidFlag() { + return validFlag; + } + + public void setValidFlag(Integer validFlag) { + this.validFlag = validFlag; + } + + public String getOperUser() { + return operUser; + } + + public void setOperUser(String operUser) { + this.operUser = operUser; + } + + public String getExtInfo() { + return extInfo; + } + + public void setExtInfo(String extInfo) { + this.extInfo = extInfo; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public Integer getIsDefault() { + return isDefault; + } + + public void setIsDefault(Integer isDefault) { + this.isDefault = isDefault; + } + + public Integer getUseFlag() { + return useFlag; + } + + public void setUseFlag(Integer useFlag) { + this.useFlag = useFlag; + } + + public String getRoleType() { + return roleType; + } + + public void setRoleType(String roleType) { + this.roleType = roleType; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + + public String getOprUser() { + return oprUser; + } + + public void setOprUser(String oprUser) { + this.oprUser = oprUser; + } + + public String getOperUserName() { + return operUserName; + } + + public void setOperUserName(String operUserName) { + this.operUserName = operUserName; + } + + public List getMenus() { + return menus; + } + + public void setMenus(List menus) { + this.menus = menus; + } + + public List getMenusstr() { + return menusstr; + } + + public void setMenusstr(List menusstr) { + this.menusstr = menusstr; + } + + public String getRid() { + return rid; + } + + public void setRid(String rid) { + this.rid = rid; + } + + public Integer getBelong() { + return belong; + } + + public void setBelong(Integer belong) { + this.belong = belong; + } + + public String getRname() { + return rname; + } + + public void setRname(String rname) { + this.rname = rname; + } + + public String getRdesc() { + return rdesc; + } + + public void setRdesc(String rdesc) { + this.rdesc = rdesc; + } + + public String getEnabled() { + return enabled; + } + + public void setEnabled(String enabled) { + this.enabled = enabled; + } + + public void setId(String id){ + this.id=id; + } + + public String getId(){ + return this.id; + } + + public String getRoleIds() { + return roleIds; + } + + public void setRoleIds(String roleIds) { + this.roleIds = roleIds; + } +} diff --git a/adc-da-sys/src/main/java/com/adc/da/websocket/service/WebSocketServer.java b/adc-da-sys/src/main/java/com/adc/da/websocket/service/WebSocketServer.java index bc03304b..4213a6f3 100644 --- a/adc-da-sys/src/main/java/com/adc/da/websocket/service/WebSocketServer.java +++ b/adc-da-sys/src/main/java/com/adc/da/websocket/service/WebSocketServer.java @@ -31,7 +31,7 @@ public interface WebSocketServer { * @param session session 对象 * @param throwable 抛出的异常 */ - public void onError(Session session,Throwable throwable); + public void onError(Session session, Throwable throwable); /** * 向单个客户端发送消息 @@ -48,7 +48,7 @@ public interface WebSocketServer { * @return:void * date: 2018/12/17 15:04 */ - public void sendMessageOfUserList(List userList,WebSocketMessage message); + public void sendMessageOfUserList(List userList, WebSocketMessage message); /** * 向所有在线用户群发消息 diff --git a/adc-da-sys/src/main/resources/mybatis/mapper/person/PersonCollectEOMapper.xml b/adc-da-sys/src/main/resources/mybatis/mapper/person/PersonCollectEOMapper.xml index e0084ffb..b02a17d2 100644 --- a/adc-da-sys/src/main/resources/mybatis/mapper/person/PersonCollectEOMapper.xml +++ b/adc-da-sys/src/main/resources/mybatis/mapper/person/PersonCollectEOMapper.xml @@ -373,4 +373,10 @@ + + update TS_PERSON_COLLECT + set valid_flag=1 + where collect_res_id = #{resId} + + diff --git a/adc-da-sys/src/main/resources/mybatis/mapper/person/PersonShareEOMapper.xml b/adc-da-sys/src/main/resources/mybatis/mapper/person/PersonShareEOMapper.xml index 42d27738..5e45ff5c 100644 --- a/adc-da-sys/src/main/resources/mybatis/mapper/person/PersonShareEOMapper.xml +++ b/adc-da-sys/src/main/resources/mybatis/mapper/person/PersonShareEOMapper.xml @@ -240,4 +240,10 @@ + + + update TS_PERSON_SHARE + set valid_flag=1 + where res_id = #{resId} + diff --git a/adc-da-sys/src/main/resources/mybatis/mapper/sys/DicTypeEOMapper.xml b/adc-da-sys/src/main/resources/mybatis/mapper/sys/DicTypeEOMapper.xml new file mode 100644 index 00000000..e332bd74 --- /dev/null +++ b/adc-da-sys/src/main/resources/mybatis/mapper/sys/DicTypeEOMapper.xml @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + creation_time, modify_time,id,parent_id, dic_type_code, dic_type_name, dic_id,valid_flag,show_index, tree_pid, others, creation_user, describes + + + + + TS_DICTYPE.id,TS_DICTYPE.parent_id, TS_DICTYPE.dic_type_code, TS_DICTYPE.dic_type_name, TS_DICTYPE.dic_id, + TS_DICTYPE.valid_flag,TS_DICTYPE.creation_time,TS_DICTYPE.modify_time,TS_DICTYPE.describes,TS_DICTYPE.show_index,tree_pid + + + + + a.id,a.parent_id, a.dic_type_code, a.dic_type_name, a.dic_id,a.valid_flag,a.creation_time,a.modify_time,a.describes,a.show_index + + + + u.*, ur.id as type_id, + ur.dic_type_code as dic_type_code, + ur.dic_type_name as dic_type_name, + ur.dic_id as dic_id, + ur.parent_id as parent_id, + ur.valid_flag as type_valid_flag + + + + + where valid_flag = 0 + + + and id ${idOperator} #{id} + + + and dic_id ${dicIdOperator} #{dicId} + + + and dic_type_name ${dicTypeNameOperator} concat(concat('%',#{dicTypeName}),'%') + + + and dic_type_code ${dicTypeCodeOperator} concat(concat('%',#{dicTypeCode}),'%') + + + and valid_flag ${validFlagOperator} #{validFlag} + + + and parent_id ${parentIdOperator} #{parentId} + + + + + + where valid_flag = 0 + + + and id ${idOperator} #{id} + + + and dic_id ${dicIdOperator} #{dicId} + + + and dic_type_name = #{dicTypeName} + + + and dic_type_code = #{dicTypeCode} + + + and valid_flag ${validFlagOperator} #{validFlag} + + + and parent_id ${parentIdOperator} #{parentId} + + + + + + + where TS_DICTYPE.valid_flag = 0 + + + and TS_DICTYPE.dic_id ${dicIdOperator} #{dicId} + + + and TS_DICTYPE.dic_type_name ${dicTypeNameOperator} concat(concat('%',#{dicTypeName}),'%') + + + and TS_DICTYPE.dic_type_code ${dicTypeCodeOperator} concat(concat('%',#{dicTypeCode}),'%') + + + and TS_DICTYPE.parent_id = #{id} + + + and TS_DICTYPE.DESCRIBES = #{describes} + + + + + + + where TS_DICTYPE.valid_flag = 0 + + + and TS_DICTYPE.id ${idOperator} #{id} + + + and TS_DICTYPE.dic_id ${dicIdOperator} #{dicId} + + + and TS_DICTYPE.dic_type_name ${dicTypeNameOperator} concat(concat('%',#{dicTypeName}),'%') + + + and TS_DICTYPE.dic_type_code ${dicTypeCodeOperator} concat(concat('%',#{dicTypeCode}),'%') + + + and TS_DICTYPE.DESCRIBES = #{describes} + + AND TS_DICTYPE.parent_id IS NULL + + + + + + update TS_DICTYPE + + + dic_type_code = #{dicTypeCode}, + + + dic_type_name = #{dicTypeName}, + + + dic_id = #{dicId}, + + + valid_flag = #{validFlag}, + + + parent_id = #{parentId}, + + + modify_Time = #{modifyTime}, + + + DESCRIBES = #{describes}, + + + tree_pid = #{treePid}, + + + others = #{others}, + + + creation_user = #{creationUser}, + + + SHOW_INDEX = #{showIndex} + + + where id = #{id} + + + + + update TS_DICTYPE + SET valid_flag = 1 + where id in + + #{id} + + + + + + + + + + + + + + + + insert into TS_DICTYPE + + ID, + parent_id, + valid_flag, + DIC_ID, + DIC_TYPE_NAME, + DIC_TYPE_CODE, + creation_Time, + modify_Time, + DESCRIBES, + show_index, + tree_pid, + others, + creation_user, + + + #{id}, + #{parentId}, + #{validFlag}, + #{dicId}, + #{dicTypeName}, + #{dicTypeCode}, + #{creationTime}, + #{modifyTime}, + #{describes}, + #{showIndex}, + #{treePid, jdbcType=VARCHAR}, + #{others, jdbcType=VARCHAR}, + #{creationUser, jdbcType=VARCHAR}, + + + + + + + + + + + + + + + + + + + + INSERT INTO TS_DICTYPE ("ID","parent_id","valid_flag", "DIC_ID", "DIC_TYPE_NAME") + VALUES + + (#{eo.id},#{eo.parentId},#{eo.validFlag},#{eo.dicId},#{eo.dicTypeName}) + + + + + update TS_DICTYPE + set valid_flag = 1 + where ID = #{id} + + + + + + + + + + + + + + + + + + + + + + delete from TS_DICTYPE + where PARENT_ID is not null and DIC_TYPE_CODE = #{dicTypeCode} + + + + update TS_DICTYPE + + + dic_type_name = #{dicTypeName}, + + + valid_flag = #{validFlag}, + + + where DIC_TYPE_CODE = #{dicTypeCode} and parent_id is not null + + + + + + update TS_DICTYPE + set valid_flag = 1 + where DIC_TYPE_CODE in + + #{code} + + and PARENT_ID IS not null + + + + delete from TS_DICTYPE + where dic_id = #{dicId} + + + + + + + diff --git a/adc-da-sys/src/main/resources/mybatis/mapper/sys/DictionaryEOMapper.xml b/adc-da-sys/src/main/resources/mybatis/mapper/sys/DictionaryEOMapper.xml new file mode 100644 index 00000000..aea6c3f5 --- /dev/null +++ b/adc-da-sys/src/main/resources/mybatis/mapper/sys/DictionaryEOMapper.xml @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + modify_time, creation_time, valid_flag, dictionary_name, dictionary_code, id, order_num, enable, diction_type, + is_relate,relate_dic_id,creation_user + + + + + + + + + + + + + + + + + + + + + + + + + u.*, ur.id as type_id, + ur.dic_type_code as dic_type_code, + ur.dic_type_name as dic_type_name, + ur.dic_id as dic_id, + ur.parent_id as parent_id, + ur.valid_flag as type_valid_flag + + + + + where 1=1 and u0.valid_flag='0' + + + and u0.id ${idOperator} #{id} + + + and u0.dictionary_code ${dictionaryCodeOperator} '%${dictionaryCode}%' + + + and u0.dictionary_name ${dictionaryNameOperator} '%${dictionaryName}%' + + + and u0.valid_flag ${validFlagOperator} #{validFlag} + + + and u0.modify_time ${modifyTimeOperator} #{modifyTime} + + + and u0.modify_time >= #{modifyTime1} + + + and u0.modify_time <= #{modifyTime2} + + + and u0.creation_time ${creationTimeOperator} #{creationTime} + + + and u0.creation_time >= #{creationTime1} + + + and u0.creation_time <= #{creationTime2} + + + + + + + update TS_DICTIONARY + + + valid_flag = #{validFlag}, + + + creation_time = #{creationTime}, + + + modify_time = #{modifyTime}, + + + dictionary_code = #{dictionaryCode}, + + + dictionary_name = #{dictionaryName}, + + + order_num = #{orderNum}, + + + enable = #{enable}, + + + diction_type = #{dictionType}, + + + is_relate = #{isRelate}, + + + relate_dic_id = #{relateDicId}, + + + creation_user = #{creationUser}, + + + where id = #{id} + + + + + + + + + + + + + + + insert into TS_DICTIONARY + + valid_flag, + creation_time, + modify_time, + id, + dictionary_code, + dictionary_name, + order_num, + enable, + diction_type, + is_relate, + relate_dic_id, + creation_user, + + + #{validFlag, jdbcType=VARCHAR}, + #{creationTime, jdbcType=TIMESTAMP}, + #{modifyTime, jdbcType=TIMESTAMP}, + #{id, jdbcType=VARCHAR}, + #{dictionaryCode, jdbcType=VARCHAR}, + #{dictionaryName, jdbcType=VARCHAR}, + #{orderNum, jdbcType=INTEGER}, + #{enable, jdbcType=VARCHAR}, + #{dictionType, jdbcType=VARCHAR}, + #{isRelate, jdbcType=VARCHAR}, + #{relateDicId, jdbcType=VARCHAR}, + #{creationUser, jdbcType=VARCHAR}, + + + + + + + + update TS_DICTIONARY + set valid_flag = 1 + where id = #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 393390d0..d1b21577 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,7 @@ adc-da-base adc-da-sys adc-da-jwtLogin + adc-da-slrs