Browse Source

fix:修改内容

master
wang 2 months ago
parent
commit
721ce10292
  1. 11
      yun-admin/pom.xml
  2. 134
      yun-admin/src/main/java/net/lab1024/sa/admin/module/service/service/ServiceApplicationsService.java
  3. 5
      yun-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/entity/EmployeeEntity.java
  4. 5
      yun-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeAddForm.java
  5. 5
      yun-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/vo/EmployeeVO.java
  6. 4
      yun-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/RequestEmployee.java
  7. 15
      yun-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java
  8. 13
      yun-admin/src/main/java/net/lab1024/sa/admin/module/word/WordApplicationsController.java
  9. 1
      yun-admin/src/main/resources/mapper/penaltyapply/PenaltyApplyMapper.xml
  10. 2
      yun-admin/src/main/resources/mapper/penaltyapply/PenaltyLawyerMapper.xml
  11. 28
      yun-admin/src/main/resources/mapper/service/ServiceApplicationsMapper.xml

11
yun-admin/pom.xml

@ -69,6 +69,17 @@
<artifactId>fr.opensagres.poi.xwpf.converter.pdf-gae</artifactId> <artifactId>fr.opensagres.poi.xwpf.converter.pdf-gae</artifactId>
<version>2.0.2</version> <version>2.0.2</version>
</dependency> </dependency>
<!-- PDF转图片依赖 -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.27</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
<version>2.0.27</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

134
yun-admin/src/main/java/net/lab1024/sa/admin/module/service/service/ServiceApplicationsService.java

