Browse Source

Merge remote-tracking branch 'origin/dev_guidance' into develop

# Conflicts:
#	epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
master
yinzuomei 4 years ago
parent
commit
62cbd719f8
  1. 6
      epmet-commons/epmet-commons-tools/pom.xml
  2. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
  3. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  4. 13
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  6. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java
  7. 31
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  8. 1
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
  9. 31
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java
  10. 27
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java
  11. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  12. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  13. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  14. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  15. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
  16. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  17. 51
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  18. 35
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  19. 21
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java
  20. 49
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java
  21. 56
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java
  22. 28
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java
  23. 21
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java
  24. 39
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java
  25. 143
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java
  26. 65
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java
  27. 14
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java
  28. 67
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java
  29. 9
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java
  30. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java
  31. 179
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java
  32. 14
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java
  33. 43
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java
  34. 3
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java
  35. 135
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml
  36. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
  37. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  38. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  39. 10
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

6
epmet-commons/epmet-commons-tools/pom.xml

@ -163,6 +163,12 @@
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>io.github.wnjustdoit</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.6.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

11
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";
}

2
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, "请求第三方平台错误"),

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java → 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));
}
}

2
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;

2
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

31
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<UploadImgResultDTO> 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);
}
}

1
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-";
/**
* 项目附件-允许的音频类型
*/

31
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<AgencyTreeResultDTO> subAgencyList;
}

27
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;
}

12
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<OrgResultDTO>().ok(customerAgencyService.getAgencyInfo(formDTO));
}
/**
* @Description 获取客户下组织树
* @Param tokenDTO
* @Return {@link Result< AgencyTreeResultDTO >}
* @Author zhaoqifeng
* @Date 2021/9/8 15:20
*/
@PostMapping("agencylist")
public Result<AgencyTreeResultDTO> getAgencyList(@LoginUser TokenDto tokenDTO) {
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getAgencyList(tokenDTO));
}
}

12
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<List<StaffOrgListResultDTO>> staffOrgList(@LoginUser TokenDto tokenDto) {
return new Result<List<StaffOrgListResultDTO>>().ok(staffService.staffOrgList(tokenDto));
}
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -239,4 +239,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @author sun
*/
OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType);
AgencyTreeResultDTO getAllAgency(@Param("customerId") String customerId);
List<AgencyTreeResultDTO> getSubAgencyList(@Param("pid") String pid);
}

10
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<CustomerAgencyEntity>
* @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);
}

9
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<StaffOrgListResultDTO> staffOrgList(TokenDto tokenDto);
}

14
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<CustomerAgencyDao
return baseDao.selectAgencyDetail(formDTO.getOrgId(), formDTO.getOrgType());
}
/**
* @param tokenDTO
* @Description 获取客户下组织树
* @Param tokenDTO
* @Return {@link AgencyTreeResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/8 15:21
*/
@Override
public AgencyTreeResultDTO getAgencyList(TokenDto tokenDTO) {
return baseDao.getAllAgency(tokenDTO.getCustomerId());
}
}

51
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -11,9 +11,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
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;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerStaffAgencyDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
@ -21,6 +19,7 @@ import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.feign.*;
import com.epmet.service.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -30,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@ -566,5 +566,52 @@ public class StaffServiceImpl implements StaffService {
return new Result();
}
/**
* @param tokenDto
* @Description 工作人员所属组织
* @Param tokenDto
* @Return {@link StaffOrgListResultDTO}
* @Author zhaoqifeng
* @Date 2021/9/8 16:57
*/
@Override
public List<StaffOrgListResultDTO> staffOrgList(TokenDto tokenDto) {
//redis获取工作人员信息
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfoCache) {
return Collections.emptyList();
}
List<StaffOrgListResultDTO> 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<StaffOrgListResultDTO> 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<StaffOrgListResultDTO> 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;
}
}

35
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -503,5 +503,40 @@
</otherwise>
</choose>
</select>
<resultMap id="BaseResultMap" type="com.epmet.dto.result.AgencyTreeResultDTO">
<result column="agencyId" property="agencyId"/>
<result column="agencyName" property="agencyName"/>
<result column="pid" property="pid"/>
</resultMap>
<resultMap id="NodeTreeResult" type="com.epmet.dto.result.AgencyTreeResultDTO"
extends="BaseResultMap">
<collection property="subAgencyList" column="PID" ofType="com.epmet.dto.result.AgencyTreeResultDTO"
javaType="java.util.ArrayList" select="getSubAgencyList">
</collection>
</resultMap>
<select id="getSubAgencyList" resultMap="NodeTreeResult">
select
ID AS agencyId,
ORGANIZATION_NAME AS agencyName,
PID
from customer_agency
where
DEL_FLAG = 0
AND PID= #{pid}
ORDER BY ID
</select>
<select id="getAllAgency" resultType="com.epmet.dto.result.AgencyTreeResultDTO">
select
ID AS agencyId,
ORGANIZATION_NAME AS agencyName,
PID
from
customer_agency
where
DEL_FLAG = 0
AND PID ='0'
AND CUSTOMER_ID = #{customerId}
</select>
</mapper>

