@@ -27,7 +27,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; | |||||
"com.ningdatech.pmapi.expert.controller", | "com.ningdatech.pmapi.expert.controller", | ||||
"com.ningdatech.pmapi.sms.controller", | "com.ningdatech.pmapi.sms.controller", | ||||
"com.ningdatech.pmapi.workbench.controller", | "com.ningdatech.pmapi.workbench.controller", | ||||
"com.ningdatech.pmapi.ding.controller" | |||||
"com.ningdatech.pmapi.ding.controller", | |||||
"com.ningdatech.pmapi.filemanage.controller" | |||||
}) | }) | ||||
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> { | public class GlobalResponseHandler implements ResponseBodyAdvice<Object> { | ||||
@@ -4,9 +4,7 @@ import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; | |||||
import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask; | import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask; | ||||
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; | import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import org.springframework.web.bind.annotation.*; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -41,4 +39,8 @@ public class DingInfoPullController { | |||||
organizationBatchGetTask.batchGetOrganizationTask(); | organizationBatchGetTask.batchGetOrganizationTask(); | ||||
} | } | ||||
@GetMapping("/employee/{regionCode}") | |||||
public void employeeBatchGetByRegionCode(@PathVariable String regionCode) { | |||||
employeeBatchGetTask.batchGetEmployeeTaskByRegionCode(regionCode); | |||||
} | |||||
} | } |
@@ -194,7 +194,7 @@ public class EmployeeBatchGetTask { | |||||
dingEmployeeInfoSaveRecordList = dingEmployeeInfoSaveRecordList.stream() | dingEmployeeInfoSaveRecordList = dingEmployeeInfoSaveRecordList.stream() | ||||
.filter(r -> "true".equals(r.getMainJob()) | .filter(r -> "true".equals(r.getMainJob()) | ||||
&& "A".equals(r.getEmpStatus()) | && "A".equals(r.getEmpStatus()) | ||||
&& StringUtils.isNotBlank(r.getOrganizationCode()) | |||||
&& StringUtils.isNotBlank(r.getEmpPosUnitCode()) | |||||
&& StringUtils.isNotBlank(r.getEmployeeCode()) | && StringUtils.isNotBlank(r.getEmployeeCode()) | ||||
).collect(Collectors.toList()); | ).collect(Collectors.toList()); | ||||
@@ -203,16 +203,19 @@ public class EmployeeBatchGetTask { | |||||
List<DingEmployeeInfo> saveList = new ArrayList<>(); | List<DingEmployeeInfo> saveList = new ArrayList<>(); | ||||
for (DingEmployeeInfo dingEmployeeInfo : dingEmployeeInfoSaveRecordList) { | for (DingEmployeeInfo dingEmployeeInfo : dingEmployeeInfoSaveRecordList) { | ||||
if (uniqueKeySet.add(dingEmployeeInfo.getEmployeeCode() + dingEmployeeInfo.getOrganizationCode())) { | |||||
if (uniqueKeySet.add(dingEmployeeInfo.getEmployeeCode() + dingEmployeeInfo.getEmpPosUnitCode())) { | |||||
saveList.add(dingEmployeeInfo); | saveList.add(dingEmployeeInfo); | ||||
} | } | ||||
} | } | ||||
List<DingOrganization> organizations = iDingOrganizationService.list(); | |||||
Map<String, DingOrganization> organizationMap = organizations.stream().collect(Collectors.toMap(DingOrganization::getOrganizationCode, o -> o)); | |||||
for (DingEmployeeInfo dingEmployeeInfo : saveList) { | for (DingEmployeeInfo dingEmployeeInfo : saveList) { | ||||
String employeeCode = dingEmployeeInfo.getEmployeeCode(); | String employeeCode = dingEmployeeInfo.getEmployeeCode(); | ||||
DingEmployeeInfo employeeInfo = iDingEmployeeInfoService.getOne(Wrappers.lambdaQuery(DingEmployeeInfo.class) | DingEmployeeInfo employeeInfo = iDingEmployeeInfoService.getOne(Wrappers.lambdaQuery(DingEmployeeInfo.class) | ||||
.eq(DingEmployeeInfo::getOrganizationCode, dingEmployeeInfo.getOrganizationCode()) | |||||
.eq(DingEmployeeInfo::getEmpPosUnitCode, dingEmployeeInfo.getEmpPosUnitCode()) | |||||
.eq(DingEmployeeInfo::getEmployeeCode, employeeCode)); | .eq(DingEmployeeInfo::getEmployeeCode, employeeCode)); | ||||
if (Objects.isNull(employeeInfo)) { | if (Objects.isNull(employeeInfo)) { | ||||
iDingEmployeeInfoService.save(dingEmployeeInfo); | iDingEmployeeInfoService.save(dingEmployeeInfo); | ||||
@@ -220,11 +223,11 @@ public class EmployeeBatchGetTask { | |||||
dingEmployeeInfo.setId(employeeInfo.getId()); | dingEmployeeInfo.setId(employeeInfo.getId()); | ||||
iDingEmployeeInfoService.saveOrUpdate(dingEmployeeInfo); | iDingEmployeeInfoService.saveOrUpdate(dingEmployeeInfo); | ||||
} | } | ||||
generateOrUpdateUserInfo(dingEmployeeInfo); | |||||
generateOrUpdateUserInfo(dingEmployeeInfo,organizationMap); | |||||
} | } | ||||
} | } | ||||
public void generateOrUpdateUserInfo(DingEmployeeInfo dingEmployeeInfo) { | |||||
public void generateOrUpdateUserInfo(DingEmployeeInfo dingEmployeeInfo,Map<String, DingOrganization> organizationMap) { | |||||
String employeeCode = dingEmployeeInfo.getEmployeeCode(); | String employeeCode = dingEmployeeInfo.getEmployeeCode(); | ||||
UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) | UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) | ||||
.eq(UserInfo::getEmployeeCode, employeeCode)); | .eq(UserInfo::getEmployeeCode, employeeCode)); | ||||
@@ -239,11 +242,98 @@ public class EmployeeBatchGetTask { | |||||
.updateBy(-1L) | .updateBy(-1L) | ||||
.createOn(LocalDateTime.now()) | .createOn(LocalDateTime.now()) | ||||
.updateOn(LocalDateTime.now()) | .updateOn(LocalDateTime.now()) | ||||
.empPosUnitCode(dingEmployeeInfo.getEmpPosUnitCode()) | |||||
.build(); | .build(); | ||||
if(StringUtils.isNotBlank(userInfo.getEmpPosUnitCode()) && organizationMap.containsKey(userInfo.getEmpPosUnitCode())){ | |||||
DingOrganization dingOrganization = organizationMap.get(userInfo.getEmpPosUnitCode()); | |||||
userInfo.setEmpPosUnitName(dingOrganization.getOrganizationName()); | |||||
userInfo.setRegionCode(dingOrganization.getDivisionCode()); | |||||
} | |||||
iUserInfoService.save(userInfo); | iUserInfoService.save(userInfo); | ||||
} | } | ||||
} | } | ||||
/** | |||||
* 按区域 来更新员工 | |||||
* @param regionCode | |||||
*/ | |||||
public void batchGetEmployeeTaskByRegionCode(String regionCode) { | |||||
List<DingOrganization> units = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) | |||||
.eq(DingOrganization::getTypeCode, "GOV_UNIT") | |||||
.eq(DingOrganization::getDivisionCode, regionCode)); | |||||
log.info("所有地区 {} 待更新员工的单位数:{}",regionCode,units.size()); | |||||
if (CollUtil.isNotEmpty(units)) { | |||||
//记录任务 单位数 | |||||
Integer index = 0; | |||||
for (DingOrganization dingOrganization : units) { | |||||
log.info("当前单位:{},下标数,{}",dingOrganization.getOrganizationName(),index); | |||||
index++; | |||||
List<OrganizationEmployeePosition> allOrganizationEmployeePositionList = new ArrayList<>(); | |||||
String organizationCode = dingOrganization.getOrganizationCode(); | |||||
PageOrganizationEmployeePositionsQuery query = new PageOrganizationEmployeePositionsQuery(); | |||||
query.setEmployeeStatus("A"); | |||||
query.setOrganizationCode(organizationCode); | |||||
query.setReturnTotalSize(true); | |||||
query.setTenantId(zwddIntegrationProperties.getTenantId()); | |||||
int pageNo = 1; | |||||
query.setPageNo(pageNo); | |||||
query.setPageSize(PAGE_SIZE); | |||||
// 查询组织下 用户信息 | |||||
GenericResult<Page<OrganizationEmployeePosition>> firstPageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); | |||||
Page<OrganizationEmployeePosition> data = firstPageGenericResult.getData(); | |||||
if (Objects.isNull(data)){ | |||||
log.info("响应为空:{}",organizationCode); | |||||
continue; | |||||
} | |||||
if (CollUtil.isNotEmpty(data.getData())) { | |||||
allOrganizationEmployeePositionList.addAll(data.getData()); | |||||
} | |||||
Long totalSize = data.getTotalSize(); | |||||
log.info("dingOrganization :{}", JSON.toJSONString(dingOrganization)); | |||||
log.info("totalSize :{},{}", totalSize,dingOrganization.getOrganizationName()); | |||||
if (totalSize > PAGE_SIZE) { | |||||
if (totalSize > MAX_SIZE) { | |||||
//超过1万 按1万的处理 | |||||
totalSize = MAX_SIZE.longValue(); | |||||
} | |||||
int restPageNo = totalSize % PAGE_SIZE > 0 ? 1 : 0; | |||||
int maxPageNo = (int) Math.ceil(totalSize / PAGE_SIZE) + restPageNo; | |||||
for (pageNo = 2; pageNo <= maxPageNo; pageNo++) { | |||||
query.setPageNo(pageNo); | |||||
GenericResult<Page<OrganizationEmployeePosition>> pageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); | |||||
// log.info("pageGenericResult :{}", JSON.toJSONString(pageGenericResult)); | |||||
if(pageGenericResult.isSuccess()){ | |||||
allOrganizationEmployeePositionList.addAll(pageGenericResult.getData().getData()); | |||||
}else{ | |||||
log.error(pageGenericResult.getMsg()); | |||||
} | |||||
} | |||||
} | |||||
// 批量查询 成员的accountId | |||||
List<DingEmployeeInfo> dingEmployeeInfoSaveRecordList = new ArrayList<>(); | |||||
if (allOrganizationEmployeePositionList.size() <= GROUP_SIZE) { | |||||
log.info("assemblerAccountId :{}", allOrganizationEmployeePositionList.size()); | |||||
assemblerAccountId(allOrganizationEmployeePositionList, dingEmployeeInfoSaveRecordList); | |||||
} else { | |||||
log.info("assemblerAccountId :{}", allOrganizationEmployeePositionList.size()); | |||||
List<List<OrganizationEmployeePosition>> split = Lists.partition(allOrganizationEmployeePositionList, GROUP_SIZE); | |||||
for (List<OrganizationEmployeePosition> segment : split) { | |||||
assemblerAccountId(segment, dingEmployeeInfoSaveRecordList); | |||||
} | |||||
} | |||||
// 批量保存用户信息 | |||||
saveBatch(dingEmployeeInfoSaveRecordList); | |||||
} | |||||
} | |||||
} | |||||
// if (saveList.size() <= GROUP_SIZE) { | // if (saveList.size() <= GROUP_SIZE) { | ||||
// iDingEmployeeInfoService.saveBatch(saveList); | // iDingEmployeeInfoService.saveBatch(saveList); | ||||
// } else { | // } else { | ||||
@@ -2,11 +2,17 @@ package com.ningdatech.pmapi.filemanage.controller; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.pmapi.filemanage.manage.DocumentationManage; | import com.ningdatech.pmapi.filemanage.manage.DocumentationManage; | ||||
import com.ningdatech.pmapi.filemanage.model.dto.DocumentationGroupSaveDTO; | |||||
import com.ningdatech.pmapi.filemanage.model.dto.DocumentationSaveDTO; | |||||
import com.ningdatech.pmapi.filemanage.model.param.DocumentationListParam; | import com.ningdatech.pmapi.filemanage.model.param.DocumentationListParam; | ||||
import com.ningdatech.pmapi.filemanage.model.vo.DocumentationGroupVO; | |||||
import com.ningdatech.pmapi.filemanage.model.vo.DocumentationVO; | import com.ningdatech.pmapi.filemanage.model.vo.DocumentationVO; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @Classname DocumentationController | * @Classname DocumentationController | ||||
@@ -18,12 +24,50 @@ import org.springframework.web.bind.annotation.*; | |||||
@AllArgsConstructor | @AllArgsConstructor | ||||
@Api(tags = "档案管理-资料文档控制器") | @Api(tags = "档案管理-资料文档控制器") | ||||
@RequestMapping("/api/v1/file-manage/documentation") | @RequestMapping("/api/v1/file-manage/documentation") | ||||
@Validated | |||||
public class DocumentationController { | public class DocumentationController { | ||||
private final DocumentationManage documentationManage; | private final DocumentationManage documentationManage; | ||||
@GetMapping("/group/list") | |||||
@ApiOperation(value = "分组列表", notes = "分组列表") | |||||
public List<DocumentationGroupVO> groupList(){ | |||||
return documentationManage.groupList(); | |||||
} | |||||
@PostMapping("/group/add") | |||||
@ApiOperation(value = "分组添加", notes = "分组添加") | |||||
public String addGroup(@Validated @RequestBody DocumentationGroupSaveDTO dto){ | |||||
return documentationManage.addGroup(dto); | |||||
} | |||||
@PostMapping("/group/delete/{id}") | |||||
@ApiOperation(value = "分组删除", notes = "分组删除") | |||||
public String deleteGroup(@PathVariable Long id){ | |||||
return documentationManage.deleteGroup(id); | |||||
} | |||||
@GetMapping("/list") | @GetMapping("/list") | ||||
@ApiOperation(value = "文档列表", notes = "文档列表") | |||||
public PageVo<DocumentationVO> list(@ModelAttribute DocumentationListParam param){ | public PageVo<DocumentationVO> list(@ModelAttribute DocumentationListParam param){ | ||||
return documentationManage.list(param); | return documentationManage.list(param); | ||||
} | } | ||||
@GetMapping("/detail/{id}") | |||||
@ApiOperation(value = "文档详情", notes = "文档详情") | |||||
public DocumentationVO detail(@PathVariable Long id){ | |||||
return documentationManage.detail(id); | |||||
} | |||||
@PostMapping("/add") | |||||
@ApiOperation(value = "文档添加", notes = "文档添加") | |||||
public String addDoc(@Validated @RequestBody DocumentationSaveDTO dto){ | |||||
return documentationManage.addDoc(dto); | |||||
} | |||||
@PostMapping("/delete/{id}") | |||||
@ApiOperation(value = "文档删除", notes = "文档删除") | |||||
public String deleteDoc(@PathVariable Long id){ | |||||
return documentationManage.deleteDoc(id); | |||||
} | |||||
} | } |
@@ -0,0 +1,46 @@ | |||||
package com.ningdatech.pmapi.filemanage.controller; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.pmapi.filemanage.manage.ProjectFileManage; | |||||
import com.ningdatech.pmapi.filemanage.model.param.ProjectFileListParam; | |||||
import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileListVO; | |||||
import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileVO; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.AllArgsConstructor; | |||||
import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.*; | |||||
/** | |||||
* @Classname ProjectFileController | |||||
* @Description | |||||
* @Date 2023/6/6 15:48 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@RestController | |||||
@AllArgsConstructor | |||||
@Api(tags = "档案管理-项目档案") | |||||
@RequestMapping("/api/v1/file-manage/project-file") | |||||
@Validated | |||||
public class ProjectFileController { | |||||
private final ProjectFileManage projectFileManage; | |||||
@GetMapping("/list") | |||||
@ApiOperation(value = "档案列表", notes = "档案列表") | |||||
public PageVo<ProjectFileListVO> list(@ModelAttribute ProjectFileListParam param){ | |||||
return projectFileManage.list(param); | |||||
} | |||||
@GetMapping("/{projectId}") | |||||
@ApiOperation(value = "档案详情", notes = "档案详情") | |||||
public ProjectFileVO file(@PathVariable Long projectId){ | |||||
return projectFileManage.file(projectId); | |||||
} | |||||
@PostMapping("/want-read/{projectId}") | |||||
@ApiOperation(value = "申请借阅", notes = "申请借阅") | |||||
public String wantRead(@PathVariable Long projectId){ | |||||
return projectFileManage.wantRead(projectId); | |||||
} | |||||
} |
@@ -3,15 +3,28 @@ package com.ningdatech.pmapi.filemanage.manage; | |||||
import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.function.VUtils; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.file.entity.File; | |||||
import com.ningdatech.file.service.FileService; | |||||
import com.ningdatech.pmapi.filemanage.model.dto.DocumentationGroupSaveDTO; | |||||
import com.ningdatech.pmapi.filemanage.model.dto.DocumentationSaveDTO; | |||||
import com.ningdatech.pmapi.filemanage.model.entity.Documentation; | import com.ningdatech.pmapi.filemanage.model.entity.Documentation; | ||||
import com.ningdatech.pmapi.filemanage.model.entity.DocumentationGroup; | |||||
import com.ningdatech.pmapi.filemanage.model.param.DocumentationListParam; | import com.ningdatech.pmapi.filemanage.model.param.DocumentationListParam; | ||||
import com.ningdatech.pmapi.filemanage.model.vo.DocumentationGroupVO; | |||||
import com.ningdatech.pmapi.filemanage.model.vo.DocumentationVO; | import com.ningdatech.pmapi.filemanage.model.vo.DocumentationVO; | ||||
import com.ningdatech.pmapi.filemanage.service.IDocumentationGroupService; | |||||
import com.ningdatech.pmapi.filemanage.service.IDocumentationService; | import com.ningdatech.pmapi.filemanage.service.IDocumentationService; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | |||||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.time.LocalDateTime; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
@@ -29,6 +42,20 @@ public class DocumentationManage { | |||||
private final IDocumentationService documentationService; | private final IDocumentationService documentationService; | ||||
private final IDocumentationGroupService documentationGroupService; | |||||
private final FileService fileService; | |||||
/** | |||||
* | |||||
* @return | |||||
*/ | |||||
public List<DocumentationGroupVO> groupList() { | |||||
List<DocumentationGroup> list = documentationGroupService.list(); | |||||
return list.stream().map(g -> BeanUtil.copyProperties(g,DocumentationGroupVO.class)).collect(Collectors.toList()); | |||||
} | |||||
/** | /** | ||||
* 文档列表 | * 文档列表 | ||||
* @param param | * @param param | ||||
@@ -49,4 +76,98 @@ public class DocumentationManage { | |||||
return PageVo.of(vos,page.getTotal()); | return PageVo.of(vos,page.getTotal()); | ||||
} | } | ||||
/** | |||||
* 增加分组 | |||||
* @param dto | |||||
* @return | |||||
*/ | |||||
public String addGroup(DocumentationGroupSaveDTO dto) { | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
if(documentationGroupService.count(Wrappers.lambdaQuery(DocumentationGroup.class) | |||||
.eq(DocumentationGroup::getName,dto.getName())) > 0){ | |||||
throw new BizException("此分组名 已经存在"); | |||||
} | |||||
DocumentationGroup documentationGroup = BeanUtil.copyProperties(dto, DocumentationGroup.class); | |||||
documentationGroup.setCreateBy(user.getRealName()); | |||||
documentationGroup.setCreateOn(LocalDateTime.now()); | |||||
if(documentationGroupService.save(documentationGroup)){ | |||||
return "添加成功"; | |||||
} | |||||
return "添加失败"; | |||||
} | |||||
/** | |||||
* 删除分组 同时删除文档 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
@Transactional | |||||
public String deleteGroup(Long id) { | |||||
DocumentationGroup group = documentationGroupService.getById(id); | |||||
VUtils.isTrue(Objects.isNull(group)).throwMessage("该分组不存在!"); | |||||
// | |||||
documentationService.remove(Wrappers.lambdaQuery(Documentation.class) | |||||
.eq(Documentation::getGroupId, id)); | |||||
documentationGroupService.removeById(id); | |||||
return "删除成功"; | |||||
} | |||||
/** | |||||
* 上传文档 | |||||
* @param dto | |||||
* @return | |||||
*/ | |||||
public String addDoc(DocumentationSaveDTO dto) { | |||||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||||
Long fileId = dto.getFileId(); | |||||
File file = fileService.getById(fileId); | |||||
VUtils.isTrue(Objects.isNull(file)).throwMessage("该文件不存在!"); | |||||
DocumentationGroup group = documentationGroupService.getById(dto.getGroupId()); | |||||
VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!"); | |||||
Documentation documentation = new Documentation(); | |||||
documentation.setCreateBy(user.getRealName()); | |||||
documentation.setCreateOn(LocalDateTime.now()); | |||||
documentation.setSize(Objects.nonNull(file.getSize()) ? file.getSize()/1000L : 0L); | |||||
documentation.setFileId(fileId); | |||||
documentation.setGroupId(dto.getGroupId()); | |||||
documentation.setFileName(file.getOriginalFileName()); | |||||
if(documentationService.save(documentation)){ | |||||
documentation.setSort(documentation.getId().intValue()); | |||||
documentationService.updateById(documentation); | |||||
} | |||||
return "添加成功"; | |||||
} | |||||
/** | |||||
* 删除文档 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
public String deleteDoc(Long id) { | |||||
Documentation doc = documentationService.getById(id); | |||||
VUtils.isTrue(Objects.isNull(doc)).throwMessage("该文档不存在!"); | |||||
if(documentationService.removeById(id)){ | |||||
return "删除成功"; | |||||
} | |||||
return "删除失败"; | |||||
} | |||||
public DocumentationVO detail(Long id) { | |||||
Documentation doc = documentationService.getById(id); | |||||
if(Objects.isNull(doc)){ | |||||
return null; | |||||
} | |||||
return BeanUtil.copyProperties(doc,DocumentationVO.class); | |||||
} | |||||
} | } |
@@ -0,0 +1,61 @@ | |||||
package com.ningdatech.pmapi.filemanage.manage; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.pmapi.filemanage.model.param.ProjectFileListParam; | |||||
import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileListVO; | |||||
import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileVO; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.apache.commons.lang3.StringUtils; | |||||
import org.springframework.stereotype.Component; | |||||
import java.util.List; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* @Classname ProjectFileManage | |||||
* @Description | |||||
* @Date 2023/6/6 16:04 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Component | |||||
@AllArgsConstructor | |||||
@Slf4j | |||||
public class ProjectFileManage { | |||||
private final IProjectService projectService; | |||||
public PageVo<ProjectFileListVO> list(ProjectFileListParam param) { | |||||
Page<Project> page = param.page(); | |||||
projectService.page(page,Wrappers.lambdaQuery(Project.class) | |||||
.like(StringUtils.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) | |||||
.like(StringUtils.isNotBlank(param.getBuildOrgName()),Project::getBuildOrgName,param.getBuildOrgName()) | |||||
.orderByDesc(Project::getUpdateOn)); | |||||
if(0L == page.getTotal()){ | |||||
return PageVo.empty(); | |||||
} | |||||
List<ProjectFileListVO> vos = page.getRecords().stream().map(p -> { | |||||
ProjectFileListVO vo = new ProjectFileListVO(); | |||||
vo.setId(p.getId()); | |||||
vo.setCanRead(Boolean.TRUE); | |||||
vo.setBuildOrgName(p.getBuildOrgName()); | |||||
vo.setPojectCode(p.getProjectCode()); | |||||
vo.setProjectName(p.getProjectName()); | |||||
return vo; | |||||
}).collect(Collectors.toList()); | |||||
return PageVo.of(vos,page.getTotal()); | |||||
} | |||||
public ProjectFileVO file(Long projectId) { | |||||
return null; | |||||
} | |||||
public String wantRead(Long projectId) { | |||||
return "申请成功"; | |||||
} | |||||
} |
@@ -0,0 +1,16 @@ | |||||
package com.ningdatech.pmapi.filemanage.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.ningdatech.pmapi.filemanage.model.entity.DocumentationGroup; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-02-27 | |||||
*/ | |||||
public interface DocumentationGroupMapper extends BaseMapper<DocumentationGroup> { | |||||
} |
@@ -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.filemanage.mapper.DocumentationGroupMapper"> | |||||
</mapper> |
@@ -0,0 +1,22 @@ | |||||
package com.ningdatech.pmapi.filemanage.model.dto; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
/** | |||||
* @Classname Documentation | |||||
* @Description | |||||
* @Date 2023/6/6 14:41 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Data | |||||
@ApiModel(value = "DocumentationGroupSaveDTO", description = "DocumentationGroupSaveDTO") | |||||
public class DocumentationGroupSaveDTO { | |||||
@ApiModelProperty("分组名") | |||||
private String name; | |||||
@ApiModelProperty("排序") | |||||
private Integer sort; | |||||
} |
@@ -0,0 +1,29 @@ | |||||
package com.ningdatech.pmapi.filemanage.model.dto; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
/** | |||||
* @Classname Documentation | |||||
* @Description | |||||
* @Date 2023/6/6 14:41 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Data | |||||
@ApiModel(value = "DocumentationSaveDTO", description = "DocumentationSaveDTO") | |||||
public class DocumentationSaveDTO { | |||||
@ApiModelProperty("文档分类ID") | |||||
@NotNull(message = "请传分组ID") | |||||
private Long groupId; | |||||
@ApiModelProperty("文档ID") | |||||
@NotNull(message = "请传文档ID") | |||||
private Long fileId; | |||||
@ApiModelProperty("排序") | |||||
private Integer sort; | |||||
} |
@@ -28,10 +28,10 @@ public class Documentation { | |||||
private String fileName; | private String fileName; | ||||
@ApiModelProperty("上传人") | @ApiModelProperty("上传人") | ||||
private String creatBy; | |||||
private String createBy; | |||||
@ApiModelProperty("上传时间") | @ApiModelProperty("上传时间") | ||||
private LocalDateTime creatOn; | |||||
private LocalDateTime createOn; | |||||
@ApiModelProperty("文档大小 kb") | @ApiModelProperty("文档大小 kb") | ||||
private Long size; | private Long size; | ||||
@@ -39,6 +39,9 @@ public class Documentation { | |||||
@ApiModelProperty("文档分类ID") | @ApiModelProperty("文档分类ID") | ||||
private Long groupId; | private Long groupId; | ||||
@ApiModelProperty("文档ID") | |||||
private Long fileId; | |||||
@ApiModelProperty("排序") | @ApiModelProperty("排序") | ||||
private Integer sort; | private Integer sort; | ||||
} | } |
@@ -25,10 +25,10 @@ public class DocumentationGroup { | |||||
private Long id; | private Long id; | ||||
@ApiModelProperty("上传人") | @ApiModelProperty("上传人") | ||||
private String creatBy; | |||||
private String createBy; | |||||
@ApiModelProperty("上传时间") | @ApiModelProperty("上传时间") | ||||
private LocalDateTime creatOn; | |||||
private LocalDateTime createOn; | |||||
@ApiModelProperty("分组名") | @ApiModelProperty("分组名") | ||||
private String name; | private String name; | ||||
@@ -0,0 +1,22 @@ | |||||
package com.ningdatech.pmapi.filemanage.model.param; | |||||
import com.ningdatech.basic.model.PagePo; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
/** | |||||
* @Classname ProjectFileListParam | |||||
* @Description | |||||
* @Date 2023/6/6 16:06 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Data | |||||
public class ProjectFileListParam extends PagePo { | |||||
@ApiModelProperty("项目名称") | |||||
private String projectName; | |||||
@ApiModelProperty("项目单位") | |||||
private String buildOrgName; | |||||
} |
@@ -0,0 +1,33 @@ | |||||
package com.ningdatech.pmapi.filemanage.model.vo; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* @Classname Documentation | |||||
* @Description | |||||
* @Date 2023/6/6 14:41 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Data | |||||
@ApiModel(value = "nd_documentation_group", description = "资料文档分组") | |||||
public class DocumentationGroupVO { | |||||
@ApiModelProperty("主键") | |||||
private Long id; | |||||
@ApiModelProperty("上传人") | |||||
private String createBy; | |||||
@ApiModelProperty("上传时间") | |||||
private LocalDateTime createOn; | |||||
@ApiModelProperty("分组名") | |||||
private String name; | |||||
@ApiModelProperty("排序") | |||||
private Integer sort; | |||||
} |
@@ -23,10 +23,10 @@ public class DocumentationVO { | |||||
private String fileName; | private String fileName; | ||||
@ApiModelProperty("上传人") | @ApiModelProperty("上传人") | ||||
private String creatBy; | |||||
private String createBy; | |||||
@ApiModelProperty("上传时间") | @ApiModelProperty("上传时间") | ||||
private LocalDateTime creatOn; | |||||
private LocalDateTime createOn; | |||||
@ApiModelProperty("文档大小 kb") | @ApiModelProperty("文档大小 kb") | ||||
private Long size; | private Long size; | ||||
@@ -0,0 +1,36 @@ | |||||
package com.ningdatech.pmapi.filemanage.model.vo; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* @Classname Documentation | |||||
* @Description | |||||
* @Date 2023/6/6 14:41 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Data | |||||
@ApiModel(value = "ProjectFileListVO", description = "资料文档") | |||||
public class ProjectFileListVO { | |||||
@ApiModelProperty("项目ID") | |||||
private Long id; | |||||
@ApiModelProperty("项目名称") | |||||
private String projectName; | |||||
@ApiModelProperty("项目单位") | |||||
private String buildOrgName; | |||||
@ApiModelProperty("项目编号") | |||||
private String pojectCode; | |||||
@ApiModelProperty("是否可阅") | |||||
private Boolean canRead = Boolean.FALSE; | |||||
@ApiModelProperty("最后修改时间") | |||||
private LocalDateTime updateOn; | |||||
} |
@@ -0,0 +1,36 @@ | |||||
package com.ningdatech.pmapi.filemanage.model.vo; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* @Classname ProjectFileVO | |||||
* @Description | |||||
* @Date 2023/6/6 14:41 | |||||
* @Author PoffyZhang | |||||
*/ | |||||
@Data | |||||
@ApiModel(value = "ProjectFileVO", description = "项目档案") | |||||
public class ProjectFileVO { | |||||
@ApiModelProperty("项目ID") | |||||
private Long id; | |||||
@ApiModelProperty("项目名称") | |||||
private String projectName; | |||||
@ApiModelProperty("项目单位") | |||||
private String buildOrgName; | |||||
@ApiModelProperty("项目编号") | |||||
private String pojectCode; | |||||
@ApiModelProperty("是否可阅") | |||||
private Boolean canRead = Boolean.FALSE; | |||||
@ApiModelProperty("最后修改时间") | |||||
private LocalDateTime updateOn; | |||||
} |
@@ -0,0 +1,9 @@ | |||||
package com.ningdatech.pmapi.filemanage.service; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
import com.ningdatech.pmapi.filemanage.model.entity.DocumentationGroup; | |||||
public interface IDocumentationGroupService extends IService<DocumentationGroup> { | |||||
} |
@@ -0,0 +1,20 @@ | |||||
package com.ningdatech.pmapi.filemanage.service.impl; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import com.ningdatech.pmapi.filemanage.mapper.DocumentationGroupMapper; | |||||
import com.ningdatech.pmapi.filemanage.model.entity.DocumentationGroup; | |||||
import com.ningdatech.pmapi.filemanage.service.IDocumentationGroupService; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author Poffy | |||||
* @since 2023-02-13 | |||||
*/ | |||||
@Service | |||||
public class DocumentationGroupServiceImpl extends ServiceImpl<DocumentationGroupMapper, DocumentationGroup> implements IDocumentationGroupService { | |||||
} |
@@ -40,4 +40,5 @@ public class VerifyCodeCheckHelper { | |||||
return verificationCode.trim().equals(cache.getCode()); | return verificationCode.trim().equals(cache.getCode()); | ||||
} | } | ||||
} | } |
@@ -45,6 +45,9 @@ public class UserInfo implements Serializable { | |||||
private String regionCode; | private String regionCode; | ||||
private String empPosUnitCode; | |||||
private String empPosUnitName; | |||||
@TableField(fill = FieldFill.INSERT) | @TableField(fill = FieldFill.INSERT) | ||||
private LocalDateTime createOn; | private LocalDateTime createOn; | ||||
@@ -63,6 +63,7 @@ public class UserInfoManage { | |||||
String phoneNo = req.getPhoneNo(); | String phoneNo = req.getPhoneNo(); | ||||
String orgCode = req.getOrgCode(); | String orgCode = req.getOrgCode(); | ||||
String name = req.getName(); | String name = req.getName(); | ||||
String orgName = req.getOrgName(); | |||||
Long regionId = req.getRegionId(); | Long regionId = req.getRegionId(); | ||||
List<Long> userIdList = getRoleCompliantUserIdList(req.getUserRoleList()); | List<Long> userIdList = getRoleCompliantUserIdList(req.getUserRoleList()); | ||||
@@ -71,19 +72,14 @@ public class UserInfoManage { | |||||
pageVo.setTotal(0L); | pageVo.setTotal(0L); | ||||
return pageVo; | return pageVo; | ||||
} | } | ||||
List<String> compliantOrgEmpCodeList = getCompliantOrgEmpCodeList(req.getOrgName(), orgCode); | |||||
if (compliantOrgEmpCodeList != null && compliantOrgEmpCodeList.size() == 0) { | |||||
pageVo.setRecords(new ArrayList<>()); | |||||
pageVo.setTotal(0L); | |||||
return pageVo; | |||||
} | |||||
LambdaQueryWrapper<UserInfo> wrapper = Wrappers.lambdaQuery(UserInfo.class) | LambdaQueryWrapper<UserInfo> wrapper = Wrappers.lambdaQuery(UserInfo.class) | ||||
.like(StringUtils.isNotBlank(phoneNo), UserInfo::getMobile, phoneNo) | .like(StringUtils.isNotBlank(phoneNo), UserInfo::getMobile, phoneNo) | ||||
.like(StringUtils.isNotBlank(name), UserInfo::getRealName, name) | .like(StringUtils.isNotBlank(name), UserInfo::getRealName, name) | ||||
.in(Objects.nonNull(userIdList), UserInfo::getId, userIdList) | .in(Objects.nonNull(userIdList), UserInfo::getId, userIdList) | ||||
.eq(Objects.nonNull(regionId), UserInfo::getRegionCode,regionId) | .eq(Objects.nonNull(regionId), UserInfo::getRegionCode,regionId) | ||||
.in(Objects.nonNull(compliantOrgEmpCodeList), UserInfo::getEmployeeCode, compliantOrgEmpCodeList) | |||||
.like(StringUtils.isNotBlank(orgName), UserInfo::getEmpPosUnitName, orgName) | |||||
.eq(StringUtils.isNotBlank(orgCode), UserInfo::getEmpPosUnitCode, orgCode) | |||||
.orderByDesc(UserInfo::getUpdateOn); | .orderByDesc(UserInfo::getUpdateOn); | ||||
Page<UserInfo> page = iUserInfoService.page(new Page<>(req.getPageNumber(), req.getPageSize()), wrapper); | Page<UserInfo> page = iUserInfoService.page(new Page<>(req.getPageNumber(), req.getPageSize()), wrapper); | ||||
@@ -136,7 +132,7 @@ public class UserInfoManage { | |||||
if (StringUtils.isNotBlank(orgName)) { | if (StringUtils.isNotBlank(orgName)) { | ||||
List<DingOrganization> dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) | List<DingOrganization> dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) | ||||
.like(DingOrganization::getOrganizationName, orgName) | .like(DingOrganization::getOrganizationName, orgName) | ||||
.notIn(DingOrganization::getTypeCode, "GOV_INTERNAL_INSTITUTION") | |||||
.eq(DingOrganization::getTypeCode, "GOV_UNIT") | |||||
); | ); | ||||
List<String> compliantOrgNameCodeList = dingOrganizationList.stream() | List<String> compliantOrgNameCodeList = dingOrganizationList.stream() | ||||
@@ -1,8 +1,11 @@ | |||||
package com.ningdatech.pmapi.user.security.auth.credential; | package com.ningdatech.pmapi.user.security.auth.credential; | ||||
import com.ningdatech.basic.model.GenericResult; | import com.ningdatech.basic.model.GenericResult; | ||||
import com.ningdatech.pmapi.sms.constant.VerificationCodeType; | |||||
import com.ningdatech.pmapi.sms.helper.VerifyCodeCheckHelper; | |||||
import com.ningdatech.pmapi.user.constant.LoginTypeEnum; | import com.ningdatech.pmapi.user.constant.LoginTypeEnum; | ||||
import com.ningdatech.pmapi.user.security.auth.constants.UserDeatilsServiceConstant; | import com.ningdatech.pmapi.user.security.auth.constants.UserDeatilsServiceConstant; | ||||
import com.ningdatech.pmapi.user.security.auth.validate.CommonLoginException; | |||||
import com.ningdatech.zwdd.client.ZwddAuthClient; | import com.ningdatech.zwdd.client.ZwddAuthClient; | ||||
import org.springframework.security.authentication.AuthenticationProvider; | import org.springframework.security.authentication.AuthenticationProvider; | ||||
import org.springframework.security.authentication.BadCredentialsException; | import org.springframework.security.authentication.BadCredentialsException; | ||||
@@ -27,6 +30,11 @@ public class CredentialAuthProvider implements AuthenticationProvider { | |||||
private ZwddAuthClient zwddAuthClient; | private ZwddAuthClient zwddAuthClient; | ||||
private Boolean phoneVerifyCodeSkip; | |||||
private VerifyCodeCheckHelper verifyCodeCheckHelper; | |||||
@Override | @Override | ||||
public Authentication authenticate(Authentication authentication) throws AuthenticationException { | public Authentication authenticate(Authentication authentication) throws AuthenticationException { | ||||
if (!(authentication instanceof CredentialAuthToken)) { | if (!(authentication instanceof CredentialAuthToken)) { | ||||
@@ -37,6 +45,7 @@ public class CredentialAuthProvider implements AuthenticationProvider { | |||||
UserDetails user = null; | UserDetails user = null; | ||||
LoginTypeEnum loginTypeEnum = authenticationToken.getLoginTypeEnum(); | LoginTypeEnum loginTypeEnum = authenticationToken.getLoginTypeEnum(); | ||||
String credentials = (String) authenticationToken.getCredentials(); | |||||
switch (loginTypeEnum) { | switch (loginTypeEnum) { | ||||
case DING_QR_LOGIN: { | case DING_QR_LOGIN: { | ||||
String code = (String) authenticationToken.getCredentials(); | String code = (String) authenticationToken.getCredentials(); | ||||
@@ -52,7 +61,13 @@ public class CredentialAuthProvider implements AuthenticationProvider { | |||||
} | } | ||||
break; | break; | ||||
case PHONE_VERIFICATION_CODE_LOGIN: { | case PHONE_VERIFICATION_CODE_LOGIN: { | ||||
// TODO 校验短信验证码 | |||||
if (!phoneVerifyCodeSkip) { | |||||
// 校验短信验证码 | |||||
boolean verificationResult = verifyCodeCheckHelper.verification(VerificationCodeType.LOGIN, principal, credentials); | |||||
if (!verificationResult) { | |||||
throw new CommonLoginException("验证码错误"); | |||||
} | |||||
} | |||||
user = userDetailsService.loadUserByUsername(principal + UserDeatilsServiceConstant.USER_DETAILS_SERVICE_SEPARATOR + loginTypeEnum.name()); | user = userDetailsService.loadUserByUsername(principal + UserDeatilsServiceConstant.USER_DETAILS_SERVICE_SEPARATOR + loginTypeEnum.name()); | ||||
} | } | ||||
break; | break; | ||||
@@ -95,4 +110,12 @@ public class CredentialAuthProvider implements AuthenticationProvider { | |||||
this.zwddAuthClient = zwddAuthClient; | this.zwddAuthClient = zwddAuthClient; | ||||
} | } | ||||
public void setVerifyCodeCheckHelper(VerifyCodeCheckHelper verifyCodeCheckHelper) { | |||||
this.verifyCodeCheckHelper = verifyCodeCheckHelper; | |||||
} | |||||
public void setPhoneVerifyCodeSkip(Boolean phoneVerifyCodeSkip) { | |||||
this.phoneVerifyCodeSkip = phoneVerifyCodeSkip; | |||||
} | |||||
} | } |
@@ -1,9 +1,11 @@ | |||||
package com.ningdatech.pmapi.user.security.auth.credential; | package com.ningdatech.pmapi.user.security.auth.credential; | ||||
import com.ningdatech.pmapi.sms.helper.VerifyCodeCheckHelper; | |||||
import com.ningdatech.pmapi.user.security.auth.AuthProperties; | import com.ningdatech.pmapi.user.security.auth.AuthProperties; | ||||
import com.ningdatech.zwdd.client.ZwddAuthClient; | import com.ningdatech.zwdd.client.ZwddAuthClient; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.beans.factory.annotation.Qualifier; | import org.springframework.beans.factory.annotation.Qualifier; | ||||
import org.springframework.beans.factory.annotation.Value; | |||||
import org.springframework.security.authentication.AuthenticationManager; | import org.springframework.security.authentication.AuthenticationManager; | ||||
import org.springframework.security.config.annotation.SecurityConfigurerAdapter; | import org.springframework.security.config.annotation.SecurityConfigurerAdapter; | ||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||||
@@ -21,6 +23,8 @@ import org.springframework.stereotype.Component; | |||||
@Component | @Component | ||||
public class CredentialAuthSecurityConfig | public class CredentialAuthSecurityConfig | ||||
extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> { | extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> { | ||||
@Value("${login.phone-verify-code.skip:false}") | |||||
private Boolean skipLoginVerifyCodeCheck; | |||||
@Autowired | @Autowired | ||||
@Qualifier(value = "defaultLoginSuccessHandler") | @Qualifier(value = "defaultLoginSuccessHandler") | ||||
@@ -45,6 +49,9 @@ public class CredentialAuthSecurityConfig | |||||
@Autowired | @Autowired | ||||
private ZwddAuthClient zwddAuthClient; | private ZwddAuthClient zwddAuthClient; | ||||
@Autowired | |||||
private VerifyCodeCheckHelper verifyCodeCheckHelper; | |||||
@Override | @Override | ||||
public void configure(HttpSecurity http) throws Exception { | public void configure(HttpSecurity http) throws Exception { | ||||
CredentialAuthFilter credentialAuthFilter = | CredentialAuthFilter credentialAuthFilter = | ||||
@@ -55,11 +62,13 @@ public class CredentialAuthSecurityConfig | |||||
credentialAuthFilter.setAuthenticationFailureHandler(defaultLoginFailureHandler); | credentialAuthFilter.setAuthenticationFailureHandler(defaultLoginFailureHandler); | ||||
CredentialAuthProvider authenticationProvider = new CredentialAuthProvider(); | CredentialAuthProvider authenticationProvider = new CredentialAuthProvider(); | ||||
authenticationProvider.setPhoneVerifyCodeSkip(skipLoginVerifyCodeCheck); | |||||
authenticationProvider.setUserDetailsService(credentialLoginUserDetailService); | authenticationProvider.setUserDetailsService(credentialLoginUserDetailService); | ||||
// 确保对密码进行加密的encoder和解密的encoder相同 | // 确保对密码进行加密的encoder和解密的encoder相同 | ||||
authenticationProvider.setPasswordEncoder(passwordEncoder); | authenticationProvider.setPasswordEncoder(passwordEncoder); | ||||
// 传入浙政钉client | // 传入浙政钉client | ||||
authenticationProvider.setZwddAuthClient(zwddAuthClient); | authenticationProvider.setZwddAuthClient(zwddAuthClient); | ||||
authenticationProvider.setVerifyCodeCheckHelper(verifyCodeCheckHelper); | |||||
http.authenticationProvider(authenticationProvider).addFilterAfter(credentialAuthFilter, | http.authenticationProvider(authenticationProvider).addFilterAfter(credentialAuthFilter, | ||||
UsernamePasswordAuthenticationFilter.class); | UsernamePasswordAuthenticationFilter.class); | ||||
@@ -210,3 +210,8 @@ irs: | |||||
api-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220309000004/seal-platform/seal/v1/rest/sign/signPdf | api-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220309000004/seal-platform/seal/v1/rest/sign/signPdf | ||||
hostname: iZbp13nwyvib53j4j1p2xoZ | hostname: iZbp13nwyvib53j4j1p2xoZ | ||||
login: | |||||
phone-verify-code: | |||||
skip: true | |||||
@@ -209,4 +209,8 @@ irs: | |||||
secret-key: bebff29877d4443abd67fc4f8fb335d8 | secret-key: bebff29877d4443abd67fc4f8fb335d8 | ||||
api-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220309000004/seal-platform/seal/v1/rest/sign/signPdf | api-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220309000004/seal-platform/seal/v1/rest/sign/signPdf | ||||
hostname: iZ6mx01gyeodd80imxd2gbZ | |||||
hostname: iZ6mx01gyeodd80imxd2gbZ | |||||
login: | |||||
phone-verify-code: | |||||
skip: true | |||||