|
|
@ -16,19 +16,16 @@ import net.lab1024.sa.admin.module.service.domain.entity.ServiceApplicationsEnti |
|
|
import net.lab1024.sa.admin.module.service.domain.form.*; |
|
|
import net.lab1024.sa.admin.module.service.domain.form.*; |
|
|
import net.lab1024.sa.admin.module.service.domain.form.LawyerStatisticsQueryForm; |
|
|
import net.lab1024.sa.admin.module.service.domain.form.LawyerStatisticsQueryForm; |
|
|
import net.lab1024.sa.admin.common.enums.DateTimeEnum; |
|
|
import net.lab1024.sa.admin.common.enums.DateTimeEnum; |
|
|
import net.lab1024.sa.admin.module.service.domain.vo.ActivityCategoryConverter; |
|
|
import net.lab1024.sa.admin.module.service.domain.vo.*; |
|
|
import net.lab1024.sa.admin.module.service.domain.vo.ActivityNameConverter; |
|
|
|
|
|
import net.lab1024.sa.admin.module.service.domain.vo.EmployeeNameConverter; |
|
|
|
|
|
import net.lab1024.sa.admin.module.service.domain.vo.OrganizationNameConverter; |
|
|
|
|
|
import net.lab1024.sa.admin.module.service.domain.vo.LawyerStatisticsVO; |
|
|
|
|
|
import net.lab1024.sa.admin.module.service.domain.vo.ServiceApplicationsTemplateVO; |
|
|
|
|
|
import net.lab1024.sa.admin.module.service.domain.vo.ServiceApplicationsVO; |
|
|
|
|
|
import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeViewTypeEnum; |
|
|
import net.lab1024.sa.admin.module.system.datascope.constant.DataScopeViewTypeEnum; |
|
|
import net.lab1024.sa.admin.module.system.datascope.service.DataScopeViewService; |
|
|
import net.lab1024.sa.admin.module.system.datascope.service.DataScopeViewService; |
|
|
import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity; |
|
|
import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity; |
|
|
import net.lab1024.sa.admin.module.system.department.service.DepartmentService; |
|
|
import net.lab1024.sa.admin.module.system.department.service.DepartmentService; |
|
|
import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; |
|
|
import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity; |
|
|
import net.lab1024.sa.admin.module.system.employee.service.EmployeeService; |
|
|
import net.lab1024.sa.admin.module.system.employee.service.EmployeeService; |
|
|
|
|
|
import net.lab1024.sa.admin.module.system.login.domain.RequestEmployee; |
|
|
|
|
|
import net.lab1024.sa.admin.module.system.position.service.PositionService; |
|
|
|
|
|
import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEntity; |
|
|
import net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO; |
|
|
import net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO; |
|
|
import net.lab1024.sa.admin.module.system.role.service.RoleEmployeeService; |
|
|
import net.lab1024.sa.admin.module.system.role.service.RoleEmployeeService; |
|
|
import net.lab1024.sa.admin.module.system.role.service.RoleService; |
|
|
import net.lab1024.sa.admin.module.system.role.service.RoleService; |
|
|
@ -36,9 +33,11 @@ import net.lab1024.sa.admin.util.AdminRequestUtil; |
|
|
import net.lab1024.sa.admin.util.CellStyleStrategy; |
|
|
import net.lab1024.sa.admin.util.CellStyleStrategy; |
|
|
import net.lab1024.sa.admin.util.DateTimeUtil; |
|
|
import net.lab1024.sa.admin.util.DateTimeUtil; |
|
|
import net.lab1024.sa.admin.util.TimeVo; |
|
|
import net.lab1024.sa.admin.util.TimeVo; |
|
|
|
|
|
import net.lab1024.sa.base.common.code.UserErrorCode; |
|
|
import net.lab1024.sa.base.common.domain.PageResult; |
|
|
import net.lab1024.sa.base.common.domain.PageResult; |
|
|
import net.lab1024.sa.base.common.domain.RequestUser; |
|
|
import net.lab1024.sa.base.common.domain.RequestUser; |
|
|
import net.lab1024.sa.base.common.domain.ResponseDTO; |
|
|
import net.lab1024.sa.base.common.domain.ResponseDTO; |
|
|
|
|
|
import net.lab1024.sa.base.common.enumeration.UserTypeEnum; |
|
|
import net.lab1024.sa.base.common.exception.BusinessException; |
|
|
import net.lab1024.sa.base.common.exception.BusinessException; |
|
|
import net.lab1024.sa.base.common.util.SmartBeanUtil; |
|
|
import net.lab1024.sa.base.common.util.SmartBeanUtil; |
|
|
import net.lab1024.sa.base.common.util.SmartPageUtil; |
|
|
import net.lab1024.sa.base.common.util.SmartPageUtil; |
|
|
@ -58,6 +57,7 @@ import java.io.FileOutputStream; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
import java.util.Arrays; |
|
|
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; |
|
|
@ -90,6 +90,37 @@ public class ServiceApplicationsService { |
|
|
private DataScopeViewService dataScopeViewService; |
|
|
private DataScopeViewService dataScopeViewService; |
|
|
@Resource |
|
|
@Resource |
|
|
private RoleEmployeeService roleEmployeeService; |
|
|
private RoleEmployeeService roleEmployeeService; |
|
|
|
|
|
@Resource |
|
|
|
|
|
PositionService positionService; |
|
|
|
|
|
|
|
|
|
|
|
//查看详情
|
|
|
|
|
|
public ServiceApplicationsVO queryDetail(Long applicationId) { |
|
|
|
|
|
ServiceApplicationsVO serviceApplicationsVO = new ServiceApplicationsVO(); |
|
|
|
|
|
ServiceApplicationsEntity item = serviceApplicationsDao.selectById(applicationId); |
|
|
|
|
|
SmartBeanUtil.copyProperties(item, serviceApplicationsVO); |
|
|
|
|
|
|
|
|
|
|
|
if (item.getFirmId() != null) { |
|
|
|
|
|
serviceApplicationsVO.setDepartmentName(departmentService.queryByFirmId(item.getFirmId()).getDepartmentName()); |
|
|
|
|
|
} |
|
|
|
|
|
if (item.getUserId() != null){ |
|
|
|
|
|
serviceApplicationsVO.setUserName(employeeService.queryById(item.getUserId()).getActualName()); |
|
|
|
|
|
} |
|
|
|
|
|
if (item.getFirmAuditUser() != null){ |
|
|
|
|
|
serviceApplicationsVO.setFirmAuditUserName(employeeService.queryById(item.getFirmAuditUser()).getActualName()); |
|
|
|
|
|
} |
|
|
|
|
|
if (item.getActivityCategoryId() != null) { |
|
|
|
|
|
serviceApplicationsVO.setActivityCategory(categoryService.queryById(item.getActivityCategoryId()).getCategoryName()); |
|
|
|
|
|
} |
|
|
|
|
|
if (item.getActivityNameId() != null) { |
|
|
|
|
|
serviceApplicationsVO.setActivityName(goodsService.queryById(item.getActivityNameId()).getGoodsName()); |
|
|
|
|
|
} |
|
|
|
|
|
if (item.getPositionId() != null) { |
|
|
|
|
|
serviceApplicationsVO.setPositionName(positionService.queryById(item.getPositionId()).getPositionName()); |
|
|
|
|
|
} |
|
|
|
|
|
return serviceApplicationsVO; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 分页查询 |
|
|
* 分页查询 |
|
|
*/ |
|
|
*/ |
|
|
@ -99,15 +130,77 @@ public class ServiceApplicationsService { |
|
|
//根据用户角色的查询数据范围来查询数据
|
|
|
//根据用户角色的查询数据范围来查询数据
|
|
|
RequestUser requestUser = AdminRequestUtil.getRequestUser(); |
|
|
RequestUser requestUser = AdminRequestUtil.getRequestUser(); |
|
|
List<RoleVO> roleIdList = roleEmployeeService.getRoleIdList(requestUser.getUserId()); |
|
|
List<RoleVO> roleIdList = roleEmployeeService.getRoleIdList(requestUser.getUserId()); |
|
|
Integer oneByRoleId = dataScopeViewService.getOneByRoleId(roleIdList.get(0).getRoleId()); |
|
|
String roleCode = roleIdList.get(0).getRoleCode(); |
|
|
//获取权限范围
|
|
|
|
|
|
if (DataScopeViewTypeEnum.ME.getValue().equals(oneByRoleId)) { |
|
|
// 检查角色类型
|
|
|
longs = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.ME, requestUser.getUserId()); |
|
|
boolean isAssociationRole = UserTypeEnum.CEO.getDesc().equals(roleCode); |
|
|
} else if (DataScopeViewTypeEnum.DEPARTMENT.getValue().equals(oneByRoleId)) { |
|
|
boolean isFirmAdminRole = UserTypeEnum.CTO.getDesc().equals(roleCode); // 律所管理员
|
|
|
longs = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.DEPARTMENT, requestUser.getUserId()); |
|
|
|
|
|
|
|
|
if (isAssociationRole) { |
|
|
|
|
|
// 协会用户(CEO):可以看到所有律所提交的数据,但只显示associationAuditStatus为待审核(1)、通过(3)和拒绝(4)的数据和自己创建的数据
|
|
|
|
|
|
Integer oneByRoleId = dataScopeViewService.getOneByRoleId(roleIdList.get(0).getRoleId()); |
|
|
|
|
|
// 获取自己部门范围内的数据
|
|
|
|
|
|
List<Long> departmentEmployees = new ArrayList<>(); |
|
|
|
|
|
if (DataScopeViewTypeEnum.ME.getValue().equals(oneByRoleId)) { |
|
|
|
|
|
departmentEmployees = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.ME, requestUser.getUserId()); |
|
|
|
|
|
} else if (DataScopeViewTypeEnum.DEPARTMENT.getValue().equals(oneByRoleId)) { |
|
|
|
|
|
departmentEmployees = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.DEPARTMENT, requestUser.getUserId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 确保包含当前用户ID,以便能看到自己创建的数据
|
|
|
|
|
|
if (departmentEmployees == null) { |
|
|
|
|
|
departmentEmployees = new ArrayList<>(); |
|
|
|
|
|
} |
|
|
|
|
|
if (!departmentEmployees.contains(requestUser.getUserId())) { |
|
|
|
|
|
departmentEmployees.add(requestUser.getUserId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
queryForm.setEmployeeIdList(departmentEmployees); |
|
|
|
|
|
// 设置只显示associationAuditStatus为待审核、通过、拒绝的数据
|
|
|
|
|
|
queryForm.setIncludeAssociationReviewed(true); |
|
|
|
|
|
} else if (isFirmAdminRole) { |
|
|
|
|
|
// 律所管理员(cto):能看到自己部门范围内的数据,但只显示firmAuditStatus为待审核、通过和拒绝的数据和自己创建的数据
|
|
|
|
|
|
Integer oneByRoleId = dataScopeViewService.getOneByRoleId(roleIdList.get(0).getRoleId()); |
|
|
|
|
|
// 获取自己部门范围内的数据
|
|
|
|
|
|
List<Long> departmentEmployees = new ArrayList<>(); |
|
|
|
|
|
if (DataScopeViewTypeEnum.ME.getValue().equals(oneByRoleId)) { |
|
|
|
|
|
departmentEmployees = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.ME, requestUser.getUserId()); |
|
|
|
|
|
} else if (DataScopeViewTypeEnum.DEPARTMENT.getValue().equals(oneByRoleId)) { |
|
|
|
|
|
departmentEmployees = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.DEPARTMENT, requestUser.getUserId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 确保包含当前用户ID,以便能看到自己创建的数据
|
|
|
|
|
|
if (departmentEmployees == null) { |
|
|
|
|
|
departmentEmployees = new ArrayList<>(); |
|
|
|
|
|
} |
|
|
|
|
|
if (!departmentEmployees.contains(requestUser.getUserId())) { |
|
|
|
|
|
departmentEmployees.add(requestUser.getUserId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
queryForm.setEmployeeIdList(departmentEmployees); |
|
|
|
|
|
// 设置只查看firmAuditStatus为待审核、通过和拒绝的数据
|
|
|
|
|
|
queryForm.setIncludeFirmReviewed(true); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 律所普通用户:只能看到自己提交的数据,包括所有firmAuditStatus状态
|
|
|
|
|
|
Integer oneByRoleId = dataScopeViewService.getOneByRoleId(roleIdList.get(0).getRoleId()); |
|
|
|
|
|
if (DataScopeViewTypeEnum.ME.getValue().equals(oneByRoleId)) { |
|
|
|
|
|
longs = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.ME, requestUser.getUserId()); |
|
|
|
|
|
} else if (DataScopeViewTypeEnum.DEPARTMENT.getValue().equals(oneByRoleId)) { |
|
|
|
|
|
longs = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.DEPARTMENT, requestUser.getUserId()); |
|
|
|
|
|
} |
|
|
|
|
|
// 确保普通用户至少能看到自己的数据,如果longs为空或不包含当前用户ID,则添加当前用户ID
|
|
|
|
|
|
if (longs == null) { |
|
|
|
|
|
longs = new ArrayList<>(); |
|
|
|
|
|
} |
|
|
|
|
|
if (!longs.contains(requestUser.getUserId())) { |
|
|
|
|
|
longs.remove(requestUser.getUserId()); |
|
|
|
|
|
} |
|
|
|
|
|
queryForm.setEmployeeIdList(longs); |
|
|
|
|
|
// 普通用户不需要审核状态过滤,可以看到自己所有状态的数据
|
|
|
|
|
|
queryForm.setNoStatusFilter(true); |
|
|
} |
|
|
} |
|
|
queryForm.setEmployeeIdList(longs); |
|
|
queryForm.setCurrentUserId(requestUser.getUserId()); // 传递当前用户ID用于SQL中的特殊过滤
|
|
|
|
|
|
|
|
|
List<ServiceApplicationsVO> list = serviceApplicationsDao.queryPage(page, queryForm); |
|
|
List<ServiceApplicationsVO> list = serviceApplicationsDao.queryPage(page, queryForm); |
|
|
if (!CollectionUtils.isEmpty(list)) { |
|
|
if (!CollectionUtils.isEmpty(list)) { |
|
|
//翻译单位名称和用户名称
|
|
|
//翻译单位名称和用户名称
|
|
|
@ -119,7 +212,7 @@ public class ServiceApplicationsService { |
|
|
item.setUserName(employeeService.queryById(item.getUserId()).getActualName()); |
|
|
item.setUserName(employeeService.queryById(item.getUserId()).getActualName()); |
|
|
} |
|
|
} |
|
|
if (item.getFirmAuditUser() != null){ |
|
|
if (item.getFirmAuditUser() != null){ |
|
|
item.setFirmAuditUserName(employeeService.queryById(item.getUserId()).getActualName()); |
|
|
item.setFirmAuditUserName(employeeService.queryById(item.getFirmAuditUser()).getActualName()); |
|
|
} |
|
|
} |
|
|
if (item.getActivityCategoryId() != null) { |
|
|
if (item.getActivityCategoryId() != null) { |
|
|
item.setActivityCategory(categoryService.queryById(item.getActivityCategoryId()).getCategoryName()); |
|
|
item.setActivityCategory(categoryService.queryById(item.getActivityCategoryId()).getCategoryName()); |
|
|
@ -127,6 +220,13 @@ public class ServiceApplicationsService { |
|
|
if (item.getActivityNameId() != null) { |
|
|
if (item.getActivityNameId() != null) { |
|
|
item.setActivityName(goodsService.queryById(item.getActivityNameId()).getGoodsName()); |
|
|
item.setActivityName(goodsService.queryById(item.getActivityNameId()).getGoodsName()); |
|
|
} |
|
|
} |
|
|
|
|
|
if (item.getPositionId() != null) { |
|
|
|
|
|
item.setPositionName(positionService.queryById(item.getPositionId()).getPositionName()); |
|
|
|
|
|
} |
|
|
|
|
|
//协会审核人
|
|
|
|
|
|
if (item.getAssociationAuditUser() != null) { |
|
|
|
|
|
item.setAssociationAuditUserName(employeeService.queryById(item.getAssociationAuditUser()).getActualName()); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
return SmartPageUtil.convert2PageResult(page, list); |
|
|
return SmartPageUtil.convert2PageResult(page, list); |
|
|
@ -160,9 +260,27 @@ public class ServiceApplicationsService { |
|
|
if (null == applicationId){ |
|
|
if (null == applicationId){ |
|
|
return ResponseDTO.ok(); |
|
|
return ResponseDTO.ok(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ServiceApplicationsEntity serviceApplicationsEntity = serviceApplicationsDao.selectById(applicationId); |
|
|
ServiceApplicationsEntity serviceApplicationsEntity = serviceApplicationsDao.selectById(applicationId); |
|
|
serviceApplicationsEntity.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue()); |
|
|
|
|
|
serviceApplicationsEntity.setReportTime(LocalDateTime.now()); |
|
|
// 检查当前用户角色是否为CEO
|
|
|
|
|
|
RequestUser requestUser = AdminRequestUtil.getRequestUser(); |
|
|
|
|
|
List<RoleVO> roles = roleEmployeeService.getRoleIdList(requestUser.getUserId()); |
|
|
|
|
|
if (!roles.isEmpty()) { |
|
|
|
|
|
String roleCode = roles.get(0).getRoleCode(); |
|
|
|
|
|
// 如果是CEO角色提交申报,默认通过律所审核和协会审核
|
|
|
|
|
|
if (UserTypeEnum.CEO.getDesc().equals(roleCode)) { |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditStatus(ReviewEnum.PASS.getValue()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditUser(requestUser.getUserId()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditTime(LocalDateTime.now()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditStatus(ReviewEnum.PASS.getValue()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditUser(requestUser.getUserId()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditTime(LocalDateTime.now()); |
|
|
|
|
|
} |
|
|
|
|
|
}else { |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue()); |
|
|
|
|
|
serviceApplicationsEntity.setReportTime(LocalDateTime.now()); |
|
|
|
|
|
} |
|
|
serviceApplicationsDao.updateById(serviceApplicationsEntity); |
|
|
serviceApplicationsDao.updateById(serviceApplicationsEntity); |
|
|
return ResponseDTO.ok(); |
|
|
return ResponseDTO.ok(); |
|
|
} |
|
|
} |
|
|
@ -361,6 +479,11 @@ public class ServiceApplicationsService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 批量提交 |
|
|
|
|
|
* @param idList |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
public ResponseDTO<String> batchSubmit(List<Long> idList) { |
|
|
public ResponseDTO<String> batchSubmit(List<Long> idList) { |
|
|
if (CollectionUtils.isEmpty(idList)){ |
|
|
if (CollectionUtils.isEmpty(idList)){ |
|
|
return ResponseDTO.ok(); |
|
|
return ResponseDTO.ok(); |
|
|
@ -370,10 +493,62 @@ public class ServiceApplicationsService { |
|
|
return ResponseDTO.ok(); |
|
|
return ResponseDTO.ok(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 批量上报 |
|
|
|
|
|
* @param idList |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public ResponseDTO<String> batchSubmitAsFirm(List<Long> idList) { |
|
|
|
|
|
if (CollectionUtils.isEmpty(idList)){ |
|
|
|
|
|
return ResponseDTO.ok(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RequestUser requestUser = AdminRequestUtil.getRequestUser(); |
|
|
|
|
|
// 查询用户角色是律所管理员,则修改律所的审核状态
|
|
|
|
|
|
// 如果是ceo则修改协会审核状态
|
|
|
|
|
|
List<RoleVO> roles = roleEmployeeService.getRoleIdList(requestUser.getUserId()); |
|
|
|
|
|
if (roles.isEmpty()) { |
|
|
|
|
|
return ResponseDTO.error(UserErrorCode.NO_PERMISSION); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String roleCode = roles.get(0).getRoleCode(); |
|
|
|
|
|
|
|
|
|
|
|
// 设置审核时间
|
|
|
|
|
|
String reviewTime = LocalDateTime.now().toString(); |
|
|
|
|
|
|
|
|
|
|
|
// 根据不同角色执行不同的提交操作
|
|
|
|
|
|
if (UserTypeEnum.CEO.getDesc().equals(roleCode)) { |
|
|
|
|
|
// CEO角色:修改协会审核状态
|
|
|
|
|
|
serviceApplicationsDao.batchSubmitAsAssociation(idList, ReviewEnum.PASS.getValue(), requestUser.getUserId(), reviewTime); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他角色(如律所管理员):修改律所审核状态
|
|
|
|
|
|
serviceApplicationsDao.batchSubmitAsFirm(idList, ReviewEnum.REVIEW.getValue()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ResponseDTO.ok(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public ResponseDTO<String> addSubmit(@Valid ServiceApplicationsAddForm addForm) { |
|
|
public ResponseDTO<String> addSubmit(@Valid ServiceApplicationsAddForm addForm) { |
|
|
ServiceApplicationsEntity serviceApplicationsEntity = SmartBeanUtil.copy(addForm, ServiceApplicationsEntity.class); |
|
|
ServiceApplicationsEntity serviceApplicationsEntity = SmartBeanUtil.copy(addForm, ServiceApplicationsEntity.class); |
|
|
serviceApplicationsEntity.setRecordStatus(ReviewEnum.APPROVAL.getValue()); |
|
|
serviceApplicationsEntity.setRecordStatus(ReviewEnum.APPROVAL.getValue()); |
|
|
serviceApplicationsEntity.setReportTime(LocalDateTime.now()); |
|
|
serviceApplicationsEntity.setReportTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
|
|
|
|
// 检查当前用户角色是否为CEO
|
|
|
|
|
|
RequestUser requestUser = AdminRequestUtil.getRequestUser(); |
|
|
|
|
|
List<RoleVO> roles = roleEmployeeService.getRoleIdList(requestUser.getUserId()); |
|
|
|
|
|
if (!roles.isEmpty()) { |
|
|
|
|
|
String roleCode = roles.get(0).getRoleCode(); |
|
|
|
|
|
// 如果是CEO角色创建申报,默认通过律所审核和协会审核
|
|
|
|
|
|
if (UserTypeEnum.CEO.getDesc().equals(roleCode)) { |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditStatus(ReviewEnum.PASS.getValue()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditUser(requestUser.getUserId()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditTime(LocalDateTime.now()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditStatus(ReviewEnum.PASS.getValue()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditUser(requestUser.getUserId()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditTime(LocalDateTime.now()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (null == addForm.getApplicationId()){ |
|
|
if (null == addForm.getApplicationId()){ |
|
|
serviceApplicationsDao.insert(serviceApplicationsEntity); |
|
|
serviceApplicationsDao.insert(serviceApplicationsEntity); |
|
|
}else { |
|
|
}else { |
|
|
@ -384,11 +559,43 @@ public class ServiceApplicationsService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ResponseDTO<String> review(@Valid ServiceApplicationsUpdateForm updateForm) { |
|
|
public ResponseDTO<String> review(@Valid ServiceApplicationsUpdateForm updateForm) { |
|
|
RequestUser requestUser = AdminRequestUtil.getRequestUser(); |
|
|
RequestEmployee requestUser = AdminRequestUtil.getRequestUser(); |
|
|
|
|
|
// 查询用户角色是律所管理员,则修改律所的审核状态
|
|
|
|
|
|
// 如果是ceo则修改协会审核状态
|
|
|
|
|
|
List<RoleVO> roles = roleEmployeeService.getRoleIdList(requestUser.getEmployeeId()); |
|
|
|
|
|
if (roles.isEmpty()) { |
|
|
|
|
|
return ResponseDTO.error(UserErrorCode.NO_PERMISSION); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String roleCode = roles.get(0).getRoleCode(); |
|
|
ServiceApplicationsEntity serviceApplicationsEntity = serviceApplicationsDao.selectById(updateForm.getApplicationId()); |
|
|
ServiceApplicationsEntity serviceApplicationsEntity = serviceApplicationsDao.selectById(updateForm.getApplicationId()); |
|
|
serviceApplicationsEntity.setFirmAuditStatus(updateForm.getFirmAuditStatus()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditUser(requestUser.getUserId()); |
|
|
// 根据不同角色执行不同的审核操作
|
|
|
serviceApplicationsEntity.setFirmAuditTime(LocalDateTime.now()); |
|
|
if (UserTypeEnum.CEO.getDesc().equals(roleCode)) { |
|
|
|
|
|
//如果是CEO自己创建的数据
|
|
|
|
|
|
if (serviceApplicationsEntity.getUserId().equals(requestUser.getEmployeeId())) { |
|
|
|
|
|
// 修改所有状态审核状态
|
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditStatus(updateForm.getAssociationAuditStatus()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditUser(requestUser.getEmployeeId()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditTime(LocalDateTime.now()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditOpinion(updateForm.getAssociationAuditOpinion()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditStatus(updateForm.getAssociationAuditStatus()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditUser(requestUser.getEmployeeId()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditTime(LocalDateTime.now()); |
|
|
|
|
|
}else { |
|
|
|
|
|
// CEO角色:修改协会审核状态
|
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditStatus(updateForm.getAssociationAuditStatus()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditUser(requestUser.getEmployeeId()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditTime(LocalDateTime.now()); |
|
|
|
|
|
serviceApplicationsEntity.setAssociationAuditOpinion(updateForm.getAssociationAuditOpinion()); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他角色(如律所管理员):修改律所审核状态
|
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditStatus(updateForm.getFirmAuditStatus()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditUser(requestUser.getEmployeeId()); |
|
|
|
|
|
serviceApplicationsEntity.setFirmAuditTime(LocalDateTime.now()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
serviceApplicationsDao.updateById(serviceApplicationsEntity); |
|
|
serviceApplicationsDao.updateById(serviceApplicationsEntity); |
|
|
return ResponseDTO.ok(); |
|
|
return ResponseDTO.ok(); |
|
|
} |
|
|
} |
|
|
@ -450,6 +657,40 @@ public class ServiceApplicationsService { |
|
|
exportExcel(response, "律所统计信息.xlsx", "律所统计信息", ServiceDepartmentImportForm.class, lawyerStatisticsWithParamYear); |
|
|
exportExcel(response, "律所统计信息.xlsx", "律所统计信息", ServiceDepartmentImportForm.class, lawyerStatisticsWithParamYear); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
public ResponseDTO<String> batchReview(@Valid ServiceApplicationsUpdateForm updateForm) { |
|
|
|
|
|
RequestUser requestUser = AdminRequestUtil.getRequestUser(); |
|
|
|
|
|
// 查询用户角色是律所管理员,则修改律所的审核状态
|
|
|
|
|
|
// 如果是ceo则修改协会审核状态
|
|
|
|
|
|
List<RoleVO> roles = roleEmployeeService.getRoleIdList(requestUser.getUserId()); |
|
|
|
|
|
if (roles.isEmpty()) { |
|
|
|
|
|
return ResponseDTO.error(UserErrorCode.NO_PERMISSION); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String roleCode = roles.get(0).getRoleCode(); |
|
|
|
|
|
String applicationIds = updateForm.getApplicationIds(); |
|
|
|
|
|
if (applicationIds == null || applicationIds.trim().isEmpty()) { |
|
|
|
|
|
return ResponseDTO.ok(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String[] fileKeyArray = applicationIds.split(","); |
|
|
|
|
|
List<String> fileKeyList = Arrays.asList(fileKeyArray); |
|
|
|
|
|
|
|
|
|
|
|
// 设置审核时间
|
|
|
|
|
|
String reviewTime = LocalDateTime.now().toString(); |
|
|
|
|
|
|
|
|
|
|
|
// 根据不同角色执行不同的审核操作
|
|
|
|
|
|
if (UserTypeEnum.CEO.getDesc().equals(roleCode)) { |
|
|
|
|
|
// CEO角色:修改协会审核状态
|
|
|
|
|
|
serviceApplicationsDao.batchReviewAsAssociation(fileKeyList, ReviewEnum.PASS.getValue(), requestUser.getUserId(), reviewTime); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他角色(如律所管理员):修改律所审核状态
|
|
|
|
|
|
serviceApplicationsDao.batchReviewAsFirm(fileKeyList, ReviewEnum.PASS.getValue(), requestUser.getUserId(), reviewTime); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ResponseDTO.ok(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Excel下拉列表处理器 |
|
|
* Excel下拉列表处理器 |
|
|
*/ |
|
|
*/ |
|
|
@ -870,4 +1111,14 @@ public class ServiceApplicationsService { |
|
|
throw new BusinessException("Excel导出失败:" + e.getMessage()); |
|
|
throw new BusinessException("Excel导出失败:" + e.getMessage()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 服务上报统计 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public PageResult<ServiceReportStatisticsVO> getServiceReportStatistics(ServiceApplicationsQueryForm queryForm) { |
|
|
|
|
|
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm); |
|
|
|
|
|
List<ServiceReportStatisticsVO> list = serviceApplicationsDao.getServiceReportStatistics(page, queryForm); |
|
|
|
|
|
return SmartPageUtil.convert2PageResult(page, list); |
|
|
|
|
|
} |
|
|
} |
|
|
} |