21
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 {
@ -39,15 +41,20 @@ public class GuideCategoryDTO implements Serializable {
private String id;
/**
* 客户id
* 客户id产品默认配置此列存储default
*/
private String customerId;
/**
* 分类名
* 分类名,客户内唯一
*/
private String categoryName;
/**
* 分类编码分类名的全拼; eggongjijin
*/
private String categoryCode;
/**
* 排序
*/
@ -61,31 +68,37 @@ public class GuideCategoryDTO implements Serializable {
/**
* 删除标识 0未删除1已删除
*/
@JsonIgnore
private String delFlag;
/**
* 乐观锁
*/
@JsonIgnore
private Integer revision;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
@JsonIgnore
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
}

49
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;
}

56
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<OrderIndexDTO> 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;
}
}
}

28
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;
}

21
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;
}

39
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;
/**
* 分类编码分类名的全拼; eggongjijin
*/
private String categoryCode;
/**
* 排序
*/
@JsonIgnore
private Integer sort;
/**
* 状态 禁用disable 启用enable
*/
@JsonIgnore
private String status;
}

143
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<PageData<GuideCategoryDTO>> page(@RequestParam Map<String, Object> params){
PageData<GuideCategoryDTO> page = guideCategoryService.page(params);
/**
* 办事指南分类列表-工作端PC和运营端用不分页
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dto.GuideCategoryDTO>>
* @author yinzuomei
* @date 2021/9/8 1:33 下午
*/
@PostMapping("page")
public Result<PageData<GuideCategoryDTO>> page(@RequestBody GuideCategoryPageFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GuideCategoryPageFormDTO.AddUserInternalGroup.class);
PageData<GuideCategoryDTO> page = guideCategoryService.page(formDTO);
return new Result<PageData<GuideCategoryDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<GuideCategoryDTO> get(@PathVariable("id") String id){
GuideCategoryDTO data = guideCategoryService.get(id);
return new Result<GuideCategoryDTO>().ok(data);
/**
* 办事指南可用分类列表 新增编辑指南时的下拉框展示未禁用的分类 查询指南列表如果禁用的分类下存在指南列表则展示不存在直接不展示
*
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.GuideDictResDTO>>
* @author yinzuomei
* @date 2021/9/8 2:47 下午
*/
@PostMapping("getcategory")
public Result<List<GuideDictResDTO>> getCategory(@LoginUser TokenDto tokenDto,@RequestBody GuideCategoryDropDownFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,GuideCategoryDropDownFormDTO.AddUserInternalGroup.class);
return new Result<List<GuideDictResDTO>>().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<GuideCategoryDTO> save(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.SaveInfoGroup.class);
return new Result<GuideCategoryDTO>().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<GuideCategoryDTO> update(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.UpdateInfoGroup.class);
return new Result<GuideCategoryDTO>().ok(guideCategoryService.update(formDTO));
}
}

65
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;
/**
* 指南分类
@ -30,4 +35,64 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface GuideCategoryDao extends BaseDao<GuideCategoryEntity> {
/**
* 工作端PC或者运营端分类列表查询不分页
*
* @param customerId
* @return java.util.List<com.epmet.dto.GuideCategoryDTO>
* @author yinzuomei
* @date 2021/9/8 1:57 下午
*/
List<GuideCategoryDTO> selectPageByCid(String customerId);
/**
* 办事指南可用分类列表 新增编辑指南时的下拉框展示未禁用的分类 查询指南列表如果禁用的分类下存在指南列表则展示不存在直接不展示
*
* @param customerId
* @param queryOrigin
* @return java.util.List<com.epmet.dto.result.GuideDictResDTO>
* @author yinzuomei
* @date 2021/9/8 3:15 下午
*/
List<GuideDictResDTO> 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);
}

14
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)
@ -39,15 +36,20 @@ public class GuideCategoryEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
* 客户id产品默认配置此列存储default
*/
private String customerId;
/**
* 分类名
* 分类名,客户内唯一
*/
private String categoryName;
/**
* 分类编码分类名的全拼; eggongjijin
*/
private String categoryCode;
/**
* 排序
*/

