diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml
index d8073505ce..ae545279f9 100644
--- a/epmet-commons/epmet-commons-tools/pom.xml
+++ b/epmet-commons/epmet-commons-tools/pom.xml
@@ -163,6 +163,12 @@
com.squareup.okhttp3
okhttp
+
+ io.github.wnjustdoit
+ pinyin4j
+ 2.6.0
+ compile
+
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
index 29a7dcda6b..400e3893e4 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
@@ -160,4 +160,15 @@ public interface Constant {
// resi_footbar_highlight_num
// gov_footbar_highlight_num
String FOOTBAR_HIGHLIGHT_NUM="_footbar_highlight_num";
+
+
+ /**
+ * 未被禁用标识
+ * */
+ String ENABLE = "enable";
+
+ /**
+ * 被禁用标识
+ * */
+ String DISABLE = "disable";
}
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
index 4d717f919e..5efb12edb9 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
@@ -74,6 +74,8 @@ public enum EpmetErrorCode {
AREA_CODE_ALREADY_EXISTS(8208,"组织区划已被占用,请重新选择"),
AGENCY_NAME_ALREADY_EXISTS(8209,"当前组织名称已存在,请重新修改"),
SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"),
+ HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"),
+ GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java
similarity index 94%
rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java
rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java
index 8d392a2c21..103baa6b0d 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java
@@ -1,4 +1,4 @@
-package com.epmet.util;
+package com.epmet.commons.tools.utils;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
@@ -42,7 +42,7 @@ public class Pinyin4jUtil {
*/
public static String getFirstSpellPinYin(String src, boolean isFullSpell) {
String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1));
- System.out.println(targetStr);
+ System.out.println("targetStr="+targetStr);
String[] split = targetStr.split(",");
if (split.length > 1) {
targetStr = split[0];
@@ -59,7 +59,7 @@ public class Pinyin4jUtil {
*/
public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) {
String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont));
- System.out.println(targetStr);
+ System.out.println("targetStr="+targetStr);
String[] split = targetStr.split(",");
if (split.length > 1) {
targetStr = split[0];
@@ -196,8 +196,9 @@ public class Pinyin4jUtil {
}
public static void main(String[] args) {
- System.out.println(getFirstSpellPinYin("区直部门",false));
- System.out.println(getSpellPinYin("党员提出话题数",false,4));
- System.out.println(getSpellPinYin("社区超期项目数",false,4));
+ //System.out.println(getSpellPinYin("社区超期项目数",true,0));
+ System.out.println(getFirstSpellPinYin("区直部门",true));
+ //System.out.println(getSpellPinYin("党员提出话题数",false,4));
+ //System.out.println(getSpellPinYin("社区超期项目数",false,4));
}
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
index 3fe392276f..690543f0d2 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
@@ -4,6 +4,7 @@ import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.StrConstant;
+import com.epmet.commons.tools.utils.Pinyin4jUtil;
import com.epmet.commons.tools.utils.UniqueIdGenerator;
import com.epmet.entity.evaluationindex.screen.IndexDictEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity;
@@ -13,7 +14,6 @@ import com.epmet.service.evaluationindex.screen.IndexGroupDetailService;
import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService;
import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService;
import com.epmet.support.normalizing.Correlation;
-import com.epmet.util.Pinyin4jUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java
index cc1aed7759..b1860f8dfc 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java
@@ -2,7 +2,7 @@ package com.epmet.model;
import com.alibaba.excel.annotation.ExcelProperty;
import com.epmet.commons.tools.constant.StrConstant;
-import com.epmet.util.Pinyin4jUtil;
+import com.epmet.commons.tools.utils.Pinyin4jUtil;
import lombok.Data;
@Data
diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
index 4fc64984c9..8ab04b8758 100644
--- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
+++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
@@ -401,4 +401,35 @@ public class OssController {
return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId);
}
+ /**
+ * @Description 办事指南上传附件
+ * @Param file
+ * @Param customerId
+ * @Return {@link Result< UploadImgResultDTO>}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 17:14
+ */
+ @PostMapping("upload-guide-file")
+ public Result uploadGuideFile(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId) {
+ String fileName = file.getOriginalFilename();
+ String format = "-" + fileName.substring(fileName.lastIndexOf(".") + NumConstant.ONE) + "-";
+ format = format.toLowerCase();
+ // 体积限制
+ int sizeMb = 10;
+ // 大小限制10m
+ int sizeThreshold = sizeMb * 1024 * 1024;
+ if (file.getSize() > sizeThreshold) {
+ throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(),
+ EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg().concat(",限制在").concat(String.valueOf(sizeMb)).concat("M以内"));
+ }
+
+ // 格式限制,只允许png和jpeg
+ if (!ModuleConstant.GUIDE_FILE_DOC.contains(format)) {
+ throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode()
+ , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg());
+ }
+
+ return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId);
+ }
+
}
diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
index 07a11d9ed7..71d5f177e2 100644
--- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
+++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
@@ -43,6 +43,7 @@ public interface ModuleConstant extends Constant {
* 项目附件-允许的文件类型
*/
String PROJECT_FILE_DOC = "-pdf-ppt-pptx-doc-docx-xls-xlsx-";
+ String GUIDE_FILE_DOC = "-pdf-doc-docx-xls-xlsx-";
/**
* 项目附件-允许的音频类型
*/
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java
new file mode 100644
index 0000000000..896ebfb57c
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java
@@ -0,0 +1,31 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 15:06
+ */
+@Data
+public class AgencyTreeResultDTO implements Serializable {
+ private static final long serialVersionUID = -311212619121062367L;
+ /**
+ * 机关组织Id
+ */
+ private String agencyId;
+
+ /**
+ * 机关组织名称
+ */
+ private String agencyName;
+
+ private String pid;
+ /**
+ * 下级机关组织
+ */
+ private List subAgencyList;
+}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java
new file mode 100644
index 0000000000..2473c623fd
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java
@@ -0,0 +1,27 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Description
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 15:11
+ */
+@Data
+public class StaffOrgListResultDTO implements Serializable {
+ private static final long serialVersionUID = -7717333635633000120L;
+ /**
+ * 组织ID
+ */
+ private String orgId;
+ /**
+ * 组织名称
+ */
+ private String orgName;
+ /**
+ * 组织类型机关agency 网格grid 部门dept
+ */
+ private String orgType;
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
index 70c254ee26..11d5e13542 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
@@ -324,4 +324,16 @@ public class CustomerAgencyController {
return new Result().ok(customerAgencyService.getAgencyInfo(formDTO));
}
+ /**
+ * @Description 获取客户下组织树
+ * @Param tokenDTO
+ * @Return {@link Result< AgencyTreeResultDTO >}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 15:20
+ */
+ @PostMapping("agencylist")
+ public Result getAgencyList(@LoginUser TokenDto tokenDTO) {
+ return new Result().ok(customerAgencyService.getAgencyList(tokenDTO));
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
index b95b96c0b9..6d3b50b408 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
@@ -195,4 +195,16 @@ public class StaffController {
return staffService.addStaffV2(fromDTO);
}
+ /**
+ * @Description 用户所属组织
+ * @Param tokenDto
+ * @Return {@link Result< StaffOrgListResultDTO>}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 16:55
+ */
+ @PostMapping("orgList")
+ public Result> staffOrgList(@LoginUser TokenDto tokenDto) {
+ return new Result>().ok(staffService.staffOrgList(tokenDto));
+ }
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
index b0149c28d8..145178f50f 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
@@ -239,4 +239,8 @@ public interface CustomerAgencyDao extends BaseDao {
* @author sun
*/
OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType);
+
+ AgencyTreeResultDTO getAllAgency(@Param("customerId") String customerId);
+
+ List getSubAgencyList(@Param("pid") String pid);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
index aaa691f239..c1a1915a72 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
@@ -19,6 +19,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.*;
@@ -245,4 +246,13 @@ public interface CustomerAgencyService extends BaseService
* @Date 2021/9/7 15:28
*/
OrgResultDTO getAgencyInfo(OrgFormDTO formDTO);
+
+ /**
+ * @Description 获取客户下组织树
+ * @Param tokenDTO
+ * @Return {@link AgencyTreeResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 15:21
+ */
+ AgencyTreeResultDTO getAgencyList(TokenDto tokenDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
index d88298dfbf..ccd998c0fc 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
@@ -129,4 +129,13 @@ public interface StaffService {
* @author sun
*/
Result addStaffV2(AddStaffV2FromDTO fromDTO);
+
+ /**
+ * @Description 工作人员所属组织
+ * @Param tokenDto
+ * @Return {@link StaffOrgListResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 16:57
+ */
+ List staffOrgList(TokenDto tokenDto);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
index 554d263173..4f1de1ae91 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
@@ -25,6 +25,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerAgencyConstant;
@@ -1089,4 +1090,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl staffOrgList(TokenDto tokenDto) {
+ //redis获取工作人员信息
+ CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
+ if (null == staffInfoCache) {
+ return Collections.emptyList();
+ }
+ List list = new ArrayList<>();
+ //工作人员所在组织
+ StaffOrgListResultDTO agency = new StaffOrgListResultDTO();
+ agency.setOrgId(staffInfoCache.getAgencyId());
+ agency.setOrgName(staffInfoCache.getAgencyName());
+ agency.setOrgType(OrgInfoConstant.AGENCY);
+ list.add(agency);
+ //工作人员所在部门
+ if(CollectionUtils.isNotEmpty(staffInfoCache.getDeptList())) {
+ List deptList = staffInfoCache.getDeptList().stream().map(item -> {
+ StaffOrgListResultDTO dto = new StaffOrgListResultDTO();
+ dto.setOrgId(item.getId());
+ dto.setOrgName(item.getName());
+ dto.setOrgType(OrgInfoConstant.DEPT);
+ return dto;
+ }).collect(Collectors.toList());
+ list.addAll(deptList);
+ }
+ //工作人员所在网格
+ if(CollectionUtils.isNotEmpty(staffInfoCache.getGridList())) {
+ List gridList = staffInfoCache.getGridList().stream().map(item -> {
+ StaffOrgListResultDTO dto = new StaffOrgListResultDTO();
+ dto.setOrgId(item.getId());
+ dto.setOrgName(item.getName());
+ dto.setOrgType(OrgInfoConstant.GRID);
+ return dto;
+ }).collect(Collectors.toList());
+ list.addAll(gridList);
+ }
+ return list;
+ }
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
index a30207d922..2799ea36a0 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
@@ -503,5 +503,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java
index ccd59bc862..7d0ed1eef4 100644
--- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java
@@ -17,16 +17,18 @@
package com.epmet.dto;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
import java.io.Serializable;
import java.util.Date;
-import lombok.Data;
/**
* 指南分类
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2021-09-06
+ * @since v1.0.0 2021-09-08
*/
@Data
public class GuideCategoryDTO implements Serializable {
@@ -36,56 +38,67 @@ public class GuideCategoryDTO implements Serializable {
/**
* 主键
*/
- private String id;
+ private String id;
+
+ /**
+ * 客户id,产品默认配置此列存储default
+ */
+ private String customerId;
/**
- * 客户id
+ * 分类名,客户内唯一
*/
- private String customerId;
+ private String categoryName;
/**
- * 分类名
+ * 分类编码:分类名的全拼; eg:gongjijin
*/
- private String categoryName;
+ private String categoryCode;
/**
* 排序
*/
- private Integer sort;
+ private Integer sort;
/**
* 状态 禁用disable 启用enable
*/
- private String status;
+ private String status;
/**
* 删除标识 0未删除、1已删除
*/
- private String delFlag;
+ @JsonIgnore
+ private String delFlag;
/**
* 乐观锁
*/
- private Integer revision;
+ @JsonIgnore
+ private Integer revision;
/**
* 创建人
*/
- private String createdBy;
+ @JsonIgnore
+ private String createdBy;
/**
* 创建时间
*/
- private Date createdTime;
+ @JsonIgnore
+ private Date createdTime;
/**
* 更新人
*/
- private String updatedBy;
+ @JsonIgnore
+ private String updatedBy;
/**
* 更新时间
*/
- private Date updatedTime;
+ @JsonIgnore
+ private Date updatedTime;
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java
new file mode 100644
index 0000000000..79286ba45f
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java
@@ -0,0 +1,49 @@
+package com.epmet.dto.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Description 编辑、禁用、删除统一入参
+ * @Author yinzuomei
+ * @Date 2021/9/8 4:15 下午
+ */
+@Data
+public class EditGuideCategoryFormDTO implements Serializable {
+ private static final long serialVersionUID = -6853534660181580456L;
+
+ public interface AddUserInternalGroup {
+ }
+
+ public interface StatusGroup {
+ }
+
+ public interface UpdateInfoGroup extends CustomerClientShowGroup {
+ }
+ public interface SaveInfoGroup extends CustomerClientShowGroup {
+ }
+
+ public interface DelGroup {
+ }
+ @NotBlank(message = "当前操作人id不能为空", groups = AddUserInternalGroup.class)
+ private String staffId;
+
+ @NotBlank(message = "客户id不能为空",groups = {DelGroup.class,UpdateInfoGroup.class,SaveInfoGroup.class})
+ private String customerId;
+
+ @NotBlank(message = "id不能为空", groups = {StatusGroup.class,DelGroup.class,UpdateInfoGroup.class})
+ private String id;
+
+ @NotBlank(message = "status不能为空", groups = StatusGroup.class)
+ private String status;
+
+ @NotBlank(message = "分类名称不能为空不能为空", groups = {UpdateInfoGroup.class,SaveInfoGroup.class})
+ @Length(max = 10, message = "分类名称最多填入10个字", groups = {UpdateInfoGroup.class,SaveInfoGroup.class})
+ private String categoryName;
+
+}
+
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java
new file mode 100644
index 0000000000..6b66e9f7c5
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java
@@ -0,0 +1,56 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description 分类排序入参DTO
+ * @Author yinzuomei
+ * @Date 2021/9/8 4:03 下午
+ */
+@Data
+public class GuideCateOrderFormDTO implements Serializable {
+ private static final long serialVersionUID = 8671295475212569124L;
+
+ public interface AddUserInternalGroup {
+ }
+
+ @NotBlank(message = "当前操作人id不能为空", groups = AddUserInternalGroup.class)
+ private String staffId;
+
+
+ @NotEmpty(message = "顺序不能为空", groups = {AddUserInternalGroup.class})
+ private List orderList;
+
+ /**
+ * 排序索引号dto
+ */
+ public static class OrderIndexDTO {
+ private String id;
+ private Integer orderIndex;
+
+ public OrderIndexDTO() {
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Integer getOrderIndex() {
+ return orderIndex;
+ }
+
+ public void setOrderIndex(Integer orderIndex) {
+ this.orderIndex = orderIndex;
+ }
+ }
+}
+
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java
new file mode 100644
index 0000000000..a92e1c2e09
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java
@@ -0,0 +1,28 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Description 发布指南、编辑指南、查询指南列表 分类下拉框
+ * @Author yinzuomei
+ * @Date 2021/9/8 2:57 下午
+ */
+@Data
+public class GuideCategoryDropDownFormDTO implements Serializable {
+ private static final long serialVersionUID = 9122708701080412461L;
+ public interface AddUserInternalGroup {
+ }
+ /**
+ * 新增指南:saveorupdate;查询指南列表:query
+ */
+ @NotBlank(message = "新增指南:saveorupdate;查询指南列表:query",groups = AddUserInternalGroup.class)
+ private String queryOrigin;
+
+ @NotBlank(message = "当前工作人员所属客户id不能为空",groups = AddUserInternalGroup.class)
+ private String customerId;
+
+}
+
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java
new file mode 100644
index 0000000000..b67686e451
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java
@@ -0,0 +1,21 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Description 工作端PC或者运营端分页
+ * @Author yinzuomei
+ * @Date 2021/9/8 1:35 下午
+ */
+@Data
+public class GuideCategoryPageFormDTO implements Serializable {
+ private static final long serialVersionUID = -7551388716349439643L;
+ public interface AddUserInternalGroup {
+ }
+ @NotBlank(message = "客户id不能为空,运营端传default", groups = AddUserInternalGroup.class)
+ private String customerId;
+}
+
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java
new file mode 100644
index 0000000000..00f56ad3f9
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java
@@ -0,0 +1,39 @@
+package com.epmet.dto.result;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Description 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示
+ * @Author yinzuomei
+ * @Date 2021/9/8 2:44 下午
+ */
+@Data
+public class GuideDictResDTO implements Serializable {
+
+ /**
+ * 分类名,客户内唯一
+ */
+ private String categoryName;
+
+ /**
+ * 分类编码:分类名的全拼; eg:gongjijin
+ */
+ private String categoryCode;
+
+ /**
+ * 排序
+ */
+ @JsonIgnore
+ private Integer sort;
+
+ /**
+ * 状态 禁用disable 启用enable
+ */
+ @JsonIgnore
+ private String status;
+}
+
+
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java
index 03bd231c0b..b1e8824223 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java
@@ -17,19 +17,25 @@
package com.epmet.controller;
+import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
-import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
-import com.epmet.commons.tools.validator.group.AddGroup;
-import com.epmet.commons.tools.validator.group.DefaultGroup;
-import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.GuideCategoryDTO;
+import com.epmet.dto.form.EditGuideCategoryFormDTO;
+import com.epmet.dto.form.GuideCateOrderFormDTO;
+import com.epmet.dto.form.GuideCategoryDropDownFormDTO;
+import com.epmet.dto.form.GuideCategoryPageFormDTO;
+import com.epmet.dto.result.GuideDictResDTO;
import com.epmet.service.GuideCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
-import java.util.Map;
+import java.util.List;
/**
@@ -45,40 +51,121 @@ public class GuideCategoryController {
@Autowired
private GuideCategoryService guideCategoryService;
- @GetMapping("page")
- public Result> page(@RequestParam Map params){
- PageData page = guideCategoryService.page(params);
+ /**
+ * 【办事指南】分类列表-工作端PC和运营端用不分页
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author yinzuomei
+ * @date 2021/9/8 1:33 下午
+ */
+ @PostMapping("page")
+ public Result> page(@RequestBody GuideCategoryPageFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO, GuideCategoryPageFormDTO.AddUserInternalGroup.class);
+ PageData page = guideCategoryService.page(formDTO);
return new Result>().ok(page);
}
- @GetMapping("{id}")
- public Result get(@PathVariable("id") String id){
- GuideCategoryDTO data = guideCategoryService.get(id);
- return new Result().ok(data);
+ /**
+ * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示
+ *
+ * @param tokenDto
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author yinzuomei
+ * @date 2021/9/8 2:47 下午
+ */
+ @PostMapping("getcategory")
+ public Result> getCategory(@LoginUser TokenDto tokenDto,@RequestBody GuideCategoryDropDownFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ ValidatorUtils.validateEntity(formDTO,GuideCategoryDropDownFormDTO.AddUserInternalGroup.class);
+ return new Result>().ok(guideCategoryService.getCategory(formDTO));
}
- @PostMapping
- public Result save(@RequestBody GuideCategoryDTO dto){
- //效验数据
- ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
- guideCategoryService.save(dto);
+
+ /**
+ * 保存排序
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author yinzuomei
+ * @date 2021/9/8 4:09 下午
+ */
+ @PostMapping("saveorder")
+ public Result saveOrder(@LoginUser TokenDto tokenDto,@RequestBody GuideCateOrderFormDTO formDTO){
+ formDTO.setStaffId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO,GuideCateOrderFormDTO.AddUserInternalGroup.class);
+ guideCategoryService.saveOrder(formDTO);
return new Result();
}
- @PutMapping
- public Result update(@RequestBody GuideCategoryDTO dto){
- //效验数据
- ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
- guideCategoryService.update(dto);
+ /**
+ * 禁用或者启用分类
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author yinzuomei
+ * @date 2021/9/8 4:19 下午
+ */
+ @PostMapping("disable")
+ public Result disable(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){
+ formDTO.setStaffId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.StatusGroup.class,EditGuideCategoryFormDTO.AddUserInternalGroup.class);
+ guideCategoryService.disableGuideCategory(formDTO);
return new Result();
}
- @DeleteMapping
- public Result delete(@RequestBody String[] ids){
- //效验数据
- AssertUtils.isArrayEmpty(ids, "id");
- guideCategoryService.delete(ids);
+ /**
+ * 删除分类,已经存在指南的不允许删除,给予提示
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author yinzuomei
+ * @date 2021/9/8 4:45 下午
+ */
+ @PostMapping("delete")
+ public Result delete(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){
+ formDTO.setStaffId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.DelGroup.class);
+ guideCategoryService.delete(formDTO);
return new Result();
}
+
+ /**
+ * 新增分类,名称和编码客户内唯一
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author yinzuomei
+ * @date 2021/9/8 5:11 下午
+ */
+ @PostMapping("save")
+ public Result save(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){
+ formDTO.setStaffId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.SaveInfoGroup.class);
+ return new Result().ok(guideCategoryService.save(formDTO));
+ }
+
+
+ /**
+ * 编辑名称
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author yinzuomei
+ * @date 2021/9/8 5:37 下午
+ */
+ @PostMapping("update")
+ public Result update(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){
+ formDTO.setStaffId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.UpdateInfoGroup.class);
+ return new Result().ok(guideCategoryService.update(formDTO));
+ }
+
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java
index a6b9a24cc8..71f757fd23 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java
@@ -18,8 +18,13 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.GuideCategoryDTO;
+import com.epmet.dto.result.GuideDictResDTO;
import com.epmet.entity.GuideCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
/**
* 指南分类
@@ -29,5 +34,65 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface GuideCategoryDao extends BaseDao {
-
+
+ /**
+ * 工作端PC或者运营端分类列表查询,不分页
+ *
+ * @param customerId
+ * @return java.util.List
+ * @author yinzuomei
+ * @date 2021/9/8 1:57 下午
+ */
+ List selectPageByCid(String customerId);
+
+ /**
+ * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示
+ *
+ * @param customerId
+ * @param queryOrigin
+ * @return java.util.List
+ * @author yinzuomei
+ * @date 2021/9/8 3:15 下午
+ */
+ List selectCategoryDict(@Param("customerId") String customerId, @Param("queryOrigin") String queryOrigin);
+
+ /**
+ * 保存排序
+ *
+ * @param id
+ * @param orderIndex
+ * @param staffId
+ * @return int
+ * @author yinzuomei
+ * @date 2021/9/8 4:11 下午
+ */
+ int updateOrder(@Param("id") String id, @Param("orderIndex") Integer orderIndex, @Param("staffId") String staffId);
+
+ /**
+ * 启用或者禁用
+ *
+ * @param id
+ * @param status
+ * @param staffId
+ * @return int
+ * @author yinzuomei
+ * @date 2021/9/8 4:22 下午
+ */
+ int updateStatus(@Param("id") String id, @Param("status")String status, @Param("staffId")String staffId);
+
+ /**
+ * 查询这个分类下的项目数
+ *
+ * @param id
+ * @return int
+ * @author yinzuomei
+ * @date 2021/9/8 4:36 下午
+ */
+ int selectGuideTotal(@Param("id") String id,@Param("customerId") String customerId);
+
+ int selectCategoryName(@Param("categoryName") String categoryName, @Param("customerId")String customerId, @Param("excludeId") String excludeId);
+
+ int selectCurrentOrder(String customerId);
+
+ int selectCategoryCode(@Param("categoryCode") String categoryCode, @Param("customerId")String customerId, @Param("excludeId") String excludeId);
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java
index 8231f9d5ef..c13a7a3df9 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java
@@ -18,18 +18,15 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
-
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import java.util.Date;
-
/**
* 指南分类
*
* @author generator generator@elink-cn.com
- * @since v1.0.0 2021-09-06
+ * @since v1.0.0 2021-09-08
*/
@Data
@EqualsAndHashCode(callSuper=false)
@@ -38,24 +35,29 @@ public class GuideCategoryEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
- /**
- * 客户id
- */
+ /**
+ * 客户id,产品默认配置此列存储default
+ */
private String customerId;
- /**
- * 分类名
- */
+ /**
+ * 分类名,客户内唯一
+ */
private String categoryName;
- /**
- * 排序
- */
+ /**
+ * 分类编码:分类名的全拼; eg:gongjijin
+ */
+ private String categoryCode;
+
+ /**
+ * 排序
+ */
private Integer sort;
- /**
- * 状态 禁用disable 启用enable
- */
+ /**
+ * 状态 禁用disable 启用enable
+ */
private String status;
}
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java
index 84f995d0fd..5bde4619e6 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java
@@ -20,10 +20,14 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.GuideCategoryDTO;
+import com.epmet.dto.form.EditGuideCategoryFormDTO;
+import com.epmet.dto.form.GuideCateOrderFormDTO;
+import com.epmet.dto.form.GuideCategoryDropDownFormDTO;
+import com.epmet.dto.form.GuideCategoryPageFormDTO;
+import com.epmet.dto.result.GuideDictResDTO;
import com.epmet.entity.GuideCategoryEntity;
import java.util.List;
-import java.util.Map;
/**
* 指南分类
@@ -34,34 +38,45 @@ import java.util.Map;
public interface GuideCategoryService extends BaseService {
/**
- * 默认分页
+ * 【办事指南】分类列表-工作端PC和运营端用不分页
*
- * @param params
- * @return PageData
- * @author generator
- * @date 2021-09-06
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author yinzuomei
+ * @date 2021/9/8 1:33 下午
*/
- PageData page(Map params);
+ PageData page(GuideCategoryPageFormDTO formDTO);
/**
- * 默认查询
+ * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示
*
- * @param params
- * @return java.util.List
- * @author generator
- * @date 2021-09-06
+ * @param formDTO
+ * @return java.util.List
+ * @author yinzuomei
+ * @date 2021/9/8 3:06 下午
*/
- List list(Map params);
+ List getCategory(GuideCategoryDropDownFormDTO formDTO);
/**
- * 单条查询
+ * 保存排序
*
- * @param id
- * @return GuideCategoryDTO
- * @author generator
- * @date 2021-09-06
+ * @param formDTO
+ * @return void
+ * @author yinzuomei
+ * @date 2021/9/8 4:09 下午
+ */
+ void saveOrder(GuideCateOrderFormDTO formDTO);
+
+
+ /**
+ * 启用或者禁用分类
+ *
+ * @param formDTO
+ * @return int
+ * @author yinzuomei
+ * @date 2021/9/8 4:20 下午
*/
- GuideCategoryDTO get(String id);
+ void disableGuideCategory(EditGuideCategoryFormDTO formDTO);
/**
* 默认保存
@@ -71,7 +86,7 @@ public interface GuideCategoryService extends BaseService {
* @author generator
* @date 2021-09-06
*/
- void save(GuideCategoryDTO dto);
+ GuideCategoryDTO save(EditGuideCategoryFormDTO dto);
/**
* 默认更新
@@ -81,15 +96,15 @@ public interface GuideCategoryService extends BaseService {
* @author generator
* @date 2021-09-06
*/
- void update(GuideCategoryDTO dto);
+ GuideCategoryDTO update(EditGuideCategoryFormDTO dto);
/**
- * 批量删除
+ * 删除分类,存在办事指南的不允许删除,给予提示
*
- * @param ids
- * @return void
- * @author generator
- * @date 2021-09-06
+ * @param formDTO
+ * @return void
+ * @author yinzuomei
+ * @date 2021/9/8 4:34 下午
*/
- void delete(String[] ids);
+ void delete(EditGuideCategoryFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java
index 1af3f23de9..2bf1b3aac7 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java
@@ -92,4 +92,13 @@ public interface GuideModuleDictDefaultService extends BaseService}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 17:44
+ */
+ List getList();
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java
index 50ea1e80e0..7f1ae4a0e4 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java
@@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.GuideModuleDictDTO;
+import com.epmet.dto.ModuleDTO;
import com.epmet.entity.GuideModuleDictEntity;
import java.util.List;
@@ -92,4 +93,13 @@ public interface GuideModuleDictService extends BaseService}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 17:50
+ */
+ List getModuleList(String customerId);
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java
index 502f18571a..6f3f7a082a 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java
@@ -18,20 +18,29 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Pinyin4jUtil;
import com.epmet.dao.GuideCategoryDao;
import com.epmet.dto.GuideCategoryDTO;
+import com.epmet.dto.form.EditGuideCategoryFormDTO;
+import com.epmet.dto.form.GuideCateOrderFormDTO;
+import com.epmet.dto.form.GuideCategoryDropDownFormDTO;
+import com.epmet.dto.form.GuideCategoryPageFormDTO;
+import com.epmet.dto.result.GuideDictResDTO;
import com.epmet.entity.GuideCategoryEntity;
import com.epmet.service.GuideCategoryService;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -45,20 +54,100 @@ import java.util.Map;
public class GuideCategoryServiceImpl extends BaseServiceImpl implements GuideCategoryService {
+ /**
+ * 【办事指南】分类列表-工作端PC和运营端用不分页
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author yinzuomei
+ * @date 2021/9/8 1:33 下午
+ */
+ @Transactional(rollbackFor = Exception.class)
@Override
- public PageData page(Map params) {
- IPage page = baseDao.selectPage(
- getPage(params, FieldConstant.CREATED_TIME, false),
- getWrapper(params)
- );
- return getPageData(page, GuideCategoryDTO.class);
+ public PageData page(GuideCategoryPageFormDTO formDTO) {
+ List list = baseDao.selectPageByCid(formDTO.getCustomerId());
+ if (CollectionUtils.isEmpty(list) && !formDTO.getCustomerId().equals(Constant.DEFAULT_CUSTOMER)) {
+ //初始化默认的给客户
+ initCustomerGuideCategory(formDTO.getCustomerId());
+ list = baseDao.selectPageByCid(formDTO.getCustomerId());
+ }
+ PageInfo pageInfo = new PageInfo<>(list);
+ return new PageData<>(list, pageInfo.getTotal());
+ }
+
+ /**
+ * 产品默认分类同步给客户,已经禁用的不同步
+ *
+ * @param customerId
+ * @return void
+ * @author yinzuomei
+ * @date 2021/9/8 2:17 下午
+ */
+ private void initCustomerGuideCategory(String customerId) {
+ List list = baseDao.selectPageByCid(Constant.DEFAULT_CUSTOMER);
+ int sort = 0;
+ for (GuideCategoryDTO dto : list) {
+ // 已经禁用的,不同步给客户
+ if (Constant.DISABLE.equals(dto.getStatus())) {
+ continue;
+ }
+ dto.setCustomerId(customerId);
+ //清空主键
+ dto.setId(null);
+ dto.setSort(sort);
+ GuideCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryEntity.class);
+ insert(entity);
+ sort++;
+ }
}
+
+ /**
+ * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示
+ *
+ * @param formDTO
+ * @return java.util.List
+ * @author yinzuomei
+ * @date 2021/9/8 3:06 下午
+ */
@Override
- public List list(Map params) {
- List entityList = baseDao.selectList(getWrapper(params));
+ public List getCategory(GuideCategoryDropDownFormDTO formDTO) {
+ List list=baseDao.selectCategoryDict(formDTO.getCustomerId(),formDTO.getQueryOrigin());
+ if (CollectionUtils.isEmpty(list) && !formDTO.getCustomerId().equals(Constant.DEFAULT_CUSTOMER)) {
+ //初始化默认的给客户
+ initCustomerGuideCategory(formDTO.getCustomerId());
+ list=baseDao.selectCategoryDict(formDTO.getCustomerId(),formDTO.getQueryOrigin());
+ }
+ return list;
+ }
- return ConvertUtils.sourceToTarget(entityList, GuideCategoryDTO.class);
+ /**
+ * 保存排序
+ *
+ * @param formDTO
+ * @return void
+ * @author yinzuomei
+ * @date 2021/9/8 4:09 下午
+ */
+ @Transactional
+ @Override
+ public void saveOrder(GuideCateOrderFormDTO formDTO) {
+ for (GuideCateOrderFormDTO.OrderIndexDTO idx : formDTO.getOrderList()) {
+ baseDao.updateOrder(idx.getId(), idx.getOrderIndex(),formDTO.getStaffId());
+ }
+ }
+
+ /**
+ * 启用或者禁用分类
+ *
+ * @param formDTO
+ * @return int
+ * @author yinzuomei
+ * @date 2021/9/8 4:20 下午
+ */
+ @Override
+ public void disableGuideCategory(EditGuideCategoryFormDTO formDTO) {
+ baseDao.updateStatus(formDTO.getId(), formDTO.getStatus(),formDTO.getStaffId());
}
private QueryWrapper getWrapper(Map params){
@@ -70,31 +159,67 @@ public class GuideCategoryServiceImpl extends BaseServiceImpl 0) {
+ throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg());
+ }
+ String categoryCode = Pinyin4jUtil.getFirstSpellPinYin(dto.getCategoryName(), true);
+ if (baseDao.selectCategoryCode(categoryCode, dto.getCustomerId(), null) > 0) {
+ throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg());
+ }
+ GuideCategoryEntity entity = new GuideCategoryEntity();
+ entity.setCustomerId(dto.getCustomerId());
+ entity.setCategoryName(dto.getCategoryName());
+ entity.setCategoryCode(categoryCode);
+ int currentMax = baseDao.selectCurrentOrder(dto.getCustomerId());
+ entity.setSort(currentMax == 0 ? currentMax : currentMax + 1);
+ entity.setStatus(Constant.ENABLE);
insert(entity);
+ return ConvertUtils.sourceToTarget(entity,GuideCategoryDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
- public void update(GuideCategoryDTO dto) {
- GuideCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryEntity.class);
- updateById(entity);
+ public GuideCategoryDTO update(EditGuideCategoryFormDTO dto) {
+ if (baseDao.selectCategoryName(dto.getCategoryName().trim(), dto.getCustomerId(), dto.getId()) > 0) {
+ throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg());
+ }
+ String categoryCode = Pinyin4jUtil.getFirstSpellPinYin(dto.getCategoryName(), true);
+ if (baseDao.selectCategoryCode(categoryCode, dto.getCustomerId(), dto.getId()) > 0) {
+ throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg());
+ }
+ GuideCategoryEntity origin=baseDao.selectById(dto.getId());
+ origin.setCategoryCode(categoryCode);
+ origin.setCategoryName(dto.getCategoryName());
+ updateById(origin);
+ return ConvertUtils.sourceToTarget(origin,GuideCategoryDTO.class);
}
-
+ /**
+ * 删除分类,存在办事指南的不允许删除,给予提示
+ *
+ * @param formDTO
+ * @return void
+ * @author yinzuomei
+ * @date 2021/9/8 4:34 下午
+ */
@Override
- @Transactional(rollbackFor = Exception.class)
- public void delete(String[] ids) {
- // 逻辑删除(@TableLogic 注解)
- baseDao.deleteBatchIds(Arrays.asList(ids));
+ public void delete(EditGuideCategoryFormDTO formDTO) {
+ // 存在指南的分类不允许删除
+ if(baseDao.selectGuideTotal(formDTO.getId(),formDTO.getCustomerId())>0){
+ throw new RenException(EpmetErrorCode.HAVE_GUIDE_CANNOT_DEL.getCode(),EpmetErrorCode.HAVE_GUIDE_CANNOT_DEL.getMsg());
+ }
+ baseDao.deleteById(formDTO.getId());
}
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java
index 6be5e56dc4..ecc0fff0bb 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java
@@ -97,4 +97,18 @@ public class GuideModuleDictDefaultServiceImpl extends BaseServiceImpl}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 17:44
+ */
+ @Override
+ public List getList() {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), GuideModuleDictDefaultDTO.class);
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java
index c758eebdad..72bfeb9d05 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java
@@ -17,6 +17,7 @@
package com.epmet.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@@ -25,15 +26,21 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.GuideModuleDictDao;
import com.epmet.dto.GuideModuleDictDTO;
+import com.epmet.dto.GuideModuleDictDefaultDTO;
+import com.epmet.dto.ModuleDTO;
import com.epmet.entity.GuideModuleDictEntity;
+import com.epmet.service.GuideModuleDictDefaultService;
import com.epmet.service.GuideModuleDictService;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
/**
* 指南模块字典表
@@ -44,6 +51,8 @@ import java.util.Map;
@Service
public class GuideModuleDictServiceImpl extends BaseServiceImpl implements GuideModuleDictService {
+ @Resource
+ private GuideModuleDictDefaultService guideModuleDictDefaultService;
@Override
public PageData page(Map params) {
@@ -97,4 +106,38 @@ public class GuideModuleDictServiceImpl extends BaseServiceImpl}
+ * @Author zhaoqifeng
+ * @Date 2021/9/8 17:50
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public List getModuleList(String customerId) {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(GuideModuleDictEntity::getCustomerId, customerId);
+ wrapper.orderByAsc(GuideModuleDictEntity::getSort);
+ List list = baseDao.selectList(wrapper);
+ //结果为空,初始化默认配置
+ if (CollectionUtils.isEmpty(list)) {
+ List defaultList = guideModuleDictDefaultService.getList();
+ List moduleList = ConvertUtils.sourceToTarget(defaultList, GuideModuleDictEntity.class);
+ moduleList.forEach(item -> {
+ item.setCustomerId(customerId);
+ });
+ insertBatch(moduleList);
+ list = baseDao.selectList(wrapper);
+ }
+ return list.stream().map(item -> {
+ ModuleDTO dto = new ModuleDTO();
+ dto.setModuleId(item.getId());
+ dto.setModuleValue(item.getModuleValue());
+ dto.setModuleName(item.getModuleName());
+ return dto;
+ }).collect(Collectors.toList());
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java
index d8a2d2deeb..ac643590eb 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java
@@ -165,6 +165,7 @@ public class GuideServiceImpl extends BaseServiceImpl imp
* @Date 2021/9/7 14:12
*/
@Override
+ @Transactional(rollbackFor = Exception.class)
public void guideAdd(TokenDto tokenDto, GuideAddFormDTO formDTO) {
if (CollectionUtils.isEmpty(formDTO.getModuleList()) && CollectionUtils.isEmpty(formDTO.getAttachmentList()) &&
CollectionUtils.isEmpty(formDTO.getExternalLinks())) {
@@ -251,6 +252,7 @@ public class GuideServiceImpl extends BaseServiceImpl imp
* @Date 2021/9/7 14:12
*/
@Override
+ @Transactional(rollbackFor = Exception.class)
public void guideEdit(GuideEditFormDTO formDTO) {
if (CollectionUtils.isEmpty(formDTO.getModuleList()) && CollectionUtils.isEmpty(formDTO.getAttachmentList()) &&
CollectionUtils.isEmpty(formDTO.getExternalLinks())) {
@@ -342,6 +344,7 @@ public class GuideServiceImpl extends BaseServiceImpl imp
* @Date 2021/9/7 14:12
*/
@Override
+ @Transactional(rollbackFor = Exception.class)
public void guideDel(GuideFormDTO formDTO) {
GuideDTO guide = get(formDTO.getGuideId());
if (!formDTO.getStaffId().equals(guide.getCreatedBy())) {
diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml
index dad8bb6c4c..7bd2f78df8 100644
--- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml
+++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml
@@ -3,19 +3,128 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ update guide_category
+ set SORT=#{orderIndex},
+ UPDATED_BY=#{staffId},
+ UPDATED_TIME=NOW()
+ where id=#{id}
+ and del_flag='0'
+
+
+
+
+ update guide_category
+ set status=#{status},
+ UPDATED_BY=#{staffId},
+ UPDATED_TIME=NOW()
+ where id=#{id}
+ and del_flag='0'
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
index 04962a5396..7de2636450 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
@@ -3,6 +3,7 @@ package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
+import java.util.List;
/**
* 获取pc工作端登陆用户信息
@@ -60,4 +61,10 @@ public class StaffBasicInfoResultDTO implements Serializable {
* 状态 0:停用 1:正常
*/
private Integer status;
+
+ /**
+ * 工作人员的所有角色key,09.08新增:工作端PC端用到了
+ */
+ private List roleList;
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
index e49790c0d4..97e4bf7424 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
@@ -198,6 +198,14 @@ public interface CustomerStaffDao extends BaseDao {
*/
BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO);
+ /**
+ * @Description 查询用户名字
+ * @Param userIds
+ * @author zxc
+ * @date 2021/6/9 1:36 下午
+ */
+ List selectUserName(@Param("userIds")List userIds);
+
/**
* 通用列表查询
* @param customerId
@@ -206,11 +214,5 @@ public interface CustomerStaffDao extends BaseDao {
*/
List listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List userIds);
- /**
- * @Description 查询用户名字
- * @Param userIds
- * @author zxc
- * @date 2021/6/9 1:36 下午
- */
- List selectUserName(@Param("userIds")List userIds);
+ List selectStaffRoles(@Param("userId") String userId,@Param("customerId") String customerId);
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
index 740b4b8d6e..989b86924d 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
@@ -703,6 +703,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl selectStaffBasicInfo(String userId) {
StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId);
+ if(null!=resultDTO){
+ resultDTO.setRoleList(baseDao.selectStaffRoles(userId,resultDTO.getCustomerId()));
+ }
return new Result().ok(resultDTO);
}
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
index 9e3265747c..4448cb0566 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
@@ -416,4 +416,14 @@
)
+