@ -101,6 +101,45 @@ public class ServiceApplicationsService {
@Resource @Resource
private DictService dictService; private DictService dictService;
/**
* 案号重复性校验用于提交操作
* @param addForm 提交表单
*/
private void validateRecordNoUniquenessForSubmit(ServiceApplicationsAddForm addForm) {
// 只对TIME类型的服务进行案号校验
if (!"TIME".equals(addForm.getServiceType())) {
return;
}
String recordNo = addForm.getRecordNo();
if (recordNo == null || recordNo.trim().isEmpty()) {
return;
}
Long currentUserId = AdminRequestUtil.getRequestUser().getEmployeeId();
if (addForm.getApplicationId() == null) {
// 新增操作:检查案号是否已存在
List<ServiceApplicationsVO> existingRecords = serviceApplicationsDao.selectByRecordNo(recordNo);
if (!existingRecords.isEmpty()) {
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg() + existingRecords.get(0).getUserName() + UserErrorCode.HAS_EXIST1.getMsg());
}
} else {
// 编辑操作:检查案号是否被其他用户使用并且本人也不能使用
List<ServiceApplicationsVO> existingRecords = serviceApplicationsDao.selectByRecordNo(recordNo);
if (!existingRecords.isEmpty()) {
// 检查是否是当前用户的记录
boolean isCurrentUserRecord = existingRecords.stream()
.anyMatch(record -> record.getUserId().equals(currentUserId));
if (!isCurrentUserRecord || existingRecords.size() > 1) {
// 如果不是当前用户的记录,或者有多条记录(包括当前用户),则不允许
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg() + existingRecords.get(0).getUserName() + UserErrorCode.HAS_EXIST1.getMsg());
}
}
}
}
//查看详情 //查看详情
public ServiceApplicationsVO queryDetail(Long applicationId) { public ServiceApplicationsVO queryDetail(Long applicationId) {
ServiceApplicationsVO serviceApplicationsVO = new ServiceApplicationsVO(); ServiceApplicationsVO serviceApplicationsVO = new ServiceApplicationsVO();
@ -168,7 +207,7 @@ public class ServiceApplicationsService {
} }
queryForm.setEmployeeIdList(departmentEmployees); queryForm.setEmployeeIdList(departmentEmployees);
// 设置只查看firmAuditStatus为待审核、通过和拒绝的数据 // 律所管理员可以查看部门内所有已审核数据以及自己创建的所有数据(包括未提交的草稿)
queryForm.setIncludeFirmReviewed(true); queryForm.setIncludeFirmReviewed(true);
} else { } else {
// 律所普通用户:只能看到自己提交的数据,包括所有firmAuditStatus状态 // 律所普通用户:只能看到自己提交的数据,包括所有firmAuditStatus状态
@ -242,7 +281,19 @@ public class ServiceApplicationsService {
if("TIME".equals(addForm.getServiceType())) { if("TIME".equals(addForm.getServiceType())) {
//当前登录人的ID //当前登录人的ID
Long userId = AdminRequestUtil.getRequestUser().getEmployeeId(); Long userId = AdminRequestUtil.getRequestUser().getEmployeeId();
List<ServiceApplicationsVO> applicationsVOS = serviceApplicationsDao.selectByRecordNoNotMy(userId,addForm.getRecordNo());
// 编辑操作:检查案号是否被其他用户使用并且本人也不能使用
List<ServiceApplicationsVO> existingRecords = serviceApplicationsDao.selectByRecordNo(addForm.getRecordNo());
if (!existingRecords.isEmpty()) {
// 检查是否是当前用户的记录
boolean isCurrentUserRecord = existingRecords.stream()
.anyMatch(record -> record.getUserId().equals(userId));
if (!isCurrentUserRecord || existingRecords.size() > 1) {
// 如果不是当前用户的记录,或者有多条记录(包括当前用户),则不允许
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg() + existingRecords.get(0).getUserName() + UserErrorCode.HAS_EXIST1.getMsg());
}
}
} }
serviceApplicationsDao.updateById(serviceApplicationsEntity); serviceApplicationsDao.updateById(serviceApplicationsEntity);
} }
@ -258,10 +309,17 @@ public class ServiceApplicationsService {
if("TIME".equals(updateForm.getServiceType())) { if("TIME".equals(updateForm.getServiceType())) {
//当前登录人的ID //当前登录人的ID
Long userId = AdminRequestUtil.getRequestUser().getEmployeeId(); Long userId = AdminRequestUtil.getRequestUser().getEmployeeId();
List<ServiceApplicationsVO> serviceApplicationsEntity = serviceApplicationsDao.selectByRecordNoNotMy(userId, updateForm.getRecordNo()); // 编辑操作:检查案号是否被其他用户使用并且本人也不能使用
List<ServiceApplicationsVO> existingRecords = serviceApplicationsDao.selectByRecordNo(updateForm.getRecordNo());
if (!serviceApplicationsEntity.isEmpty()){ if (!existingRecords.isEmpty()) {
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg()+serviceApplicationsEntity.get(0).getUserName()+UserErrorCode.HAS_EXIST1.getMsg()); // 检查是否是当前用户的记录
boolean isCurrentUserRecord = existingRecords.stream()
.anyMatch(record -> record.getUserId().equals(userId));
if (!isCurrentUserRecord || existingRecords.size() > 1) {
// 如果不是当前用户的记录,或者有多条记录(包括当前用户),则不允许
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg() + existingRecords.get(0).getUserName() + UserErrorCode.HAS_EXIST1.getMsg());
}
} }
} }
ServiceApplicationsEntity serviceApplicationsEntity = SmartBeanUtil.copy(updateForm, ServiceApplicationsEntity.class); ServiceApplicationsEntity serviceApplicationsEntity = SmartBeanUtil.copy(updateForm, ServiceApplicationsEntity.class);
@ -272,51 +330,26 @@ public class ServiceApplicationsService {
/** /**
* 提交 * 提交
*
*/ */
public ResponseDTO<String> submit(ServiceApplicationsAddForm addForm) { public ResponseDTO<String> submit(ServiceApplicationsAddForm addForm) {
// 案号重复性校验
validateRecordNoUniquenessForSubmit(addForm);
if("TIME".equals(addForm.getServiceType())) {
//当前登录人的ID
Long userId = AdminRequestUtil.getRequestUser().getEmployeeId();
List<ServiceApplicationsVO> serviceApplicationsEntity = serviceApplicationsDao.selectByRecordNoNotMy(userId, addForm.getRecordNo());
if (!serviceApplicationsEntity.isEmpty()){
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg()+serviceApplicationsEntity.get(0).getUserName()+UserErrorCode.HAS_EXIST1.getMsg());
}
}
// 检查当前用户角色是否为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 {*/
//}
if (null == addForm.getApplicationId()){ if (null == addForm.getApplicationId()){
// 新增提交
ServiceApplicationsEntity serviceApplications = new ServiceApplicationsEntity(); ServiceApplicationsEntity serviceApplications = new ServiceApplicationsEntity();
SmartBeanUtil.copyProperties(addForm, serviceApplications); SmartBeanUtil.copyProperties(addForm, serviceApplications);
serviceApplications.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue()); serviceApplications.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue());
serviceApplications.setReportTime(LocalDateTime.now()); serviceApplications.setReportTime(LocalDateTime.now());
serviceApplicationsDao.insert(serviceApplications); serviceApplicationsDao.insert(serviceApplications);
}else { }else {
// 编辑提交
ServiceApplicationsEntity serviceApplications = serviceApplicationsDao.selectById(addForm.getApplicationId()); ServiceApplicationsEntity serviceApplications = serviceApplicationsDao.selectById(addForm.getApplicationId());
SmartBeanUtil.copyProperties(addForm, serviceApplications); SmartBeanUtil.copyProperties(addForm, serviceApplications);
serviceApplications.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue()); serviceApplications.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue());
serviceApplications.setReportTime(LocalDateTime.now()); serviceApplications.setReportTime(LocalDateTime.now());
serviceApplicationsDao.updateById(serviceApplications); serviceApplicationsDao.updateById(serviceApplications);
} }
//serviceApplicationsDao.updateById(serviceApplications);
return ResponseDTO.ok(); return ResponseDTO.ok();
} }
/** /**
@ -564,13 +597,7 @@ public class ServiceApplicationsService {
} }
public ResponseDTO<String> addSubmit(@Valid ServiceApplicationsAddForm addForm) { public ResponseDTO<String> addSubmit(@Valid ServiceApplicationsAddForm addForm) {
//判断活动类型查询案号有没有存在
if("TIME".equals(addForm.getServiceType())) {
List<ServiceApplicationsVO> serviceApplicationsEntity = serviceApplicationsDao.selectByRecordNo(addForm.getRecordNo());
if (!serviceApplicationsEntity.isEmpty()){
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg()+serviceApplicationsEntity.get(0).getUserName()+UserErrorCode.HAS_EXIST1.getMsg());
}
}
//ServiceApplicationsEntity serviceApplicationsEntity = SmartBeanUtil.copy(addForm, ServiceApplicationsEntity.class); //ServiceApplicationsEntity serviceApplicationsEntity = SmartBeanUtil.copy(addForm, ServiceApplicationsEntity.class);
//serviceApplicationsEntity.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue()); //serviceApplicationsEntity.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue());
//serviceApplicationsEntity.setReportTime(LocalDateTime.now()); //serviceApplicationsEntity.setReportTime(LocalDateTime.now());
@ -592,12 +619,35 @@ public class ServiceApplicationsService {
}*/ }*/
if (null == addForm.getApplicationId()){ if (null == addForm.getApplicationId()){
//判断活动类型查询案号有没有存在
if("TIME".equals(addForm.getServiceType())) {
List<ServiceApplicationsVO> serviceApplicationsEntity = serviceApplicationsDao.selectByRecordNo(addForm.getRecordNo());
if (!serviceApplicationsEntity.isEmpty()){
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg()+serviceApplicationsEntity.get(0).getUserName()+UserErrorCode.HAS_EXIST1.getMsg());
}
}
ServiceApplicationsEntity serviceApplications = new ServiceApplicationsEntity(); ServiceApplicationsEntity serviceApplications = new ServiceApplicationsEntity();
SmartBeanUtil.copyProperties(addForm, serviceApplications); SmartBeanUtil.copyProperties(addForm, serviceApplications);
serviceApplications.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue()); serviceApplications.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue());
serviceApplications.setReportTime(LocalDateTime.now()); serviceApplications.setReportTime(LocalDateTime.now());
serviceApplicationsDao.insert(serviceApplications); serviceApplicationsDao.insert(serviceApplications);
}else { }else {
//判断活动类型查询案号有没有存在
if("TIME".equals(addForm.getServiceType())) {
Long userId = AdminRequestUtil.getRequestUser().getEmployeeId();
// 编辑操作:检查案号是否被其他用户使用并且本人也不能使用
List<ServiceApplicationsVO> existingRecords = serviceApplicationsDao.selectByRecordNo(addForm.getRecordNo());
if (!existingRecords.isEmpty()) {
// 检查是否是当前用户的记录
boolean isCurrentUserRecord = existingRecords.stream()
.anyMatch(record -> record.getUserId().equals(userId));
if (!isCurrentUserRecord || existingRecords.size() > 1) {
// 如果不是当前用户的记录,或者有多条记录(包括当前用户),则不允许
throw new BusinessException(UserErrorCode.HAS_EXIST.getMsg() + existingRecords.get(0).getUserName() + UserErrorCode.HAS_EXIST1.getMsg());
}
}
}
ServiceApplicationsEntity serviceApplications = serviceApplicationsDao.selectById(addForm.getApplicationId()); ServiceApplicationsEntity serviceApplications = serviceApplicationsDao.selectById(addForm.getApplicationId());
SmartBeanUtil.copyProperties(addForm, serviceApplications); SmartBeanUtil.copyProperties(addForm, serviceApplications);
serviceApplications.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue()); serviceApplications.setFirmAuditStatus(ReviewEnum.APPROVAL.getValue());