67
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<GuideCategoryEntity> {
/**
* 默认分页
* 办事指南分类列表-工作端PC和运营端用不分页
*
* @param params
* @return PageData<GuideCategoryDTO>
* @author generator
* @date 2021-09-06
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dto.GuideCategoryDTO>>
* @author yinzuomei
* @date 2021/9/8 1:33 下午
*/
PageData<GuideCategoryDTO> page(Map<String, Object> params);
PageData<GuideCategoryDTO> page(GuideCategoryPageFormDTO formDTO);
/**
* 默认查询
* 办事指南可用分类列表 新增编辑指南时的下拉框展示未禁用的分类 查询指南列表如果禁用的分类下存在指南列表则展示不存在直接不展示
*
* @param params
* @return java.util.List<GuideCategoryDTO>
* @author generator
* @date 2021-09-06
* @param formDTO
* @return java.util.List<com.epmet.dto.result.GuideDictResDTO>
* @author yinzuomei
* @date 2021/9/8 3:06 下午
*/
List<GuideCategoryDTO> list(Map<String, Object> params);
List<GuideDictResDTO> 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 下午
*/
GuideCategoryDTO get(String id);
void saveOrder(GuideCateOrderFormDTO formDTO);
/**
* 启用或者禁用分类
*
* @param formDTO
* @return int
* @author yinzuomei
* @date 2021/9/8 4:20 下午
*/
void disableGuideCategory(EditGuideCategoryFormDTO formDTO);
/**
* 默认保存
@ -71,7 +86,7 @@ public interface GuideCategoryService extends BaseService<GuideCategoryEntity> {
* @author generator
* @date 2021-09-06
*/
void save(GuideCategoryDTO dto);
GuideCategoryDTO save(EditGuideCategoryFormDTO dto);
/**
* 默认更新
@ -81,15 +96,15 @@ public interface GuideCategoryService extends BaseService<GuideCategoryEntity> {
* @author generator
* @date 2021-09-06
*/
void update(GuideCategoryDTO dto);
GuideCategoryDTO update(EditGuideCategoryFormDTO dto);
/**
* 批量删除
* 删除分类存在办事指南的不允许删除给予提示
*
* @param ids
* @param formDTO
* @return void
* @author generator
* @date 2021-09-06
* @author yinzuomei
* @date 2021/9/8 4:34 下午
*/
void delete(String[] ids);
void delete(EditGuideCategoryFormDTO formDTO);
}

9
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java

@ -92,4 +92,13 @@ public interface GuideModuleDictDefaultService extends BaseService<GuideModuleDi
* @date 2021-09-06
*/
void delete(String[] ids);
/**
* 获取默认配置
* @Param
* @Return {@link List< GuideModuleDictDefaultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/8 17:44
*/
List<GuideModuleDictDefaultDTO> getList();
}

10
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<GuideModuleDictEntit
* @date 2021-09-06
*/
void delete(String[] ids);
/**
* @Description 获取模块列表
* @Param customerId
* @Return {@link List< ModuleDTO>}
* @Author zhaoqifeng
* @Date 2021/9/8 17:50
*/
List<ModuleDTO> getModuleList(String customerId);
}

