@@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig { | |||
} | |||
public static void main(String[] args) { | |||
generate("Liuxinxin", "organization", PATH_LXX, "gov_business_strip"); | |||
generate("Liuxinxin", "expert", PATH_LXX, "expert_sensitive_info_modify_detail_record"); | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
package com.ningdatech.pmapi.common.model; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import lombok.Data; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 下午4:34 | |||
*/ | |||
@Data | |||
public class ExpertRegionModifyDiffBO { | |||
private List<ExpertRegionInfo> addList; | |||
private List<ExpertRegionInfo> removeList; | |||
} |
@@ -0,0 +1,39 @@ | |||
package com.ningdatech.pmapi.common.util; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo; | |||
import java.util.Comparator; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 下午2:14 | |||
*/ | |||
public class DictUtils { | |||
public static Boolean isValueEquals(List<DictionaryFieldInfo> list1, List<DictionaryFieldInfo> list2) { | |||
if (CollUtil.isEmpty(list1) && CollUtil.isEmpty(list2)) { | |||
return true; | |||
} | |||
boolean collectionStatusNotEquals = (CollUtil.isEmpty(list1) && CollUtil.isNotEmpty(list2)) | |||
|| (CollUtil.isEmpty(list2) && CollUtil.isNotEmpty(list1)); | |||
if (collectionStatusNotEquals) { | |||
return false; | |||
} | |||
if (list1.size() != list2.size()) { | |||
return false; | |||
} | |||
list1.sort(Comparator.comparing(DictionaryFieldInfo::getDictionaryFieldName).thenComparing(DictionaryFieldInfo::getDictionaryCode)); | |||
list2.sort(Comparator.comparing(DictionaryFieldInfo::getDictionaryFieldName).thenComparing(DictionaryFieldInfo::getDictionaryCode)); | |||
for (int i = 0; i < list1.size(); i++) { | |||
if (!StrUtils.trimEquals(list1.get(i).getDictionaryFieldName(), list2.get(i).getDictionaryFieldName()) | |||
|| !StrUtils.trimEquals(list1.get(i).getDictionaryCode(), list2.get(i).getDictionaryCode())) { | |||
return false; | |||
} | |||
} | |||
return true; | |||
} | |||
} |
@@ -0,0 +1,73 @@ | |||
package com.ningdatech.pmapi.common.util; | |||
import com.ningdatech.pmapi.common.model.ExpertRegionModifyDiffBO; | |||
import com.ningdatech.pmapi.expert.model.RegionDtoMapKey; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 下午4:33 | |||
*/ | |||
public class ExpertRegionInfoUtils { | |||
public static ExpertRegionModifyDiffBO modifyDiff(List<ExpertRegionInfo> beforeList, List<ExpertRegionInfo> afterList) { | |||
ExpertRegionModifyDiffBO expertRegionModifyDiffBO = new ExpertRegionModifyDiffBO(); | |||
List<ExpertRegionInfo> addList = new ArrayList<>(); | |||
List<ExpertRegionInfo> removeList = new ArrayList<>(); | |||
if (CollectionUtils.isEmpty(beforeList) && CollectionUtils.isEmpty(afterList)) { | |||
expertRegionModifyDiffBO.setAddList(addList); | |||
expertRegionModifyDiffBO.setRemoveList(removeList); | |||
return expertRegionModifyDiffBO; | |||
} else if (CollectionUtils.isEmpty(beforeList)) { | |||
expertRegionModifyDiffBO.setAddList(afterList); | |||
expertRegionModifyDiffBO.setRemoveList(removeList); | |||
return expertRegionModifyDiffBO; | |||
} else if (CollectionUtils.isEmpty(afterList)) { | |||
expertRegionModifyDiffBO.setAddList(addList); | |||
expertRegionModifyDiffBO.setRemoveList(beforeList); | |||
return expertRegionModifyDiffBO; | |||
} | |||
List<RegionDtoMapKey> beforeRegionDtoMapKeyList = beforeList.stream().map(r -> { | |||
RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); | |||
regionDtoMapKey.setRegionLevel(r.getRegionLevel()); | |||
regionDtoMapKey.setRegionCode(r.getRegionCode()); | |||
return regionDtoMapKey; | |||
}).collect(Collectors.toList()); | |||
List<RegionDtoMapKey> afterRegionDtoMapKeyList = afterList.stream().map(r -> { | |||
RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); | |||
regionDtoMapKey.setRegionLevel(r.getRegionLevel()); | |||
regionDtoMapKey.setRegionCode(r.getRegionCode()); | |||
return regionDtoMapKey; | |||
}).collect(Collectors.toList()); | |||
for (RegionDtoMapKey key : beforeRegionDtoMapKeyList) { | |||
if (!afterRegionDtoMapKeyList.contains(key)) { | |||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||
expertRegionInfo.setRegionCode(key.getRegionCode()); | |||
expertRegionInfo.setRegionLevel(key.getRegionLevel()); | |||
removeList.add(expertRegionInfo); | |||
} | |||
} | |||
for (RegionDtoMapKey key : afterRegionDtoMapKeyList) { | |||
if (!beforeRegionDtoMapKeyList.contains(key)) { | |||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||
expertRegionInfo.setRegionCode(key.getRegionCode()); | |||
expertRegionInfo.setRegionLevel(key.getRegionLevel()); | |||
addList.add(expertRegionInfo); | |||
} | |||
} | |||
expertRegionModifyDiffBO.setAddList(addList); | |||
expertRegionModifyDiffBO.setRemoveList(removeList); | |||
return expertRegionModifyDiffBO; | |||
} | |||
} |
@@ -0,0 +1,89 @@ | |||
package com.ningdatech.pmapi.common.util; | |||
import java.io.ByteArrayInputStream; | |||
import java.io.ByteArrayOutputStream; | |||
import java.io.IOException; | |||
import java.util.zip.GZIPInputStream; | |||
import java.util.zip.GZIPOutputStream; | |||
/** | |||
* <p> | |||
* 压缩为Gzip | |||
* </p> | |||
* | |||
* @author WendyYang | |||
*/ | |||
public class GzipUtils { | |||
/** | |||
* 使用gzip进行压缩 | |||
*/ | |||
public static String compress(String primStr) { | |||
if (primStr == null || primStr.length() == 0) { | |||
return primStr; | |||
} | |||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |||
GZIPOutputStream gzip = null; | |||
try { | |||
gzip = new GZIPOutputStream(out); | |||
gzip.write(primStr.getBytes()); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
} finally { | |||
if (gzip != null) { | |||
try { | |||
gzip.close(); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
} | |||
} | |||
} | |||
return new sun.misc.BASE64Encoder().encode(out.toByteArray()); | |||
} | |||
/** | |||
* 使用gzip进行解压缩 | |||
*/ | |||
public static String uncompress(String compressedStr) { | |||
if (compressedStr == null) { | |||
return null; | |||
} | |||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |||
ByteArrayInputStream in = null; | |||
GZIPInputStream ginzip = null; | |||
byte[] compressed = null; | |||
String decompressed = null; | |||
try { | |||
compressed = new sun.misc.BASE64Decoder().decodeBuffer(compressedStr); | |||
in = new ByteArrayInputStream(compressed); | |||
ginzip = new GZIPInputStream(in); | |||
byte[] buffer = new byte[1024]; | |||
int offset = -1; | |||
while ((offset = ginzip.read(buffer)) != -1) { | |||
out.write(buffer, 0, offset); | |||
} | |||
decompressed = out.toString(); | |||
} catch (IOException e) { | |||
e.printStackTrace(); | |||
} finally { | |||
if (ginzip != null) { | |||
try { | |||
ginzip.close(); | |||
} catch (IOException e) { | |||
} | |||
} | |||
if (in != null) { | |||
try { | |||
in.close(); | |||
} catch (IOException e) { | |||
} | |||
} | |||
try { | |||
out.close(); | |||
} catch (IOException e) { | |||
} | |||
} | |||
return decompressed; | |||
} | |||
} |
@@ -0,0 +1,44 @@ | |||
package com.ningdatech.pmapi.common.util; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import java.util.Comparator; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 下午2:27 | |||
*/ | |||
public class RegionUtils { | |||
public static Boolean isValueEquals(ExpertRegionInfo regionInfo1, ExpertRegionInfo regionInfo2) { | |||
return regionInfo1.getRegionCode().equals(regionInfo2.getRegionCode()) | |||
&& regionInfo1.getRegionLevel().equals(regionInfo2.getRegionLevel()); | |||
} | |||
public static Boolean isValueEquals(List<ExpertRegionInfo> list1, List<ExpertRegionInfo> list2) { | |||
if (CollectionUtils.isEmpty(list1) && CollectionUtils.isEmpty(list2)) { | |||
return true; | |||
} | |||
boolean collectionStatusNotEquals = (CollectionUtils.isEmpty(list1) && CollectionUtils.isNotEmpty(list2)) | |||
|| (CollectionUtils.isEmpty(list2) && CollectionUtils.isNotEmpty(list1)); | |||
if (collectionStatusNotEquals) { | |||
return false; | |||
} | |||
if (list1.size() != list2.size()) { | |||
return false; | |||
} | |||
list1.sort(Comparator.comparing(ExpertRegionInfo::getRegionCode).thenComparing(ExpertRegionInfo::getRegionLevel)); | |||
list2.sort(Comparator.comparing(ExpertRegionInfo::getRegionCode).thenComparing(ExpertRegionInfo::getRegionLevel)); | |||
for (int i = 0; i < list1.size(); i++) { | |||
if (!StrUtils.trimEquals(list1.get(i).getRegionCode(), list2.get(i).getRegionCode()) | |||
|| !list1.get(i).getRegionLevel().equals(list2.get(i).getRegionLevel())) { | |||
return false; | |||
} | |||
} | |||
return true; | |||
} | |||
} |
@@ -26,4 +26,15 @@ public class StrUtils extends StrUtil { | |||
return split(str, StrPool.COMMA); | |||
} | |||
public static boolean trimEquals(String str1, String str2) { | |||
if (isNotBlank(str1)) { | |||
str1 = str1.trim(); | |||
} | |||
if (isNotBlank(str2)) { | |||
str2 = str2.trim(); | |||
} | |||
return equals(str1, str2); | |||
} | |||
} |
@@ -0,0 +1,42 @@ | |||
package com.ningdatech.pmapi.common.util; | |||
import com.ningdatech.pmapi.expert.model.TagFieldInfo; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import java.util.Comparator; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 下午2:14 | |||
*/ | |||
public class TagUtils { | |||
private TagUtils() { | |||
} | |||
public static Boolean isValueEquals(List<TagFieldInfo> list1, List<TagFieldInfo> list2) { | |||
if (CollectionUtils.isEmpty(list1) && CollectionUtils.isEmpty(list2)) { | |||
return true; | |||
} | |||
boolean collectionStatusNotEquals = (CollectionUtils.isEmpty(list1) && CollectionUtils.isNotEmpty(list2)) | |||
|| (CollectionUtils.isEmpty(list2) && CollectionUtils.isNotEmpty(list1)); | |||
if (collectionStatusNotEquals) { | |||
return false; | |||
} | |||
if (list1.size() != list2.size()) { | |||
return false; | |||
} | |||
list1.sort(Comparator.comparing(TagFieldInfo::getTagFieldName).thenComparing(TagFieldInfo::getTagCode)); | |||
list2.sort(Comparator.comparing(TagFieldInfo::getTagFieldName).thenComparing(TagFieldInfo::getTagCode)); | |||
for (int i = 0; i < list1.size(); i++) { | |||
if (!StrUtils.trimEquals(list1.get(i).getTagFieldName(), list2.get(i).getTagFieldName()) | |||
|| !StrUtils.trimEquals(list1.get(i).getTagCode(), list2.get(i).getTagCode())) { | |||
return false; | |||
} | |||
} | |||
return true; | |||
} | |||
} |
@@ -1,8 +1,11 @@ | |||
package com.ningdatech.pmapi.expert.assembler; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import com.ningdatech.pmapi.expert.model.*; | |||
import com.ningdatech.pmapi.expert.model.bo.ExpertInfoSensitiveFieldCheckBO; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertInfoModifyCmd; | |||
import com.ningdatech.pmapi.expert.model.dto.*; | |||
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; | |||
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; | |||
@@ -221,4 +224,38 @@ public class ExpertInfoCmdAssembler { | |||
return expertUserFullInfoDTO; | |||
} | |||
public static ExpertInfoModifyCmd buildExpertInfoModifyCmd(Long userId | |||
, ExpertBasicInfo expertBasicInfo, ExpertEduInfo expertEduInfo | |||
, ExpertJobInfo expertJobInfo, ExpertProfessionalInfo expertProfessionalInfo | |||
, ExpertRecommendInfo recommendInfo | |||
, ExpertOtherInfo otherInfo | |||
, ExpertInfoSensitiveFieldCheckBO expertInfoSensitiveFieldCheckBO | |||
, ModifyApplyExtraInfo modifyApplyExtraInfo) { | |||
ExpertInfoModifyCmd expertInfoModifyCmd = new ExpertInfoModifyCmd(); | |||
ExpertUserFullInfoDTO expertUserInfoDTO = buildExpertUserFullInfoDTO(expertBasicInfo, expertEduInfo, expertJobInfo, expertProfessionalInfo, recommendInfo, otherInfo); | |||
List<ExpertDictionaryDTO> expertDictionaryList = buildExpertDictionaryList(expertBasicInfo, expertEduInfo, expertJobInfo, expertProfessionalInfo, recommendInfo); | |||
List<ExpertTagDTO> expertTagList = buildExpertTagList(expertProfessionalInfo, expertBasicInfo, otherInfo); | |||
// 专家履职意向(区域编码) | |||
List<ExpertRegionDTO> expertIntentionWorkRegionInfo = buildExpertRegionList(expertBasicInfo); | |||
List<ExpertAvoidCompanyDTO> expertAvoidCompanyList = buildExpertAvoidCompanyList(expertProfessionalInfo); | |||
if (Objects.nonNull(modifyApplyExtraInfo)) { | |||
ModifyApplyExtraInfoDTO modifyApplyExtraInfoDTO = new ModifyApplyExtraInfoDTO(); | |||
modifyApplyExtraInfoDTO.setEvidenceList(modifyApplyExtraInfo.getEvidenceList()); | |||
modifyApplyExtraInfoDTO.setFactSheet(modifyApplyExtraInfo.getFactSheet()); | |||
expertInfoModifyCmd.setModifyApplyExtraInfo(modifyApplyExtraInfoDTO); | |||
} | |||
expertInfoModifyCmd.setUserId(userId); | |||
expertInfoModifyCmd.setExpertUserInfoDTO(expertUserInfoDTO); | |||
expertInfoModifyCmd.setExpertDictionaryList(expertDictionaryList); | |||
expertInfoModifyCmd.setExpertTagList(expertTagList); | |||
expertInfoModifyCmd.setExpertIntentionWorkRegionInfo(expertIntentionWorkRegionInfo); | |||
expertInfoModifyCmd.setExpertAvoidCompanyList(expertAvoidCompanyList); | |||
expertInfoModifyCmd.setExpertInfoSensitiveFieldCheckBO(expertInfoSensitiveFieldCheckBO); | |||
return expertInfoModifyCmd; | |||
} | |||
} |
@@ -1,26 +1,10 @@ | |||
package com.ningdatech.pmapi.expert.assembler; | |||
//import com.ningdatech.emapi.common.enumeration.BoolDisplayEnum; | |||
//import com.ningdatech.emapi.common.helper.RegionCache; | |||
//import com.ningdatech.emapi.common.utils.JSONObject; | |||
//import com.ningdatech.emapi.expert.constants.DictExpertInfoTypeEnum; | |||
//import com.ningdatech.emapi.expert.constants.ExpertApplyTypeEnum; | |||
//import com.ningdatech.emapi.expert.constants.ExpertTagEnum; | |||
//import com.ningdatech.emapi.expert.entity.*; | |||
//import com.ningdatech.emapi.expert.entity.domain.*; | |||
//import com.ningdatech.emapi.expert.entity.dto.*; | |||
//import com.ningdatech.emapi.expert.entity.vo.ExpertFullInfoVO; | |||
//import com.ningdatech.emapi.sys.file.entity.FileBasicInfo; | |||
//import com.ningdatech.emapi.sys.file.entity.vo.result.AttachFileVo; | |||
//import com.ningdatech.emapi.sys.meta.entity.RegionDtoMapKey; | |||
//import com.ningdatech.emapi.sys.meta.entity.dto.DictionaryDTO; | |||
//import com.ningdatech.emapi.sys.meta.entity.dto.TagDTO; | |||
//import com.ningdatech.emapi.sys.meta.helper.DictionaryCache; | |||
//import com.ningdatech.emapi.sys.meta.helper.TagCache; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | |||
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; | |||
import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; | |||
import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; | |||
@@ -0,0 +1,28 @@ | |||
package com.ningdatech.pmapi.expert.constant; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 上午11:19 | |||
*/ | |||
@AllArgsConstructor | |||
@Getter | |||
public enum ExpertSensitiveFieldTypeEnum { | |||
/** | |||
* 专家敏感信息修改 | |||
*/ | |||
expert_sensitive_info_field, | |||
/** | |||
* 专家层级修改 | |||
*/ | |||
expert_region_field, | |||
/** | |||
* 专家履职意向修改 | |||
*/ | |||
expert_intention_field; | |||
} |
@@ -0,0 +1,67 @@ | |||
package com.ningdatech.pmapi.expert.constant; | |||
import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo; | |||
import com.ningdatech.pmapi.expert.model.TagFieldInfo; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/27 下午3:34 | |||
* 专家修改信息需要审核的字段 | |||
*/ | |||
@AllArgsConstructor | |||
@Getter | |||
public enum ExpertUserInfoSensitiveFieldEnum { | |||
// 手机号码 | |||
phone_no("phone_no", "手机号码", String.class, UnitType.single), | |||
// 电子邮箱 | |||
email("email", "电子邮箱", String.class, UnitType.single), | |||
// 专家层级 | |||
expert_region("expert_region", "专家层级", ExpertRegionInfo.class, UnitType.single), | |||
// 履职意向 | |||
expert_intention_work_region("expert_intention_work_region", "履职意向", ExpertRegionInfo.class, UnitType.list), | |||
// 工作单位(单位code和单位法人编号是关联的) | |||
company("company", "工作单位", String.class, UnitType.single), | |||
legal_entity_code("legal_entity_code", "单位法人编号", String.class, UnitType.single), | |||
// 行政职级 | |||
administrative_rank("administrative_rank", "行政职级", DictionaryFieldInfo.class, UnitType.list), | |||
// 职称级别 | |||
title_level("title_level", "职称级别", DictionaryFieldInfo.class, UnitType.list), | |||
// 擅长方向 | |||
good_at("good_at", "擅长方向", TagFieldInfo.class, UnitType.list), | |||
// 技术专长 | |||
technical_expertise("technical_expertise", "技术专长", TagFieldInfo.class, UnitType.list), | |||
// 行业领域 | |||
industry_sector("industry_sector", "行业领域", TagFieldInfo.class, UnitType.list), | |||
// 其他标签 | |||
other("other", "其他标签", TagFieldInfo.class, UnitType.list); | |||
private final String key; | |||
private final String value; | |||
private final Class aClass; | |||
private final UnitType type; | |||
public static List<String> getSensitiveDictionaryList() { | |||
return Arrays.asList(administrative_rank.name(), title_level.name()); | |||
} | |||
@AllArgsConstructor | |||
public enum UnitType { | |||
/** | |||
* 单个 | |||
*/ | |||
single, | |||
/** | |||
* list | |||
*/ | |||
list; | |||
} | |||
} |
@@ -5,8 +5,10 @@ import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.pmapi.expert.manage.ExpertAdminManage; | |||
import com.ningdatech.pmapi.expert.manage.ExpertManage; | |||
import com.ningdatech.pmapi.expert.model.ExpertAdminExpertManageQuery; | |||
import com.ningdatech.pmapi.expert.model.req.AdminExpertBasicInfoModifyRequest; | |||
import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest; | |||
import com.ningdatech.pmapi.expert.model.vo.ExpertAdminExpertManageListVO; | |||
import com.ningdatech.pmapi.expert.model.vo.ExpertBasicInfoModifyResultVO; | |||
import com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
@@ -51,4 +53,10 @@ public class ExpertController { | |||
return expertAdminManage.getExpertLibraryList(expertAdminExpertManageQuery); | |||
} | |||
@PostMapping("/basic-info-modify") | |||
@ApiOperation("专家信息编辑") | |||
public ExpertBasicInfoModifyResultVO expertBasicInfoModify(@Valid @RequestBody AdminExpertBasicInfoModifyRequest request) { | |||
// ExpertUserInfoValidator.expertBasicInfoModifyRequestValidate(request); | |||
return expertAdminManage.adminModifyExpertBasicInfo(request); | |||
} | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.ningdatech.pmapi.expert.controller; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.stereotype.Controller; | |||
/** | |||
* <p> | |||
* 前端控制器 | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
@Controller | |||
@RequestMapping("/pmapi.expert/expert-sensitive-info-modify-detail-record") | |||
public class ExpertSensitiveInfoModifyDetailRecordController { | |||
} |
@@ -0,0 +1,41 @@ | |||
package com.ningdatech.pmapi.expert.entity; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
/** | |||
* <p> | |||
* | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
@Data | |||
@TableName("expert_sensitive_info_modify_detail_record") | |||
@ApiModel(value = "ExpertSensitiveInfoModifyDetailRecord对象", description = "") | |||
public class ExpertSensitiveInfoModifyDetailRecord implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
private Long id; | |||
private LocalDateTime createOn; | |||
private LocalDateTime updateOn; | |||
private Long userId; | |||
private String originalJson; | |||
private String modifyJson; | |||
private Long metaApplyId; | |||
private String extraMaterial; | |||
} |
@@ -0,0 +1,162 @@ | |||
package com.ningdatech.pmapi.expert.helper; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | |||
import com.ningdatech.file.service.FileService; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; | |||
import com.ningdatech.pmapi.expert.constant.ExpertSensitiveFieldTypeEnum; | |||
import com.ningdatech.pmapi.expert.constant.ExpertUserInfoSensitiveFieldEnum; | |||
import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; | |||
import com.ningdatech.pmapi.expert.model.*; | |||
import com.ningdatech.pmapi.expert.model.bo.ExpertInfoSensitiveFieldCheckBO; | |||
import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO; | |||
import com.ningdatech.pmapi.expert.model.dto.ExpertUserFullInfoDTO; | |||
import com.ningdatech.pmapi.expert.service.ExpertInfoService; | |||
import com.ningdatech.pmapi.expert.service.IExpertIntentionWorkRegionService; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Objects; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 上午10:09 | |||
*/ | |||
@Component | |||
@RequiredArgsConstructor | |||
public class ExpertInfoSensitiveFieldModifyCheckHelper { | |||
private final ExpertInfoService expertInfoService; | |||
private final ExpertInfoCommonHelper expertInfoCommonHelper; | |||
private final FileService fileService; | |||
private final ExpertUserInfoAssembler expertUserInfoAssembler; | |||
private final IExpertIntentionWorkRegionService iExpertIntentionWorkRegionService; | |||
public ExpertInfoSensitiveFieldCheckBO expertInfoSensitiveFieldModifyCheck(ExpertBasicInfo applyBasicInfo | |||
, ExpertEduInfo applyEduInfo, ExpertJobInfo applyJobInfo, ExpertProfessionalInfo applyProfessionalInfo, Long expertUserId) { | |||
ExpertFullInfoAllDTO expertUserFullInfoAll = expertInfoService.getExpertUserFullInfoAll(expertUserId); | |||
if (Objects.isNull(expertUserFullInfoAll)) { | |||
throw new BizException("当前账号尚未有专家相关信息,无法更新"); | |||
} | |||
List<AttachFileVo> attachFiles = fileService.getByIds(expertInfoCommonHelper.getExpertFileIdList(expertUserFullInfoAll)); | |||
ExpertUserFullInfoDTO expertUserInfoDTO = expertUserFullInfoAll.getExpertUserInfoDTO(); | |||
// 字典字典段map | |||
Map<String, List<DictionaryFieldInfo>> dictionaryFieldInfoMap = | |||
expertUserInfoAssembler.buildDictionaryFieldInfoMap(expertUserFullInfoAll.getExpertDictionaryList()); | |||
// 专家文件资料map | |||
Map<Long, FileBasicInfo> fileBasicInfoMap = ExpertUserInfoAssembler.buildFileBasicInfoMap(attachFiles); | |||
// 专家标签字段map | |||
Map<String, List<TagFieldInfo>> tagFieldInfoMap = expertUserInfoAssembler.buildTagFieldInfoMap(expertUserFullInfoAll.getExpertTagList()); | |||
ExpertBasicInfo originalBasicInfo = expertUserInfoAssembler | |||
.buildExpertBasicInfo(expertUserInfoDTO, dictionaryFieldInfoMap | |||
, tagFieldInfoMap, expertUserFullInfoAll.getExpertIntentionWorkRegionInfo(), fileBasicInfoMap); | |||
ExpertJobInfo originalJobInfo = ExpertUserInfoAssembler.buildExpertJobInfo(expertUserInfoDTO, dictionaryFieldInfoMap); | |||
ExpertProfessionalInfo originalProfessionalInfo = ExpertUserInfoAssembler.buildExpertProfessionalInfo(expertUserInfoDTO | |||
, dictionaryFieldInfoMap, tagFieldInfoMap, fileBasicInfoMap, expertUserFullInfoAll.getExpertAvoidCompanyList()); | |||
// 敏感字段 手机号/电子邮箱/专家层级/履职意向/工作单位/单位法人编号/行政职级/职称级别/擅长方向/技术专长/行业领域/其他标签 | |||
// 敏感信息字段修改 | |||
List<SensitiveModifySegment> sensitiveModifySegmentList = new ArrayList<>(); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.phone_no | |||
, originalBasicInfo.getPhoneNo(), applyBasicInfo.getPhoneNo())); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.email | |||
, originalBasicInfo.getEmail(), applyBasicInfo.getEmail())); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.company | |||
, originalJobInfo.getCompany(), applyJobInfo.getCompany())); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.legal_entity_code | |||
, originalJobInfo.getLegalEntityCode(), applyJobInfo.getLegalEntityCode())); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.administrative_rank | |||
, originalJobInfo.getAdministrativeRank() | |||
, assemblerDictionaryFieldInfoList(applyJobInfo.getAdministrativeRank(), ExpertUserInfoSensitiveFieldEnum.administrative_rank.getKey()))); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.title_level | |||
, originalProfessionalInfo.getTitleLevel() | |||
, assemblerDictionaryFieldInfoList(applyProfessionalInfo.getTitleLevel(), ExpertUserInfoSensitiveFieldEnum.title_level.getKey()))); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.good_at | |||
, originalProfessionalInfo.getGoodAt() | |||
, assemblerTagFieldInfoList(applyProfessionalInfo.getGoodAt(), ExpertUserInfoSensitiveFieldEnum.good_at.getKey()))); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.technical_expertise | |||
, originalProfessionalInfo.getTechnicalExpertise() | |||
, assemblerTagFieldInfoList(applyProfessionalInfo.getTechnicalExpertise(), ExpertUserInfoSensitiveFieldEnum.technical_expertise.getKey()))); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.industry_sector | |||
, originalProfessionalInfo.getIndustrySector() | |||
, assemblerTagFieldInfoList(applyProfessionalInfo.getIndustrySector(), ExpertUserInfoSensitiveFieldEnum.industry_sector.getKey()))); | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum.other | |||
, originalProfessionalInfo.getOther() | |||
, assemblerTagFieldInfoList(applyProfessionalInfo.getOther(), ExpertUserInfoSensitiveFieldEnum.other.getKey()))); | |||
// 专家层级修改 | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment(ExpertSensitiveFieldTypeEnum.expert_region_field, ExpertUserInfoSensitiveFieldEnum.expert_region | |||
, originalBasicInfo.getExpertRegionInfo(), applyBasicInfo.getExpertRegionInfo())); | |||
// 履职意向修改 | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment( | |||
ExpertSensitiveFieldTypeEnum.expert_intention_field, ExpertUserInfoSensitiveFieldEnum.expert_intention_work_region | |||
, originalBasicInfo.getExpertIntentionWorkRegions(), applyBasicInfo.getExpertIntentionWorkRegions())); | |||
return new ExpertInfoSensitiveFieldCheckBO(sensitiveModifySegmentList); | |||
} | |||
public ExpertInfoSensitiveFieldCheckBO intentionWorkRegionsModifyCheck(Long expertUserId, List<ExpertRegionInfo> applyExpertIntentionWorkRegions) { | |||
List<SensitiveModifySegment> sensitiveModifySegmentList = new ArrayList<>(); | |||
LambdaQueryWrapper<ExpertIntentionWorkRegion> expertIntentionWorkRegionEq = Wrappers.lambdaQuery(ExpertIntentionWorkRegion.class) | |||
.eq(ExpertIntentionWorkRegion::getUserId, expertUserId); | |||
List<ExpertIntentionWorkRegion> expertIntentionWorkRegions = iExpertIntentionWorkRegionService.list(expertIntentionWorkRegionEq); | |||
List<ExpertRegionInfo> currentExpertIntentionWorkRegions = new ArrayList<>(); | |||
if (CollUtil.isNotEmpty(expertIntentionWorkRegions)) { | |||
expertIntentionWorkRegions.forEach(r -> { | |||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||
expertRegionInfo.setRegionLevel(r.getRegionLevel()); | |||
expertRegionInfo.setRegionCode(r.getRegionCode()); | |||
currentExpertIntentionWorkRegions.add(expertRegionInfo); | |||
}); | |||
} | |||
// 履职意向修改 | |||
sensitiveModifySegmentList | |||
.add(new SensitiveModifySegment( | |||
ExpertSensitiveFieldTypeEnum.expert_intention_field, ExpertUserInfoSensitiveFieldEnum.expert_intention_work_region | |||
, currentExpertIntentionWorkRegions, applyExpertIntentionWorkRegions)); | |||
return new ExpertInfoSensitiveFieldCheckBO(sensitiveModifySegmentList); | |||
} | |||
private List<DictionaryFieldInfo> assemblerDictionaryFieldInfoList(List<DictionaryFieldInfo> dictionaryFieldInfoList, String fieldName) { | |||
if (CollUtil.isNotEmpty(dictionaryFieldInfoList)) { | |||
dictionaryFieldInfoList.forEach(r -> r.setDictionaryFieldName(fieldName)); | |||
} | |||
return dictionaryFieldInfoList; | |||
} | |||
private List<TagFieldInfo> assemblerTagFieldInfoList(List<TagFieldInfo> tagFieldInfoList, String fieldName) { | |||
if (CollUtil.isNotEmpty(tagFieldInfoList)) { | |||
tagFieldInfoList.forEach(r -> r.setTagFieldName(fieldName)); | |||
} | |||
return tagFieldInfoList; | |||
} | |||
} |
@@ -1,16 +1,32 @@ | |||
package com.ningdatech.pmapi.expert.manage; | |||
import cn.hutool.core.collection.CollectionUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; | |||
import com.ningdatech.pmapi.common.helper.RegionLimitHelper; | |||
import com.ningdatech.pmapi.expert.assembler.ExpertInfoCmdAssembler; | |||
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; | |||
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; | |||
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; | |||
import com.ningdatech.pmapi.expert.constant.QueryExpertAccountStatusEnum; | |||
import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; | |||
import com.ningdatech.pmapi.expert.helper.ExpertInfoSensitiveFieldModifyCheckHelper; | |||
import com.ningdatech.pmapi.expert.helper.PermissionCheckHelper; | |||
import com.ningdatech.pmapi.expert.model.ExpertAdminExpertManageQuery; | |||
import com.ningdatech.pmapi.expert.model.*; | |||
import com.ningdatech.pmapi.expert.model.bo.ExpertInfoSensitiveFieldCheckBO; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertAdminExpertManageQueryCmd; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertInfoModifyCmd; | |||
import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery; | |||
import com.ningdatech.pmapi.expert.model.query.ExpertTagQuery; | |||
import com.ningdatech.pmapi.expert.model.req.AdminExpertBasicInfoModifyRequest; | |||
import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest; | |||
import com.ningdatech.pmapi.expert.model.vo.ExpertAdminExpertManageListVO; | |||
import com.ningdatech.pmapi.expert.model.vo.ExpertBasicInfoModifyResultVO; | |||
import com.ningdatech.pmapi.expert.service.ExpertInfoService; | |||
import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService; | |||
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; | |||
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; | |||
import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; | |||
@@ -34,6 +50,10 @@ public class ExpertAdminManage { | |||
private final PermissionCheckHelper permissionCheckHelper; | |||
private final RegionLimitHelper regionLimitHelper; | |||
private final IExpertMetaApplyService iExpertMetaApplyService; | |||
private final ExpertInfoSensitiveFieldModifyCheckHelper expertInfoSensitiveFieldModifyCheckHelper; | |||
private final ExpertInfoService expertInfoService; | |||
private final ExpertMetaApplyManage expertMetaApplyManage; | |||
/** | |||
* 专家管理员使用 专家库列表查询 | |||
@@ -139,4 +159,58 @@ public class ExpertAdminManage { | |||
return expertAdminExpertManageQueryCmd; | |||
} | |||
/** | |||
* 专家管理员修改专家的个人信息接口(包含专家层级变更) | |||
* | |||
* @param request | |||
* @return | |||
*/ | |||
public ExpertBasicInfoModifyResultVO adminModifyExpertBasicInfo(AdminExpertBasicInfoModifyRequest request) { | |||
Long adminUserId = LoginUserUtil.getUserId(); | |||
Long expertUserId = request.getExpertUserId(); | |||
// 校验当前是否有信息变更审核 如有,无法变更信息 | |||
LambdaQueryWrapper<ExpertMetaApply> infoModifyEq = Wrappers.lambdaQuery(ExpertMetaApply.class) | |||
.eq(ExpertMetaApply::getUserId, expertUserId) | |||
.eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INFO_MODIFY.getKey()) | |||
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) | |||
.eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name()); | |||
ExpertMetaApply infoModifyApply = iExpertMetaApplyService.getOne(infoModifyEq); | |||
if (Objects.nonNull(infoModifyApply)) { | |||
throw new BizException("该账号还有信息修审核审核未审批,请撤销或审批后处理"); | |||
} | |||
// 校验当前是否有层级变更审核,如有需要审核通过或撤销审核后重新提交 | |||
LambdaQueryWrapper<ExpertMetaApply> expertStorageEq = Wrappers.lambdaQuery(ExpertMetaApply.class) | |||
.eq(ExpertMetaApply::getUserId, expertUserId) | |||
.eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_STORAGE.getKey()) | |||
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) | |||
.eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name()); | |||
ExpertMetaApply expertStorageApply = iExpertMetaApplyService.getOne(expertStorageEq); | |||
if (Objects.nonNull(expertStorageApply)) { | |||
throw new BizException("当前账号还有入库审核未审批,请撤销或审批后处理"); | |||
} | |||
ExpertBasicInfo basicInfo = request.getBasicInfo(); | |||
ExpertEduInfo eduInfo = request.getEduInfo(); | |||
ExpertJobInfo jobInfo = request.getJobInfo(); | |||
ExpertProfessionalInfo professionalInfo = request.getProfessionalInfo(); | |||
ExpertRecommendInfo recommendInfo = request.getRecommendInfo(); | |||
ExpertOtherInfo otherInfo = request.getExpertOtherInfo(); | |||
ExpertInfoSensitiveFieldCheckBO expertInfoSensitiveFieldCheckBO = | |||
expertInfoSensitiveFieldModifyCheckHelper.expertInfoSensitiveFieldModifyCheck(basicInfo, eduInfo, jobInfo, professionalInfo, expertUserId); | |||
ExpertInfoModifyCmd expertInfoModifyCmd = ExpertInfoCmdAssembler | |||
.buildExpertInfoModifyCmd(expertUserId, basicInfo, eduInfo, jobInfo, professionalInfo, recommendInfo, otherInfo, expertInfoSensitiveFieldCheckBO, null); | |||
List<Long> applyIdList = expertInfoService.adminModifyExpertInfo(expertInfoModifyCmd, adminUserId); | |||
// 批量通过专家管理员审核 | |||
for (Long applyId : applyIdList) { | |||
MetaApplyResultRequest applyResult = new MetaApplyResultRequest(); | |||
applyResult.setApplyId(applyId); | |||
applyResult.setAuditOpinion("同意"); | |||
applyResult.setApplyResult(true); | |||
expertMetaApplyManage.metaApplyResult(applyResult); | |||
} | |||
return new ExpertBasicInfoModifyResultVO(false); | |||
} | |||
} |
@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.expert.manage; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | |||
import com.ningdatech.file.service.FileService; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import com.ningdatech.pmapi.expert.assembler.ExpertInfoCmdAssembler; | |||
import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; | |||
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; | |||
@@ -0,0 +1,16 @@ | |||
package com.ningdatech.pmapi.expert.mapper; | |||
import com.ningdatech.pmapi.expert.entity.ExpertSensitiveInfoModifyDetailRecord; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
/** | |||
* <p> | |||
* Mapper 接口 | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
public interface ExpertSensitiveInfoModifyDetailRecordMapper extends BaseMapper<ExpertSensitiveInfoModifyDetailRecord> { | |||
} |
@@ -0,0 +1,5 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.ningdatech.pmapi.expert.mapper.ExpertSensitiveInfoModifyDetailRecordMapper"> | |||
</mapper> |
@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.model; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.model; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.model; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.model; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.model; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -1,24 +0,0 @@ | |||
package com.ningdatech.pmapi.expert.model; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/25 下午1:55 | |||
* 用于包装使用 | |||
*/ | |||
@Data | |||
@ApiModel("文件信息基类") | |||
public class FileBasicInfo { | |||
@ApiModelProperty("文件id") | |||
private Long fileId; | |||
@ApiModelProperty("文件url") | |||
private String url; | |||
@ApiModelProperty("文件名") | |||
private String fileName; | |||
} |
@@ -0,0 +1,30 @@ | |||
package com.ningdatech.pmapi.expert.model; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/27 下午4:18 | |||
* 提交修改申请额外信息 | |||
*/ | |||
@Data | |||
@ApiModel("提交修改申请额外信息") | |||
public class ModifyApplyExtraInfo { | |||
/** | |||
* 情况说明 | |||
*/ | |||
@ApiModelProperty("申请说明") | |||
private String factSheet; | |||
/** | |||
* 证明材料 | |||
*/ | |||
@ApiModelProperty("证明材料") | |||
private List<FileBasicInfo> evidenceList; | |||
} |
@@ -0,0 +1,87 @@ | |||
package com.ningdatech.pmapi.expert.model; | |||
import com.ningdatech.pmapi.common.util.DictUtils; | |||
import com.ningdatech.pmapi.common.util.RegionUtils; | |||
import com.ningdatech.pmapi.common.util.StrUtils; | |||
import com.ningdatech.pmapi.common.util.TagUtils; | |||
import com.ningdatech.pmapi.expert.constant.ExpertSensitiveFieldTypeEnum; | |||
import com.ningdatech.pmapi.expert.constant.ExpertUserInfoSensitiveFieldEnum; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Data; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 上午11:28 | |||
*/ | |||
@Data | |||
@ApiModel("需要审核字段部分") | |||
public class SensitiveModifySegment { | |||
public SensitiveModifySegment(ExpertUserInfoSensitiveFieldEnum fieldName, Object original, Object apply) { | |||
this.fieldName = fieldName; | |||
this.original = original; | |||
this.apply = apply; | |||
} | |||
public SensitiveModifySegment(ExpertSensitiveFieldTypeEnum fieldType, ExpertUserInfoSensitiveFieldEnum fieldName, Object original, Object apply) { | |||
this.fieldType = fieldType; | |||
this.fieldName = fieldName; | |||
this.original = original; | |||
this.apply = apply; | |||
} | |||
private ExpertSensitiveFieldTypeEnum fieldType = ExpertSensitiveFieldTypeEnum.expert_sensitive_info_field; | |||
private ExpertUserInfoSensitiveFieldEnum fieldName; | |||
private Object original; | |||
private Object apply; | |||
public Boolean isValueEquals() { | |||
switch (fieldName) { | |||
case phone_no: | |||
case email: | |||
case company: | |||
case legal_entity_code: { | |||
return StrUtils.trimEquals((String) this.original, (String) this.apply); | |||
} | |||
case administrative_rank: | |||
case title_level: { | |||
return DictUtils.isValueEquals((List<DictionaryFieldInfo>) this.original | |||
, (List<DictionaryFieldInfo>) this.apply); | |||
} | |||
case good_at: | |||
case technical_expertise: | |||
case industry_sector: | |||
case other: { | |||
return TagUtils.isValueEquals((List<TagFieldInfo>) this.original, (List<TagFieldInfo>) this.apply); | |||
} | |||
case expert_region: | |||
return RegionUtils.isValueEquals((ExpertRegionInfo) this.original, (ExpertRegionInfo) this.apply); | |||
case expert_intention_work_region: | |||
return RegionUtils.isValueEquals((List<ExpertRegionInfo>) this.original, (List<ExpertRegionInfo>) this.apply); | |||
default: | |||
return this.original.equals(this.apply); | |||
} | |||
} | |||
public static Boolean isModify(List<SensitiveModifySegment> segmentList) { | |||
if (CollectionUtils.isEmpty(segmentList)) { | |||
return false; | |||
} | |||
for (SensitiveModifySegment segment : segmentList) { | |||
if (!segment.isValueEquals()) { | |||
return true; | |||
} | |||
} | |||
return false; | |||
} | |||
} |
@@ -0,0 +1,78 @@ | |||
package com.ningdatech.pmapi.expert.model.bo; | |||
import com.ningdatech.pmapi.expert.constant.ExpertSensitiveFieldTypeEnum; | |||
import com.ningdatech.pmapi.expert.model.SensitiveModifySegment; | |||
import lombok.Data; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 上午11:18 | |||
*/ | |||
@Data | |||
public class ExpertInfoSensitiveFieldCheckBO { | |||
private Boolean hasModify; | |||
/** | |||
* 专家敏感信息是否修改 | |||
*/ | |||
private Boolean isExpertSensitiveInfoModify; | |||
/** | |||
* 专家敏感信息原值和申请值 | |||
*/ | |||
private List<SensitiveModifySegment> expertSensitiveInfoFieldSegmentList; | |||
/** | |||
* 专家层级是否修改 | |||
*/ | |||
private Boolean isExpertRegionModify; | |||
/** | |||
* 专家层级修改原值和申请值 | |||
*/ | |||
private List<SensitiveModifySegment> expertRegionFieldSegmentList; | |||
/** | |||
* 专家履职意向是否修改 | |||
*/ | |||
private Boolean isExpertIntentionModify; | |||
/** | |||
* 专家履职意向修改原值和申请值 | |||
*/ | |||
private List<SensitiveModifySegment> expertIntentionFieldSegmentList; | |||
public ExpertInfoSensitiveFieldCheckBO(List<SensitiveModifySegment> sensitiveModifySegmentList) { | |||
Map<ExpertSensitiveFieldTypeEnum, List<SensitiveModifySegment>> collect = sensitiveModifySegmentList | |||
.stream().collect(Collectors.groupingBy(SensitiveModifySegment::getFieldType)); | |||
this.expertSensitiveInfoFieldSegmentList = collect.get(ExpertSensitiveFieldTypeEnum.expert_sensitive_info_field); | |||
if (CollectionUtils.isEmpty(expertSensitiveInfoFieldSegmentList)) { | |||
this.expertSensitiveInfoFieldSegmentList = new ArrayList<>(); | |||
} | |||
this.isExpertSensitiveInfoModify = SensitiveModifySegment.isModify(expertSensitiveInfoFieldSegmentList); | |||
this.expertRegionFieldSegmentList = collect.get(ExpertSensitiveFieldTypeEnum.expert_region_field); | |||
if (CollectionUtils.isEmpty(expertRegionFieldSegmentList)) { | |||
this.expertRegionFieldSegmentList = new ArrayList<>(); | |||
} | |||
this.isExpertRegionModify = SensitiveModifySegment.isModify(expertRegionFieldSegmentList); | |||
this.expertIntentionFieldSegmentList = collect.get(ExpertSensitiveFieldTypeEnum.expert_intention_field); | |||
if (CollectionUtils.isEmpty(expertIntentionFieldSegmentList)) { | |||
this.expertIntentionFieldSegmentList = new ArrayList<>(); | |||
} | |||
this.isExpertIntentionModify = SensitiveModifySegment.isModify(expertIntentionFieldSegmentList); | |||
this.hasModify = this.isExpertSensitiveInfoModify || this.isExpertRegionModify || this.isExpertIntentionModify; | |||
} | |||
} |
@@ -1,37 +1,38 @@ | |||
//package com.ningdatech.pmapi.expert.model.cmd; | |||
// | |||
//import com.ningdatech.emapi.expert.entity.bo.ExpertInfoSensitiveFieldCheckBO; | |||
//import com.ningdatech.emapi.expert.entity.dto.*; | |||
//import lombok.Data; | |||
// | |||
//import java.util.List; | |||
// | |||
///** | |||
// * @author liuxinxin | |||
// * @date 2022/7/28 下午2:43 | |||
// */ | |||
//@Data | |||
//public class ExpertInfoModifyCmd { | |||
// | |||
// private Long userId; | |||
// | |||
// private ExpertUserFullInfoDTO expertUserInfoDTO; | |||
// | |||
// private List<ExpertDictionaryDTO> expertDictionaryList; | |||
// | |||
// private List<ExpertTagDTO> expertTagList; | |||
// | |||
// /** | |||
// * 专家履职意向(区域编码) | |||
// */ | |||
// private List<ExpertRegionDTO> expertIntentionWorkRegionInfo; | |||
// | |||
// /** | |||
// * 回避单位列表 | |||
// */ | |||
// private List<ExpertAvoidCompanyDTO> expertAvoidCompanyList; | |||
// | |||
// private ExpertInfoSensitiveFieldCheckBO expertInfoSensitiveFieldCheckBO; | |||
// | |||
// private ModifyApplyExtraInfoDTO modifyApplyExtraInfo; | |||
//} | |||
package com.ningdatech.pmapi.expert.model.cmd; | |||
import com.ningdatech.pmapi.expert.model.bo.ExpertInfoSensitiveFieldCheckBO; | |||
import com.ningdatech.pmapi.expert.model.dto.*; | |||
import lombok.Data; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/28 下午2:43 | |||
*/ | |||
@Data | |||
public class ExpertInfoModifyCmd { | |||
private Long userId; | |||
private ExpertUserFullInfoDTO expertUserInfoDTO; | |||
private List<ExpertDictionaryDTO> expertDictionaryList; | |||
private List<ExpertTagDTO> expertTagList; | |||
/** | |||
* 专家履职意向(区域编码) | |||
*/ | |||
private List<ExpertRegionDTO> expertIntentionWorkRegionInfo; | |||
/** | |||
* 回避单位列表 | |||
*/ | |||
private List<ExpertAvoidCompanyDTO> expertAvoidCompanyList; | |||
private ExpertInfoSensitiveFieldCheckBO expertInfoSensitiveFieldCheckBO; | |||
private ModifyApplyExtraInfoDTO modifyApplyExtraInfo; | |||
} |
@@ -0,0 +1,44 @@ | |||
package com.ningdatech.pmapi.expert.model.req; | |||
import com.ningdatech.pmapi.expert.model.*; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/8/19 下午6:40 | |||
*/ | |||
@Data | |||
@ApiModel("专家管理员专家信息更新请求") | |||
public class AdminExpertBasicInfoModifyRequest { | |||
@ApiModelProperty("专家用户id") | |||
private Long expertUserId; | |||
@NotNull | |||
@ApiModelProperty("基本信息") | |||
private ExpertBasicInfo basicInfo; | |||
@NotNull | |||
@ApiModelProperty("学历信息") | |||
private ExpertEduInfo eduInfo; | |||
@NotNull | |||
@ApiModelProperty("职业信息") | |||
private ExpertJobInfo jobInfo; | |||
@NotNull | |||
@ApiModelProperty("专业信息") | |||
private ExpertProfessionalInfo professionalInfo; | |||
@NotNull | |||
@ApiModelProperty("推荐信息") | |||
private ExpertRecommendInfo recommendInfo; | |||
@ApiModelProperty("其他信息") | |||
private ExpertOtherInfo expertOtherInfo; | |||
} |
@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.model.req; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import com.ningdatech.pmapi.expert.model.*; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
@@ -33,9 +34,8 @@ public class ExpertUserBasicInfoSubmitRequest { | |||
@ApiModelProperty("专业信息") | |||
private ExpertProfessionalInfo professionalInfo; | |||
/** | |||
* 补充推荐方式 | |||
* 补充推荐方式 | |||
*/ | |||
@NotEmpty | |||
@ApiModelProperty("推荐方式") | |||
@@ -44,4 +44,8 @@ public class ExpertUserBasicInfoSubmitRequest { | |||
@ApiModelProperty("推荐证明材料") | |||
private List<FileBasicInfo> recommendProofFile; | |||
/** | |||
* 其他信息 | |||
*/ | |||
} |
@@ -0,0 +1,25 @@ | |||
package com.ningdatech.pmapi.expert.model.vo; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/27 下午4:29 | |||
*/ | |||
@Data | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
@ApiModel("专家信息修改是否需要额外材料") | |||
public class ExpertBasicInfoModifyResultVO { | |||
/** | |||
* 是否需要提交额外材料 | |||
*/ | |||
@ApiModelProperty("是否需要额外材料-涉及修改需要审核数据需要提供额外材料") | |||
private Boolean needExtraInfo; | |||
} |
@@ -1,6 +1,7 @@ | |||
package com.ningdatech.pmapi.expert.service; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertInfoModifyCmd; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertStorageDealCmd; | |||
import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO; | |||
@@ -39,5 +40,12 @@ public interface ExpertInfoService { | |||
* 批量获取用户全量信息 | |||
**/ | |||
List<ExpertFullInfoAllDTO> listExpertUserFullInfoAll(List<Long> userIds); | |||
/** | |||
* 管理员修改专家信息 | |||
*/ | |||
List<Long> adminModifyExpertInfo(ExpertInfoModifyCmd cmd, Long adminUserId); | |||
} | |||
@@ -0,0 +1,16 @@ | |||
package com.ningdatech.pmapi.expert.service; | |||
import com.ningdatech.pmapi.expert.entity.ExpertSensitiveInfoModifyDetailRecord; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
/** | |||
* <p> | |||
* 服务类 | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
public interface IExpertSensitiveInfoModifyDetailRecordService extends IService<ExpertSensitiveInfoModifyDetailRecord> { | |||
} |
@@ -1,26 +1,29 @@ | |||
package com.ningdatech.pmapi.expert.service.impl; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; | |||
import com.ningdatech.pmapi.common.model.ExpertRegionModifyDiffBO; | |||
import com.ningdatech.pmapi.common.util.ExpertRegionInfoUtils; | |||
import com.ningdatech.pmapi.common.util.GzipUtils; | |||
import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; | |||
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; | |||
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; | |||
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; | |||
import com.ningdatech.pmapi.expert.constant.ExpertUserInfoStepEnum; | |||
import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; | |||
import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; | |||
import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; | |||
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; | |||
import com.ningdatech.pmapi.expert.constant.*; | |||
import com.ningdatech.pmapi.expert.entity.*; | |||
import com.ningdatech.pmapi.expert.model.SensitiveModifySegment; | |||
import com.ningdatech.pmapi.expert.model.bo.ExpertInfoSensitiveFieldCheckBO; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertInfoModifyCmd; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; | |||
import com.ningdatech.pmapi.expert.model.cmd.ExpertStorageDealCmd; | |||
import com.ningdatech.pmapi.expert.model.dto.*; | |||
import com.ningdatech.pmapi.expert.service.*; | |||
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; | |||
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; | |||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; | |||
import com.ningdatech.pmapi.meta.model.entity.ExpertTag; | |||
import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; | |||
@@ -48,6 +51,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||
private final IExpertAvoidCompanyService iExpertAvoidCompanyService; | |||
private final IExpertIntentionWorkRegionService iExpertIntentionWorkRegionService; | |||
private final IExpertMetaApplyService iExpertMetaApplyService; | |||
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService; | |||
/** | |||
@@ -404,4 +408,216 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||
.collect(Collectors.toList()); | |||
} | |||
@Override | |||
@Transactional(rollbackFor = Exception.class) | |||
public List<Long> adminModifyExpertInfo(ExpertInfoModifyCmd cmd, Long adminUserId) { | |||
Long userId = cmd.getUserId(); | |||
List<ExpertAvoidCompanyDTO> expertAvoidCompanyList = cmd.getExpertAvoidCompanyList(); | |||
List<ExpertDictionaryDTO> expertDictionaryList = cmd.getExpertDictionaryList(); | |||
List<ExpertTagDTO> expertTagList = cmd.getExpertTagList(); | |||
ExpertUserFullInfoDTO expertUserInfoDTO = cmd.getExpertUserInfoDTO(); | |||
List<Long> applyIdList = new ArrayList<>(); | |||
ExpertUserFullInfo originalExpertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); | |||
ExpertUserFullInfo saveExpertUserFullInfo = buildSaveExpertUserFullInfo(expertUserInfoDTO); | |||
if (Objects.nonNull(originalExpertUserFullInfo)) { | |||
saveExpertUserFullInfo.setId(originalExpertUserFullInfo.getId()); | |||
// 删除所有专家字典字段(需审核敏感字段不删除) | |||
LambdaQueryWrapper<ExpertDictionary> expertDictionaryRemove = Wrappers.lambdaQuery(ExpertDictionary.class) | |||
.eq(ExpertDictionary::getUserId, userId).notIn(ExpertDictionary::getExpertInfoField, ExpertUserInfoSensitiveFieldEnum.getSensitiveDictionaryList()); | |||
iExpertDictionaryService.remove(expertDictionaryRemove); | |||
// 保存专家来源标签 | |||
if (CollUtil.isNotEmpty(expertTagList)) { | |||
// 删除专家来源标签 重新存入 | |||
iExpertTagService.remove(Wrappers.lambdaQuery(ExpertTag.class) | |||
.eq(ExpertTag::getUserId, userId) | |||
.eq(ExpertTag::getExpertInfoField, ExpertTagEnum.EXPERT_SOURCE.getKey())); | |||
List<ExpertTag> saveExpertTagList = buildSaveExpertTagList(userId, expertTagList); | |||
saveExpertTagList = saveExpertTagList.stream() | |||
.filter(r -> ExpertTagEnum.EXPERT_SOURCE.getKey().equals(r.getExpertInfoField())).collect(Collectors.toList()); | |||
if (CollUtil.isNotEmpty(saveExpertTagList)) { | |||
iExpertTagService.saveBatch(saveExpertTagList); | |||
} | |||
} | |||
} | |||
saveExpertUserFullInfo.setRecommendationProofFileIdList(JSONObject.toJSONString(expertUserInfoDTO.getRecommendationProofFileIdList())); | |||
saveExpertUserFullInfo.setUserId(userId); | |||
// 专家提交修改,以下字段需要审批后才能更新 | |||
saveExpertUserFullInfo.setPhoneNo(null); | |||
saveExpertUserFullInfo.setEmail(null); | |||
saveExpertUserFullInfo.setRegionLevel(null); | |||
saveExpertUserFullInfo.setRegionCode(null); | |||
saveExpertUserFullInfo.setCompany(null); | |||
saveExpertUserFullInfo.setLegalEntityCode(null); | |||
iExpertUserFullInfoService.saveOrUpdate(saveExpertUserFullInfo); | |||
// 保存所有专家字典字段 | |||
List<ExpertDictionary> saveExpertDictionaryList = buildSaveExpertDictionaryList(userId, expertDictionaryList); | |||
saveExpertDictionaryList = saveExpertDictionaryList | |||
.stream().filter(r -> !ExpertUserInfoSensitiveFieldEnum.getSensitiveDictionaryList().contains(r.getExpertInfoField())).collect(Collectors.toList()); | |||
if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) { | |||
iExpertDictionaryService.saveBatch(saveExpertDictionaryList); | |||
} | |||
// 保存所有专家回避单位 | |||
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildSaveExpertAvoidCompanyList(userId, expertAvoidCompanyList); | |||
if (CollectionUtils.isNotEmpty(saveExpertAvoidCompanyList)) { | |||
// 删除回避单位 | |||
LambdaQueryWrapper<ExpertAvoidCompany> expertAvoidCompanyRemove = Wrappers.lambdaQuery(ExpertAvoidCompany.class) | |||
.eq(ExpertAvoidCompany::getUserId, userId); | |||
iExpertAvoidCompanyService.remove(expertAvoidCompanyRemove); | |||
// 重新保存 | |||
iExpertAvoidCompanyService.saveBatch(saveExpertAvoidCompanyList); | |||
} | |||
// 敏感字段申请 | |||
ExpertInfoSensitiveFieldCheckBO expertInfoSensitiveFieldCheckBO = cmd.getExpertInfoSensitiveFieldCheckBO(); | |||
ModifyApplyExtraInfoDTO modifyApplyExtraInfo = cmd.getModifyApplyExtraInfo(); | |||
if (expertInfoSensitiveFieldCheckBO.getHasModify()) { | |||
// TODO 提交审核前判断是否已经有审核未审核,如果有,无法创建新的审核请求 | |||
if (expertInfoSensitiveFieldCheckBO.getIsExpertSensitiveInfoModify()) { | |||
// 创建信息修改审核 | |||
List<SensitiveModifySegment> expertSensitiveInfoFieldSegmentList = expertInfoSensitiveFieldCheckBO.getExpertSensitiveInfoFieldSegmentList(); | |||
Long expertInfoModifyApplyId = createExpertInfoModifyApply(expertSensitiveInfoFieldSegmentList, originalExpertUserFullInfo, modifyApplyExtraInfo); | |||
applyIdList.add(expertInfoModifyApplyId); | |||
} | |||
if (expertInfoSensitiveFieldCheckBO.getIsExpertRegionModify()) { | |||
// 创建层级变更审核 | |||
List<SensitiveModifySegment> expertRegionFieldSegmentList = expertInfoSensitiveFieldCheckBO.getExpertRegionFieldSegmentList(); | |||
Long expertRegionModifyApplyId = createExpertRegionModifyApply(expertRegionFieldSegmentList, originalExpertUserFullInfo, modifyApplyExtraInfo); | |||
applyIdList.add(expertRegionModifyApplyId); | |||
} | |||
if (expertInfoSensitiveFieldCheckBO.getIsExpertIntentionModify()) { | |||
// 创建专家履职意向变更审核 | |||
List<SensitiveModifySegment> expertIntentionFieldSegmentList = expertInfoSensitiveFieldCheckBO.getExpertIntentionFieldSegmentList(); | |||
SensitiveModifySegment segment = expertIntentionFieldSegmentList.get(0); | |||
List<ExpertRegionInfo> apply = (List<ExpertRegionInfo>) segment.getApply(); | |||
List<ExpertRegionInfo> original = (List<ExpertRegionInfo>) segment.getOriginal(); | |||
ExpertRegionModifyDiffBO expertRegionModifyDiffBO = ExpertRegionInfoUtils.modifyDiff(original, apply); | |||
List<ExpertRegionInfo> addList = expertRegionModifyDiffBO.getAddList(); | |||
List<ExpertRegionInfo> removeList = expertRegionModifyDiffBO.getRemoveList(); | |||
for (ExpertRegionInfo expertRegionInfo : addList) { | |||
Long expertIntentionModifyApplyId = createExpertIntentionModifyApply(originalExpertUserFullInfo.getUserId() | |||
, modifyApplyExtraInfo, expertRegionInfo, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN); | |||
applyIdList.add(expertIntentionModifyApplyId); | |||
} | |||
for (ExpertRegionInfo expertRegionInfo : removeList) { | |||
Long expertIntentionModifyApplyId = createExpertIntentionModifyApply(originalExpertUserFullInfo.getUserId() | |||
, modifyApplyExtraInfo, expertRegionInfo, ExpertApplyTypeEnum.EXPERT_INTENTION_LEAVE); | |||
applyIdList.add(expertIntentionModifyApplyId); | |||
} | |||
} | |||
// 专家管理修改批量通过审核 | |||
// 专家批量通过审核由 facade层调用其他逻辑实现 | |||
} | |||
return applyIdList; | |||
} | |||
/** | |||
* 创建信息修改审核 | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public Long createExpertInfoModifyApply(List<SensitiveModifySegment> expertSensitiveInfoFieldSegmentList | |||
, ExpertUserFullInfo originalExpertUserFullInfo, ModifyApplyExtraInfoDTO modifyApplyExtraInfo) { | |||
expertSensitiveInfoFieldSegmentList = expertSensitiveInfoFieldSegmentList.stream().filter(r -> !r.isValueEquals()).collect(Collectors.toList()); | |||
String compressedModifyJsonStr = GzipUtils.compress(JSONObject.toJSONString(expertSensitiveInfoFieldSegmentList)); | |||
ExpertMetaApply expertMetaApply = new ExpertMetaApply(); | |||
expertMetaApply.setApplyType(ExpertApplyTypeEnum.EXPERT_INFO_MODIFY.getKey()); | |||
expertMetaApply.setApplyStatus(ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); | |||
expertMetaApply.setRegionCode(originalExpertUserFullInfo.getRegionCode()); | |||
expertMetaApply.setRegionLevel(originalExpertUserFullInfo.getRegionLevel()); | |||
expertMetaApply.setUserId(originalExpertUserFullInfo.getUserId()); | |||
expertMetaApply.setDisplayEnable(BoolDisplayEnum.Y.name()); | |||
if (Objects.nonNull(modifyApplyExtraInfo)) { | |||
expertMetaApply.setExtraMaterial(JSONObject.toJSONString(modifyApplyExtraInfo)); | |||
} | |||
iExpertMetaApplyService.save(expertMetaApply); | |||
ExpertSensitiveInfoModifyDetailRecord expertSensitiveInfoModifyDetailRecord = new ExpertSensitiveInfoModifyDetailRecord(); | |||
expertSensitiveInfoModifyDetailRecord.setCreateOn(LocalDateTime.now()); | |||
expertSensitiveInfoModifyDetailRecord.setUpdateOn(LocalDateTime.now()); | |||
expertSensitiveInfoModifyDetailRecord.setMetaApplyId(expertMetaApply.getId()); | |||
expertSensitiveInfoModifyDetailRecord.setUserId(originalExpertUserFullInfo.getUserId()); | |||
expertSensitiveInfoModifyDetailRecord.setOriginalJson(compressedModifyJsonStr); | |||
expertSensitiveInfoModifyDetailRecord.setModifyJson(compressedModifyJsonStr); | |||
if (Objects.nonNull(modifyApplyExtraInfo)) { | |||
expertSensitiveInfoModifyDetailRecord.setExtraMaterial(JSONObject.toJSONString(modifyApplyExtraInfo)); | |||
} | |||
iExpertSensitiveInfoModifyDetailRecordService.save(expertSensitiveInfoModifyDetailRecord); | |||
return expertMetaApply.getId(); | |||
} | |||
private Long createExpertIntentionModifyApply(Long expertUserId, ModifyApplyExtraInfoDTO modifyApplyExtraInfo | |||
, ExpertRegionInfo expertIntention, ExpertApplyTypeEnum applyTypeEnum) { | |||
ExpertMetaApply expertMetaApply = new ExpertMetaApply(); | |||
expertMetaApply.setApplyType(applyTypeEnum.getKey()); | |||
expertMetaApply.setApplyStatus(ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); | |||
expertMetaApply.setRegionCode(expertIntention.getRegionCode()); | |||
expertMetaApply.setRegionLevel(expertIntention.getRegionLevel()); | |||
expertMetaApply.setUserId(expertUserId); | |||
expertMetaApply.setDisplayEnable(BoolDisplayEnum.Y.name()); | |||
if (Objects.nonNull(modifyApplyExtraInfo)) { | |||
expertMetaApply.setExtraMaterial(JSONObject.toJSONString(modifyApplyExtraInfo)); | |||
} | |||
iExpertMetaApplyService.save(expertMetaApply); | |||
ExpertSensitiveInfoModifyDetailRecord expertSensitiveInfoModifyDetailRecord = new ExpertSensitiveInfoModifyDetailRecord(); | |||
expertSensitiveInfoModifyDetailRecord.setCreateOn(LocalDateTime.now()); | |||
expertSensitiveInfoModifyDetailRecord.setUserId(expertUserId); | |||
expertSensitiveInfoModifyDetailRecord.setUpdateOn(LocalDateTime.now()); | |||
expertSensitiveInfoModifyDetailRecord.setMetaApplyId(expertMetaApply.getId()); | |||
if (Objects.nonNull(modifyApplyExtraInfo)) { | |||
expertSensitiveInfoModifyDetailRecord.setExtraMaterial(JSONObject.toJSONString(modifyApplyExtraInfo)); | |||
} | |||
iExpertSensitiveInfoModifyDetailRecordService.save(expertSensitiveInfoModifyDetailRecord); | |||
return expertMetaApply.getId(); | |||
} | |||
/** | |||
* 创建层级变更审核 | |||
* | |||
* @param expertRegionFieldSegmentList | |||
* @param originalExpertUserFullInfo | |||
* @param modifyApplyExtraInfo | |||
*/ | |||
private Long createExpertRegionModifyApply(List<SensitiveModifySegment> expertRegionFieldSegmentList | |||
, ExpertUserFullInfo originalExpertUserFullInfo, ModifyApplyExtraInfoDTO modifyApplyExtraInfo) { | |||
String compressedModifyJsonStr = GzipUtils.compress(JSONObject.toJSONString(expertRegionFieldSegmentList)); | |||
SensitiveModifySegment segment = expertRegionFieldSegmentList.get(0); | |||
ExpertRegionInfo apply = (ExpertRegionInfo) segment.getApply(); | |||
ExpertMetaApply expertMetaApply = new ExpertMetaApply(); | |||
expertMetaApply.setApplyType(ExpertApplyTypeEnum.EXPERT_STORAGE.getKey()); | |||
expertMetaApply.setApplyStatus(ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); | |||
expertMetaApply.setRegionCode(apply.getRegionCode()); | |||
expertMetaApply.setRegionLevel(apply.getRegionLevel()); | |||
expertMetaApply.setUserId(originalExpertUserFullInfo.getUserId()); | |||
expertMetaApply.setDisplayEnable(BoolDisplayEnum.Y.name()); | |||
if (Objects.nonNull(modifyApplyExtraInfo)) { | |||
expertMetaApply.setExtraMaterial(JSONObject.toJSONString(modifyApplyExtraInfo)); | |||
} | |||
iExpertMetaApplyService.save(expertMetaApply); | |||
ExpertSensitiveInfoModifyDetailRecord expertSensitiveInfoModifyDetailRecord = new ExpertSensitiveInfoModifyDetailRecord(); | |||
expertSensitiveInfoModifyDetailRecord.setCreateOn(LocalDateTime.now()); | |||
expertSensitiveInfoModifyDetailRecord.setUpdateOn(LocalDateTime.now()); | |||
expertSensitiveInfoModifyDetailRecord.setUserId(originalExpertUserFullInfo.getUserId()); | |||
expertSensitiveInfoModifyDetailRecord.setMetaApplyId(expertMetaApply.getId()); | |||
expertSensitiveInfoModifyDetailRecord.setOriginalJson(compressedModifyJsonStr); | |||
expertSensitiveInfoModifyDetailRecord.setModifyJson(compressedModifyJsonStr); | |||
if (Objects.nonNull(modifyApplyExtraInfo)) { | |||
expertSensitiveInfoModifyDetailRecord.setExtraMaterial(JSONObject.toJSONString(modifyApplyExtraInfo)); | |||
} | |||
iExpertSensitiveInfoModifyDetailRecordService.save(expertSensitiveInfoModifyDetailRecord); | |||
return expertMetaApply.getId(); | |||
} | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.ningdatech.pmapi.expert.service.impl; | |||
import com.ningdatech.pmapi.expert.entity.ExpertSensitiveInfoModifyDetailRecord; | |||
import com.ningdatech.pmapi.expert.mapper.ExpertSensitiveInfoModifyDetailRecordMapper; | |||
import com.ningdatech.pmapi.expert.service.IExpertSensitiveInfoModifyDetailRecordService; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
@Service | |||
public class ExpertSensitiveInfoModifyDetailRecordServiceImpl extends ServiceImpl<ExpertSensitiveInfoModifyDetailRecordMapper, ExpertSensitiveInfoModifyDetailRecord> implements IExpertSensitiveInfoModifyDetailRecordService { | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.ningdatech.pmapi.organization.controller; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.stereotype.Controller; | |||
/** | |||
* <p> | |||
* 前端控制器 | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
@Controller | |||
@RequestMapping("/pmapi.organization/organization-main-manage-tag") | |||
public class OrganizationMainManageTagController { | |||
} |
@@ -32,7 +32,13 @@ public class GovBusinessStrip implements Serializable { | |||
private Long updateBy; | |||
/** | |||
* 条线code | |||
*/ | |||
private String businessStripCode; | |||
/** | |||
* 条线名称 | |||
*/ | |||
private String businessStripName; | |||
} |
@@ -0,0 +1,89 @@ | |||
package com.ningdatech.pmapi.organization.entity; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
/** | |||
* <p> | |||
* | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
@TableName("organization_main_manage_tag") | |||
@ApiModel(value = "OrganizationMainManageTag对象", description = "") | |||
public class OrganizationMainManageTag implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
private Long id; | |||
private LocalDateTime createOn; | |||
private LocalDateTime updateOn; | |||
private Long createBy; | |||
private Long updateBy; | |||
private String organizationCode; | |||
public Long getId() { | |||
return id; | |||
} | |||
public void setId(Long id) { | |||
this.id = id; | |||
} | |||
public LocalDateTime getCreateOn() { | |||
return createOn; | |||
} | |||
public void setCreateOn(LocalDateTime createOn) { | |||
this.createOn = createOn; | |||
} | |||
public LocalDateTime getUpdateOn() { | |||
return updateOn; | |||
} | |||
public void setUpdateOn(LocalDateTime updateOn) { | |||
this.updateOn = updateOn; | |||
} | |||
public Long getCreateBy() { | |||
return createBy; | |||
} | |||
public void setCreateBy(Long createBy) { | |||
this.createBy = createBy; | |||
} | |||
public Long getUpdateBy() { | |||
return updateBy; | |||
} | |||
public void setUpdateBy(Long updateBy) { | |||
this.updateBy = updateBy; | |||
} | |||
public String getOrganizationCode() { | |||
return organizationCode; | |||
} | |||
public void setOrganizationCode(String organizationCode) { | |||
this.organizationCode = organizationCode; | |||
} | |||
@Override | |||
public String toString() { | |||
return "OrganizationMainManageTag{" + | |||
"id=" + id + | |||
", createOn=" + createOn + | |||
", updateOn=" + updateOn + | |||
", createBy=" + createBy + | |||
", updateBy=" + updateBy + | |||
", organizationCode=" + organizationCode + | |||
"}"; | |||
} | |||
} |
@@ -0,0 +1,30 @@ | |||
package com.ningdatech.pmapi.organization.helper; | |||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||
import java.util.List; | |||
/** | |||
* @author liuxinxin | |||
* @date 2023/3/8 下午3:23 | |||
*/ | |||
public interface GovBusinessStripHelper { | |||
/** | |||
* 获取上级条线单位 | |||
* | |||
* @param organizationCode | |||
* @return | |||
*/ | |||
List<DingOrganization> getSupGovBusinessStrip(String organizationCode); | |||
/** | |||
* 获取上级主管单位 | |||
* | |||
* @param organizationCode | |||
* @return | |||
*/ | |||
DingOrganization getSupMainManageOrganization(String organizationCode); | |||
} |
@@ -0,0 +1,75 @@ | |||
package com.ningdatech.pmapi.organization.helper.impl; | |||
import com.ningdatech.pmapi.organization.helper.GovBusinessStripHelper; | |||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | |||
import lombok.RequiredArgsConstructor; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.stereotype.Component; | |||
import java.util.ArrayList; | |||
import java.util.HashSet; | |||
import java.util.List; | |||
import java.util.Objects; | |||
/** | |||
* @author liuxinxin | |||
* @date 2023/3/8 下午3:34 | |||
*/ | |||
@Component | |||
@RequiredArgsConstructor | |||
public class GovBusinessStripHelperImpl implements GovBusinessStripHelper { | |||
private final IDingOrganizationService organizationService; | |||
@Override | |||
public List<DingOrganization> getSupGovBusinessStrip(String organizationCode) { | |||
List<DingOrganization> supGovBusinessStripList = new ArrayList<>(); | |||
DingOrganization dingOrganization = organizationService.getByOrgCode(organizationCode); | |||
if (Objects.isNull(dingOrganization)) { | |||
return null; | |||
} | |||
String businessStripCodes = dingOrganization.getBusinessStripCodes(); | |||
if (StringUtils.isNotBlank(businessStripCodes)) { | |||
String[] businessStripCodeList = businessStripCodes.split("|"); | |||
for (String businessStripCode : businessStripCodeList) { | |||
DingOrganization supGovBusinessStrip = getSupGovBusinessStrip(dingOrganization.getOrganizationCode(), businessStripCode); | |||
if (Objects.nonNull(supGovBusinessStrip)) { | |||
supGovBusinessStripList.add(supGovBusinessStrip); | |||
} | |||
} | |||
} | |||
return supGovBusinessStripList; | |||
} | |||
private DingOrganization getSupGovBusinessStrip(String organizationCode, String businessStripCode) { | |||
String tempParentOrgCode = organizationCode; | |||
HashSet<String> tempParentOrgCodeSet = new HashSet<>(); | |||
while (true) { | |||
if (StringUtils.isBlank(tempParentOrgCode)) { | |||
return null; | |||
} | |||
// 防止脏数据导致死循环 | |||
if (!tempParentOrgCodeSet.add(tempParentOrgCode)) { | |||
return null; | |||
} | |||
DingOrganization parentOrganization = organizationService.getParentOrganization(tempParentOrgCode); | |||
if (Objects.isNull(parentOrganization)) { | |||
return null; | |||
} | |||
String businessStripCodes = parentOrganization.getBusinessStripCodes(); | |||
if (StringUtils.isNotBlank(businessStripCode) && businessStripCodes.contains(businessStripCode)) { | |||
return parentOrganization; | |||
} | |||
tempParentOrgCode = parentOrganization.getParentCode(); | |||
} | |||
} | |||
@Override | |||
public DingOrganization getSupMainManageOrganization(String organizationCode) { | |||
return null; | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
package com.ningdatech.pmapi.organization.mapper; | |||
import com.ningdatech.pmapi.organization.entity.OrganizationMainManageTag; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
/** | |||
* <p> | |||
* Mapper 接口 | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
public interface OrganizationMainManageTagMapper extends BaseMapper<OrganizationMainManageTag> { | |||
} |
@@ -0,0 +1,5 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.ningdatech.pmapi.organization.mapper.OrganizationMainManageTagMapper"> | |||
</mapper> |
@@ -1,11 +1,11 @@ | |||
package com.ningdatech.pmapi.organization.service; | |||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||
/** | |||
* <p> | |||
* 服务类 | |||
* 服务类 | |||
* </p> | |||
* | |||
* @author Lierbao | |||
@@ -13,4 +13,17 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||
*/ | |||
public interface IDingOrganizationService extends IService<DingOrganization> { | |||
/** | |||
* 根据组织code查询组织信息 | |||
* @param orgCode | |||
* @return | |||
*/ | |||
DingOrganization getByOrgCode(String orgCode); | |||
/** | |||
* 根据组织code查询父组织信息 | |||
* @param orgCode | |||
* @return | |||
*/ | |||
DingOrganization getParentOrganization(String orgCode); | |||
} |
@@ -0,0 +1,16 @@ | |||
package com.ningdatech.pmapi.organization.service; | |||
import com.ningdatech.pmapi.organization.entity.OrganizationMainManageTag; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
/** | |||
* <p> | |||
* 服务类 | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
public interface IOrganizationMainManageTagService extends IService<OrganizationMainManageTag> { | |||
} |
@@ -1,14 +1,16 @@ | |||
package com.ningdatech.pmapi.organization.service.impl; | |||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.ningdatech.pmapi.organization.mapper.DingOrganizationMapper; | |||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author Lierbao | |||
@@ -17,4 +19,22 @@ import org.springframework.stereotype.Service; | |||
@Service | |||
public class DingOrganizationServiceImpl extends ServiceImpl<DingOrganizationMapper, DingOrganization> implements IDingOrganizationService { | |||
@Override | |||
public DingOrganization getByOrgCode(String orgCode) { | |||
if (StringUtils.isBlank(orgCode)) { | |||
return null; | |||
} | |||
return this.getOne(Wrappers.lambdaQuery(DingOrganization.class) | |||
.eq(DingOrganization::getOrganizationCode, orgCode)); | |||
} | |||
@Override | |||
public DingOrganization getParentOrganization(String orgCode) { | |||
DingOrganization dingOrganization = getByOrgCode(orgCode); | |||
if (dingOrganization == null) { | |||
return null; | |||
} | |||
String parentCode = dingOrganization.getParentCode(); | |||
return getByOrgCode(parentCode); | |||
} | |||
} |
@@ -0,0 +1,20 @@ | |||
package com.ningdatech.pmapi.organization.service.impl; | |||
import com.ningdatech.pmapi.organization.entity.OrganizationMainManageTag; | |||
import com.ningdatech.pmapi.organization.mapper.OrganizationMainManageTagMapper; | |||
import com.ningdatech.pmapi.organization.service.IOrganizationMainManageTagService; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
* </p> | |||
* | |||
* @author Liuxinxin | |||
* @since 2023-03-09 | |||
*/ | |||
@Service | |||
public class OrganizationMainManageTagServiceImpl extends ServiceImpl<OrganizationMainManageTagMapper, OrganizationMainManageTag> implements IOrganizationMainManageTagService { | |||
} |