5
yun-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/entity/EmployeeEntity.java

@ -98,4 +98,9 @@ public class EmployeeEntity {
* 执业证号 * 执业证号
*/ */
private String certificateNumber; private String certificateNumber;
/**
* 是否有成本查看权限
*/
private Boolean costVisibleFlag;
} }

5
yun-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/EmployeeAddForm.java

@ -63,4 +63,9 @@ public class EmployeeAddForm {
@Schema(description = "职业证号", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "职业证号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "职业证号 不能为空") @NotBlank(message = "职业证号 不能为空")
private String certificateNumber; private String certificateNumber;
/**
* 是否有成本查看权限
*/
private Boolean costVisibleFlag;
} }

5
yun-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/vo/EmployeeVO.java

@ -61,4 +61,9 @@ public class EmployeeVO {
@Schema(description = "职业证号") @Schema(description = "职业证号")
private String certificateNumber; private String certificateNumber;
/**
* 是否有成本查看权限
*/
private Boolean costVisibleFlag;
} }

4
yun-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/RequestEmployee.java

@ -65,6 +65,10 @@ public class RequestEmployee implements RequestUser, Serializable {
@Schema(description = "执业证号") @Schema(description = "执业证号")
private String licenseNumber; private String licenseNumber;
/**
* 是否有成本查看权限
*/
private Boolean costVisibleFlag;
@Override @Override
public Long getUserId() { public Long getUserId() {

15
yun-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java

@ -16,6 +16,7 @@ import net.lab1024.sa.admin.module.system.login.domain.LoginForm;
import net.lab1024.sa.admin.module.system.login.domain.LoginResultVO; import net.lab1024.sa.admin.module.system.login.domain.LoginResultVO;
import net.lab1024.sa.admin.module.system.login.domain.RequestEmployee; import net.lab1024.sa.admin.module.system.login.domain.RequestEmployee;
import net.lab1024.sa.admin.module.system.login.manager.LoginManager; import net.lab1024.sa.admin.module.system.login.manager.LoginManager;
import net.lab1024.sa.admin.module.system.menu.constant.MenuTypeEnum;
import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO; import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO;
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;
@ -198,6 +199,9 @@ public class LoginService implements StpInterface {
String saTokenLoginId = UserTypeEnum.ADMIN_EMPLOYEE.getValue() + StringConst.COLON + employeeEntity.getEmployeeId(); String saTokenLoginId = UserTypeEnum.ADMIN_EMPLOYEE.getValue() + StringConst.COLON + employeeEntity.getEmployeeId();
// 强制踢掉该用户之前的登录会话,实现单点登录
//StpUtil.logout(saTokenLoginId, String.valueOf(loginDeviceEnum.getDesc()));
// 登录 // 登录
StpUtil.login(saTokenLoginId, String.valueOf(loginDeviceEnum.getDesc())); StpUtil.login(saTokenLoginId, String.valueOf(loginDeviceEnum.getDesc()));
@ -238,6 +242,13 @@ public class LoginService implements StpInterface {
// 前端菜单和功能点清单 // 前端菜单和功能点清单
List<RoleVO> roleList = roleEmployeeService.getRoleIdList(requestEmployee.getEmployeeId()); List<RoleVO> roleList = roleEmployeeService.getRoleIdList(requestEmployee.getEmployeeId());
List<MenuVO> menuAndPointsList = roleMenuService.getMenuList(roleList.stream().map(RoleVO::getRoleId).collect(Collectors.toList()), requestEmployee.getAdministratorFlag()); List<MenuVO> menuAndPointsList = roleMenuService.getMenuList(roleList.stream().map(RoleVO::getRoleId).collect(Collectors.toList()), requestEmployee.getAdministratorFlag());
if (null == requestEmployee.getCostVisibleFlag() || !requestEmployee.getCostVisibleFlag()){
// 移除成本管理相关的菜单项
menuAndPointsList = menuAndPointsList.stream()
.filter(menuVO ->
(menuVO.getMenuName() != null && !menuVO.getMenuName().contains("成本")))
.collect(Collectors.toList());
}
loginResultVO.setMenuList(menuAndPointsList); loginResultVO.setMenuList(menuAndPointsList);
// 上次登录信息 // 上次登录信息
@ -260,7 +271,9 @@ public class LoginService implements StpInterface {
} }
//查询执业证号 //查询执业证号
loginResultVO.setLicenseNumber(employeeService.getById(requestEmployee.getUserId()).getCertificateNumber()); EmployeeEntity byId = employeeService.getById(requestEmployee.getUserId());
loginResultVO.setLicenseNumber(byId.getCertificateNumber());
loginResultVO.setCostVisibleFlag(byId.getCostVisibleFlag());
//承诺书签订状态 //承诺书签订状态
loginResultVO.setAgreementSignFlag(letterService.isLetter(requestEmployee.getEmployeeId())); loginResultVO.setAgreementSignFlag(letterService.isLetter(requestEmployee.getEmployeeId()));
//获取角色 //获取角色

13
yun-admin/src/main/java/net/lab1024/sa/admin/module/word/WordApplicationsController.java

@ -69,14 +69,17 @@ public class WordApplicationsController {
// 生成Word文档 // 生成Word文档
fileContent = wordCertificateService.generateCertificate(certificateData); fileContent = wordCertificateService.generateCertificate(certificateData);
fileName = "certificate.docx"; // fileName = "certificate.docx";
contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; //contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
// 设置文档响应头 // 设置文档响应头
response.setContentType(contentType); //response.setContentType(contentType);
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"; filename*=UTF-8''" + fileName); //response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"; filename*=UTF-8''" + fileName);
// 设置响应头
response.setContentType("image/png");
response.setHeader("Content-Disposition", "inline; filename=\"preview.png\"");
response.setHeader("Cache-Control", "max-age=3600");
response.setContentLength(fileContent.length); response.setContentLength(fileContent.length);
// 将文件内容写入响应输出流 // 将文件内容写入响应输出流

1
yun-admin/src/main/resources/mapper/penaltyapply/PenaltyApplyMapper.xml

@ -47,6 +47,7 @@
</if> </if>
</if> </if>
</where> </where>
ORDER BY tp_apply.status, tp_apply.create_time DESC
</select> </select>
<update id="batchUpdateDeleted"> <update id="batchUpdateDeleted">

2
yun-admin/src/main/resources/mapper/penaltyapply/PenaltyLawyerMapper.xml

@ -33,7 +33,7 @@
<select id="selectLawyerPunishList" resultType="com.alibaba.fastjson.JSONObject"> <select id="selectLawyerPunishList" resultType="com.alibaba.fastjson.JSONObject">
select * select *
from t_lawyer_punish_people from t_lawyer_punish_people
where name = #{licenseNo} and punish_time >= DATE_SUB(CURDATE(), INTERVAL 3 YEAR) where name = #{licenseNo} and punish_time >= DATE_SUB(CURDATE(), INTERVAL 5 YEAR)
</select> </select>

28
yun-admin/src/main/resources/mapper/service/ServiceApplicationsMapper.xml

@ -101,7 +101,7 @@
AND ( AND (
(t_service_applications.association_audit_status IS NOT NULL (t_service_applications.association_audit_status IS NOT NULL
AND t_service_applications.association_audit_status &gt;= 1) AND t_service_applications.association_audit_status &gt;= 1)
OR t_service_applications.user_id = #{queryForm.currentUserId} <!-- 对自己创建的数据不过滤 --> OR (t_service_applications.association_audit_status >= 1 and t_service_applications.user_id = #{queryForm.currentUserId}) <!-- 对自己创建的数据不过滤 -->
) )
</if> </if>
<!-- 当用户指定了协会审核状态时,仍然允许查看自己创建的数据 --> <!-- 当用户指定了协会审核状态时,仍然允许查看自己创建的数据 -->
@ -115,19 +115,27 @@
<if test="queryForm.noStatusFilter != null and queryForm.noStatusFilter"> <if test="queryForm.noStatusFilter != null and queryForm.noStatusFilter">
<!-- 普通律所用户:不过滤firm_audit_status,可以看到所有状态的数据 --> <!-- 普通律所用户:不过滤firm_audit_status,可以看到所有状态的数据 -->
</if> </if>
<!-- 律所管理员过滤条件:只在没有明确指定任一审核状态时才应用此规则,且对自己创建的数据不过滤 --> <!-- 律所管理员过滤条件:查看部门内已审核数据以及自己创建的所有数据(包括未提交的草稿) -->
<if test="queryForm.includeFirmReviewed != null and queryForm.includeFirmReviewed and (queryForm.firmAuditStatus == null or queryForm.firmAuditStatus == '') and (queryForm.associationAuditStatus == null or queryForm.associationAuditStatus == '')"> <if test="queryForm.includeFirmReviewed != null and queryForm.includeFirmReviewed and (queryForm.firmAuditStatus == null or queryForm.firmAuditStatus == '') and (queryForm.associationAuditStatus == null or queryForm.associationAuditStatus == '')">
AND ( AND (
(t_service_applications.firm_audit_status IS NOT NULL (t_service_applications.firm_audit_status IS NOT NULL
AND (t_service_applications.firm_audit_status = 1 OR t_service_applications.firm_audit_status = 3 OR t_service_applications.firm_audit_status = 4)) AND (t_service_applications.firm_audit_status = 1 OR t_service_applications.firm_audit_status = 3 OR t_service_applications.firm_audit_status = 4)
OR t_service_applications.user_id = #{queryForm.currentUserId} <!-- 对自己创建的数据不过滤 --> AND t_service_applications.user_id IN
<foreach collection="queryForm.employeeIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>)
OR (t_service_applications.user_id = #{queryForm.currentUserId}) <!-- 查看自己创建的所有数据,包括未提交的草稿 -->
) )
</if> </if>
<!-- 当用户指定了律所审核状态时,仍然允许查看自己创建的数据 --> <!-- 当用户指定了律所审核状态时,查看部门内指定状态的数据以及自己创建的所有数据 -->
<if test="queryForm.includeFirmReviewed != null and queryForm.includeFirmReviewed and (queryForm.firmAuditStatus != null and queryForm.firmAuditStatus != '')"> <if test="queryForm.includeFirmReviewed != null and queryForm.includeFirmReviewed and (queryForm.firmAuditStatus != null and queryForm.firmAuditStatus != '')">
AND ( AND (
(firm_audit_status = #{queryForm.firmAuditStatus}) (firm_audit_status = #{queryForm.firmAuditStatus}
OR t_service_applications.user_id = #{queryForm.currentUserId} <!-- 对自己创建的数据不过滤 --> AND t_service_applications.user_id IN
<foreach collection="queryForm.employeeIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>)
OR (t_service_applications.user_id = #{queryForm.currentUserId}) <!-- 查看自己创建的所有数据 -->
) )
</if> </if>
</where> </where>
@ -478,7 +486,7 @@
</select> </select>
<select id="getServiceApplicationsAmount" resultType="java.math.BigDecimal"> <select id="getServiceApplicationsAmount" resultType="java.math.BigDecimal">
SELECT SELECT
sum(tsa.workload_score) as workloadScore COALESCE(SUM(tsa.workload_score), 0) as workloadScore
FROM t_service_applications tsa FROM t_service_applications tsa
LEFT JOIN t_department d ON tsa.firm_id = d.department_id LEFT JOIN t_department d ON tsa.firm_id = d.department_id
<where> <where>
@ -513,11 +521,11 @@
tsa.organizer_contact AS organizerContact, tsa.organizer_contact AS organizerContact,
tsa.organizer_phone AS organizerPhone tsa.organizer_phone AS organizerPhone
FROM t_service_applications tsa left join t_employee te on tsa.user_id = te.employee_id FROM t_service_applications tsa left join t_employee te on tsa.user_id = te.employee_id
WHERE tsa.deleted_flag = 0 tsa.record_no = #{recordNo} WHERE tsa.deleted_flag = 0 and tsa.record_no = #{recordNo}
</select> </select>
<select id="getServiceAmount" resultType="java.math.BigDecimal"> <select id="getServiceAmount" resultType="java.math.BigDecimal">
SELECT SELECT
sum(tsa.workload_score) COALESCE(SUM(tsa.workload_score), 0)
FROM t_service_applications tsa FROM t_service_applications tsa
LEFT JOIN t_department d ON tsa.firm_id = d.department_id LEFT JOIN t_department d ON tsa.firm_id = d.department_id
<where> <where>

Loading…
Cancel
Save