179
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<GuideCategoryDao, GuideCategoryEntity> implements GuideCategoryService {
/**
* 办事指南分类列表-工作端PC和运营端用不分页
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dto.GuideCategoryDTO>>
* @author yinzuomei
* @date 2021/9/8 1:33 下午
*/
@Transactional(rollbackFor = Exception.class)
@Override
public PageData<GuideCategoryDTO> page(GuideCategoryPageFormDTO formDTO) {
List<GuideCategoryDTO> list = baseDao.selectPageByCid(formDTO.getCustomerId());
if (CollectionUtils.isEmpty(list) && !formDTO.getCustomerId().equals(Constant.DEFAULT_CUSTOMER)) {
//初始化默认的给客户
initCustomerGuideCategory(formDTO.getCustomerId());
list = baseDao.selectPageByCid(formDTO.getCustomerId());
}
PageInfo<GuideCategoryDTO> 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<GuideCategoryDTO> 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<com.epmet.dto.result.GuideDictResDTO>
* @author yinzuomei
* @date 2021/9/8 3:06 下午
*/
@Override
public PageData<GuideCategoryDTO> page(Map<String, Object> params) {
IPage<GuideCategoryEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, GuideCategoryDTO.class);
public List<GuideDictResDTO> getCategory(GuideCategoryDropDownFormDTO formDTO) {
List<GuideDictResDTO> 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;
}
/**
* 保存排序
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/9/8 4:09 下午
*/
@Transactional
@Override
public List<GuideCategoryDTO> list(Map<String, Object> params) {
List<GuideCategoryEntity> entityList = baseDao.selectList(getWrapper(params));
public void saveOrder(GuideCateOrderFormDTO formDTO) {
for (GuideCateOrderFormDTO.OrderIndexDTO idx : formDTO.getOrderList()) {
baseDao.updateOrder(idx.getId(), idx.getOrderIndex(),formDTO.getStaffId());
}
}
return ConvertUtils.sourceToTarget(entityList, GuideCategoryDTO.class);
/**
* 启用或者禁用分类
*
* @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<GuideCategoryEntity> getWrapper(Map<String, Object> params){
@ -70,31 +159,67 @@ public class GuideCategoryServiceImpl extends BaseServiceImpl<GuideCategoryDao,
return wrapper;
}
@Override
public GuideCategoryDTO get(String id) {
GuideCategoryEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, GuideCategoryDTO.class);
}
/**
* 新增分类名称和编码客户内唯一
*
* @param dto
* @return void
* @author yinzuomei
* @date 2021/9/8 5:12 下午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(GuideCategoryDTO dto) {
GuideCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryEntity.class);
public GuideCategoryDTO save(EditGuideCategoryFormDTO dto) {
if (baseDao.selectCategoryName(dto.getCategoryName().trim(), dto.getCustomerId(), null) > 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());
}
}

14
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<GuideModu
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 获取默认配置
*
* @Param
* @Return {@link List< GuideModuleDictDefaultDTO>}
* @Author zhaoqifeng
* @Date 2021/9/8 17:44
*/
@Override
public List<GuideModuleDictDefaultDTO> getList() {
QueryWrapper<GuideModuleDictDefaultEntity> wrapper = new QueryWrapper<>();
return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), GuideModuleDictDefaultDTO.class);
}
}

