yinzuomei 4 years ago
parent
commit
0fe294e7dc
  1. 6
      epmet-commons/epmet-commons-tools/pom.xml
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 13
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java
  6. 10
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java
  7. 49
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java
  8. 6
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java
  9. 4
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java
  10. 42
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java
  11. 37
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml
  12. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
  13. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  14. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  15. 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>

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -75,6 +75,7 @@ public enum EpmetErrorCode {
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

10
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java

@ -24,23 +24,25 @@ public class EditGuideCategoryFormDTO implements Serializable {
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)
@NotBlank(message = "客户id不能为空",groups = {DelGroup.class,UpdateInfoGroup.class,SaveInfoGroup.class})
private String customerId;
@NotBlank(message = "id不能为空", groups = AddUserInternalGroup.class)
@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)
@Length(max = 10, message = "分类名称最多填入10个字", groups = UpdateInfoGroup.class)
@NotBlank(message = "分类名称不能为空不能为空", groups = {UpdateInfoGroup.class,SaveInfoGroup.class})
@Length(max = 10, message = "分类名称最多填入10个字", groups = {UpdateInfoGroup.class,SaveInfoGroup.class})
private String categoryName;
}

49
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java

@ -22,9 +22,6 @@ 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.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;
@ -33,7 +30,10 @@ 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.List;
@ -111,7 +111,7 @@ public class GuideCategoryController {
@PostMapping("disable")
public Result disable(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.StatusGroup.class);
ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.StatusGroup.class,EditGuideCategoryFormDTO.AddUserInternalGroup.class);
guideCategoryService.disableGuideCategory(formDTO);
return new Result();
}
@ -134,19 +134,38 @@ public class GuideCategoryController {
}
@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 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);
guideCategoryService.save(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 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);
guideCategoryService.update(formDTO);
return new Result();
}

6
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java

@ -89,4 +89,10 @@ public interface GuideCategoryDao extends BaseDao<GuideCategoryEntity> {
* @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);
}

4
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java

@ -86,7 +86,7 @@ public interface GuideCategoryService extends BaseService<GuideCategoryEntity> {
* @author generator
* @date 2021-09-06
*/
void save(GuideCategoryDTO dto);
void save(EditGuideCategoryFormDTO dto);
/**
* 默认更新
@ -96,7 +96,7 @@ public interface GuideCategoryService extends BaseService<GuideCategoryEntity> {
* @author generator
* @date 2021-09-06
*/
void update(GuideCategoryDTO dto);
void update(EditGuideCategoryFormDTO dto);
/**
* 删除分类存在办事指南的不允许删除给予提示

42
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java

@ -25,6 +25,7 @@ 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;
@ -158,20 +159,49 @@ public class GuideCategoryServiceImpl extends BaseServiceImpl<GuideCategoryDao,
return wrapper;
}
/**
* 新增分类名称和编码客户内唯一
*
* @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 void 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);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(GuideCategoryDTO dto) {
GuideCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryEntity.class);
updateById(entity);
public void 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);
}
/**
* 删除分类存在办事指南的不允许删除给予提示
*

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

@ -90,4 +90,41 @@
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;
}

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

@ -213,4 +213,6 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @return
*/
List<CustomerStaffDTO> listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @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