43
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<GuideModuleDictDao, GuideModuleDictEntity> implements GuideModuleDictService {
@Resource
private GuideModuleDictDefaultService guideModuleDictDefaultService;
@Override
public PageData<GuideModuleDictDTO> page(Map<String, Object> params) {
@ -97,4 +106,38 @@ public class GuideModuleDictServiceImpl extends BaseServiceImpl<GuideModuleDictD
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param customerId
* @Description 获取模块列表
* @Param customerId
* @Return {@link List< ModuleDTO >}
* @Author zhaoqifeng
* @Date 2021/9/8 17:50
*/
@Override
@Transactional(rollbackFor = Exception.class)
public List<ModuleDTO> getModuleList(String customerId) {
LambdaQueryWrapper<GuideModuleDictEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(GuideModuleDictEntity::getCustomerId, customerId);
wrapper.orderByAsc(GuideModuleDictEntity::getSort);
List<GuideModuleDictEntity> list = baseDao.selectList(wrapper);
//结果为空,初始化默认配置
if (CollectionUtils.isEmpty(list)) {
List<GuideModuleDictDefaultDTO> defaultList = guideModuleDictDefaultService.getList();
List<GuideModuleDictEntity> 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());
}
}

3
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<GuideDao, GuideEntity> 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<GuideDao, GuideEntity> 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<GuideDao, GuideEntity> 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())) {

135
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml

@ -3,19 +3,128 @@
<mapper namespace="com.epmet.dao.GuideCategoryDao">
<resultMap type="com.epmet.entity.GuideCategoryEntity" id="guideCategoryMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="categoryName" column="CATEGORY_NAME"/>
<result property="sort" column="SORT"/>
<result property="status" column="STATUS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 工作端PC或者运营端分类列表查询,不分页 -->
<select id="selectPageByCid" parameterType="java.lang.String" resultType="com.epmet.dto.GuideCategoryDTO">
SELECT
gc.ID,
gc.CUSTOMER_ID,
gc.CATEGORY_NAME,
gc.category_code,
gc.SORT,
gc.`STATUS`
FROM
guide_category gc
WHERE
gc.DEL_FLAG = '0'
AND gc.CUSTOMER_ID =#{customerId}
ORDER BY
gc.SORT ASC
</select>
<!-- 新增指南:saveorupdate;查询指南列表:query -->
<select id="selectCategoryDict" parameterType="map" resultType="com.epmet.dto.result.GuideDictResDTO">
SELECT
*
FROM
(
SELECT
gc.CATEGORY_NAME,
gc.category_code,
gc.`STATUS`,
gc.sort,
( SELECT count( g.id ) FROM guide g WHERE g.CUSTOMER_ID = #{customerId} AND g.DEL_FLAG = '0' AND g.CATEGORY_CODE = gc.CATEGORY_CODE ) AS guideTotal
FROM
guide_category gc
WHERE
gc.DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
) temp
<if test="queryOrigin == 'saveorupdate' ">
WHERE temp.`STATUS` = 'enable'
</if>
<if test="queryOrigin == 'query' ">
WHERE temp.`STATUS` = 'enable'
OR ( temp.`STATUS` = 'disable' AND temp.guideTotal > 0 )
</if>
ORDER BY
temp.sort ASC
</select>
<!-- 保存排序-->
<update id="updateOrder" parameterType="map">
update guide_category
set SORT=#{orderIndex},
UPDATED_BY=#{staffId},
UPDATED_TIME=NOW()
where id=#{id}
and del_flag='0'
</update>
<!-- 启用或者禁用-->
<update id="updateStatus" parameterType="map">
update guide_category
set status=#{status},
UPDATED_BY=#{staffId},
UPDATED_TIME=NOW()
where id=#{id}
and del_flag='0'
</update>
<!-- 查询分类下的办事指南数量-->
<select id="selectGuideTotal" parameterType="map" resultType="int">
SELECT
count( id ) AS total
FROM
guide g
WHERE
g.DEL_FLAG = '0'
AND g.CUSTOMER_ID = #{customerId}
AND g.CATEGORY_CODE =(
SELECT
gc.CATEGORY_CODE
FROM
guide_category gc
WHERE
gc.DEL_FLAG = '0'
AND gc.id = #{id}
)
</select>
<select id="selectCategoryName" parameterType="map" resultType="int">
SELECT
count( gc.id )
FROM
guide_category gc
WHERE
gc.DEL_FLAG = '0'
AND gc.CUSTOMER_ID = #{customerId}
AND gc.CATEGORY_NAME = #{categoryName}
<if test='null != excludeId and excludeId != ""'>
AND gc.id !=#{excludeId}
</if>
</select>
<select id="selectCategoryCode" parameterType="map" resultType="int">
SELECT
count( gc.id )
FROM
guide_category gc
WHERE
gc.DEL_FLAG = '0'
AND gc.CUSTOMER_ID = #{customerId}
AND gc.CATEGORY_CODE = #{categoryCode}
<if test='null != excludeId and excludeId != ""'>
AND gc.id !=#{excludeId}
</if>
</select>
<select id="selectCurrentOrder" parameterType="java.lang.String" resultType="int">
SELECT
ifnull(max(gc.SORT),0) as num
FROM
guide_category gc
WHERE
gc.DEL_FLAG = '0'
AND gc.CUSTOMER_ID =#{customerId}
</select>
</mapper>

7
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;
/**
* 工作人员的所有角色key09.08新增工作端PC端用到了
*/
private List<String> roleList;
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -198,6 +198,14 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
*/
BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO);
/**
* @Description 查询用户名字
* @Param userIds
* @author zxc
* @date 2021/6/9 1:36 下午
*/
List<UserNameResultDTO> selectUserName(@Param("userIds")List<String> userIds);
/**
* 通用列表查询
* @param customerId
@ -206,11 +214,5 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
*/
List<CustomerStaffDTO> listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List<String> userIds);
/**
* @Description 查询用户名字
* @Param userIds
* @author zxc
* @date 2021/6/9 1:36 下午
*/
List<UserNameResultDTO> selectUserName(@Param("userIds")List<String> userIds);
List<String> selectStaffRoles(@Param("userId") String userId,@Param("customerId") String customerId);
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -703,6 +703,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
@Override
public Result<StaffBasicInfoResultDTO> selectStaffBasicInfo(String userId) {
StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId);
if(null!=resultDTO){
resultDTO.setRoleList(baseDao.selectStaffRoles(userId,resultDTO.getCustomerId()));
}
return new Result<StaffBasicInfoResultDTO>().ok(resultDTO);
}

10
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -416,4 +416,14 @@
)
</select>
<select id="selectStaffRoles" parameterType="map" resultType="java.lang.String">
select distinct gsr.ROLE_KEY from gov_staff_role gsr
where gsr.DEL_FLAG='0'
AND GSR.CUSTOMER_ID=#{customerId}
AND gsr.id in(
select sr.ROLE_ID from staff_role sr
where sr.DEL_FLAG='0'
and sr.STAFF_ID=#{userId}
)
</select>
</mapper>

Loading…
Cancel
Save