feat(assessmentRecord): 新增考核记录功能
- 新增考核记录分页查询接口和扣分详情接口 - 实现考核记录列表展示和扣分详情弹窗功能 - 添加数据总览接口,展示公安单位、保安单位、企事业单位数量及保安人员总数等信息 - 优化考核标准列表展示,增加组件类型字段
This commit is contained in:
parent
201f2112e8
commit
055cf54034
|
@ -1,10 +1,12 @@
|
|||
package com.changhu.common.enums;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
|
@ -14,7 +16,8 @@ import java.util.List;
|
|||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OpenApiType {
|
||||
Information_on_enterprises_and_institutions("获取企事业单位信息", Arrays.asList("1fe0aaf3-45a4-4be3-a989-75e914a3f36e", "1fe0aaf3-45a4-a989-75e914a3f36e"));
|
||||
Information_on_enterprises_and_institutions("获取企事业单位信息", Arrays.asList("1fe0aaf3-45a4-4be3-a989-75e914a3f36e", "1fe0aaf3-45a4-a989-75e914a3f36e")),
|
||||
data_view("数据总览", List.of("8da74bbf-c686-4393-b4ec-692091e6d381"));
|
||||
|
||||
private final String desc;
|
||||
private final List<String> openApiKeys;
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.changhu.common.annotation.CheckOpenApi;
|
|||
import com.changhu.common.annotation.JsonBody;
|
||||
import com.changhu.common.enums.OpenApiType;
|
||||
import com.changhu.common.pojo.vo.SelectNodeVo;
|
||||
import com.changhu.pojo.dto.DataViewDTO;
|
||||
import com.changhu.pojo.dto.EnterprisesUnitDetailDTO;
|
||||
import com.changhu.service.OpenApiService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
@ -43,4 +44,11 @@ public class OpenController {
|
|||
public EnterprisesUnitDetailDTO enterprisesUnitDetailById(@Schema(description = "企事业单位id") @RequestParam Long enterprisesUnitId) {
|
||||
return openApiService.enterprisesUnitDetailById(enterprisesUnitId);
|
||||
}
|
||||
|
||||
@Operation(summary = "数据总览")
|
||||
@CheckOpenApi(value = OpenApiType.data_view)
|
||||
@GetMapping("/dataView")
|
||||
public DataViewDTO dataView() {
|
||||
return openApiService.dataView();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package com.changhu.module.assessmentCriteria.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.changhu.common.annotation.JsonBody;
|
||||
import com.changhu.module.assessmentCriteria.pojo.queryParams.AssessmentRecordPagerQueryParams;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordDetailVo;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordPagerVo;
|
||||
import com.changhu.module.assessmentCriteria.service.CkAssessmentRecordService;
|
||||
import com.changhu.support.mybatisplus.pojo.params.PageParams;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/11/8 下午3:51
|
||||
* @desc AssessmentRecordController...
|
||||
*/
|
||||
@Tag(name = "考核记录详情")
|
||||
@JsonBody
|
||||
@RequestMapping("/assessmentRecord")
|
||||
public class AssessmentRecordController {
|
||||
|
||||
@Autowired
|
||||
private CkAssessmentRecordService assessmentRecordService;
|
||||
|
||||
@Operation(summary = "考核记录分页")
|
||||
@PostMapping("/pager")
|
||||
public Page<AssessmentRecordPagerVo> pager(@RequestBody PageParams<AssessmentRecordPagerQueryParams, AssessmentRecordPagerVo> queryParams) {
|
||||
return assessmentRecordService.pager(queryParams);
|
||||
}
|
||||
|
||||
@Operation(summary = "扣分详情")
|
||||
@GetMapping("/deductedDetail")
|
||||
public List<AssessmentRecordDetailVo> deductedDetail(@RequestParam Long assessmentRecordId) {
|
||||
return assessmentRecordService.deductedDetail(assessmentRecordId);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +1,15 @@
|
|||
package com.changhu.module.assessmentCriteria.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.changhu.module.assessmentCriteria.pojo.entity.CkAssessmentRecord;
|
||||
import com.changhu.module.assessmentCriteria.pojo.queryParams.AssessmentRecordPagerQueryParams;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordDetailVo;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordPagerVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ck_assessment_record (考核记录) 固化类
|
||||
|
@ -12,4 +19,13 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
@Mapper
|
||||
public interface CkAssessmentRecordMapper extends BaseMapper<CkAssessmentRecord> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param params 查询参数
|
||||
* @return 结果
|
||||
*/
|
||||
Page<AssessmentRecordPagerVo> pager(@Param("page") Page<AssessmentRecordPagerVo> page,
|
||||
@Param("params") AssessmentRecordPagerQueryParams params);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package com.changhu.module.assessmentCriteria.pojo.queryParams;
|
||||
|
||||
import com.changhu.common.db.enums.EnterprisesUnitType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/11/8 下午3:52
|
||||
* @desc AssessmentRecordPagerQueryParams...
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentRecordPagerQueryParams {
|
||||
@Schema(description = "企事业单位类型")
|
||||
private EnterprisesUnitType type;
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.changhu.module.assessmentCriteria.pojo.vo;
|
||||
|
||||
import com.changhu.common.db.enums.SelectType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/11/11 上午9:39
|
||||
* @desc AssessmentRecordDetailVo...
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentRecordDetailVo {
|
||||
|
||||
@Schema(description = "考核分组id")
|
||||
private Long ckGroupId;
|
||||
@Schema(description = "考核分组名字")
|
||||
private String groupName;
|
||||
@Schema(description = "考核分组总分")
|
||||
private Integer groupTotalScore;
|
||||
@Schema(description = "考核分组备注")
|
||||
private String groupRemark;
|
||||
|
||||
@Schema(description = "考核项id")
|
||||
private Long ckItemId;
|
||||
@Schema(description = "考核项名字")
|
||||
private String itemName;
|
||||
@Schema(description = "组件类型")
|
||||
private SelectType itemType;
|
||||
@Schema(description = "考核项备注")
|
||||
private String itemRemark;
|
||||
|
||||
@Schema(description = "考核标准id")
|
||||
private Long ckStandardId;
|
||||
@Schema(description = "考核标准")
|
||||
private String standardName;
|
||||
@Schema(description = "扣分数")
|
||||
private Double deductionPoints;
|
||||
|
||||
|
||||
@Schema(description = "是否选中")
|
||||
public Boolean isSelected;
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.changhu.module.assessmentCriteria.pojo.vo;
|
||||
|
||||
import com.changhu.common.db.enums.EnterprisesUnitType;
|
||||
import com.changhu.common.utils.JavaClassToTsUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/11/8 下午3:53
|
||||
* @desc AssessmentRecordPagerVo...
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentRecordPagerVo {
|
||||
@Schema(description = "考核记录id")
|
||||
private Long snowFlakeId;
|
||||
@Schema(description = "企事业单位名称")
|
||||
private String enterprisesUnitName;
|
||||
|
||||
@Schema(description = "考核项目名称")
|
||||
private String ckProjectName;
|
||||
@Schema(description = "考核项目总分")
|
||||
private Integer totalScore;
|
||||
@Schema(description = "考核项目类型")
|
||||
private EnterprisesUnitType type;
|
||||
@Schema(description = "考核项目备注")
|
||||
private String ckProjectRemark;
|
||||
|
||||
@Schema(description = "公安单位名称")
|
||||
private String policeUnitName;
|
||||
@Schema(description = "在这是考核人")
|
||||
private String createUserName;
|
||||
@Schema(description = "在这是考核时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "考核人员签字")
|
||||
private String assessmentUserSignature;
|
||||
@Schema(description = "被考核单位人员签字")
|
||||
private String byAssessmentEnterprisesUnitUserSignature;
|
||||
@Schema(description = "考核备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "总扣分")
|
||||
private Double deductionPointsTotal;
|
||||
|
||||
}
|
|
@ -26,7 +26,7 @@ public class CkProjectDetailTableVo {
|
|||
@Schema(description = "考核项名字")
|
||||
private String itemName;
|
||||
@Schema(description = "组件类型")
|
||||
private SelectType type;
|
||||
private SelectType itemType;
|
||||
@Schema(description = "考核项备注")
|
||||
private String itemRemark;
|
||||
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
package com.changhu.module.assessmentCriteria.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.changhu.module.assessmentCriteria.pojo.entity.CkAssessmentRecord;
|
||||
import com.changhu.module.assessmentCriteria.pojo.queryParams.AssessmentRecordPagerQueryParams;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordDetailVo;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordPagerVo;
|
||||
import com.changhu.support.mybatisplus.pojo.params.PageParams;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ck_assessment_record (考核记录) 服务类
|
||||
|
@ -10,4 +17,19 @@ import com.changhu.module.assessmentCriteria.pojo.entity.CkAssessmentRecord;
|
|||
*/
|
||||
public interface CkAssessmentRecordService extends IService<CkAssessmentRecord> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param queryParams 查询参数
|
||||
* @return 结果
|
||||
*/
|
||||
Page<AssessmentRecordPagerVo> pager(PageParams<AssessmentRecordPagerQueryParams, AssessmentRecordPagerVo> queryParams);
|
||||
|
||||
/**
|
||||
* 扣分详情
|
||||
*
|
||||
* @param assessmentRecordId 考核记录id
|
||||
* @return 结果
|
||||
*/
|
||||
List<AssessmentRecordDetailVo> deductedDetail(Long assessmentRecordId);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,27 @@
|
|||
package com.changhu.module.assessmentCriteria.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.Db;
|
||||
import com.changhu.common.enums.ResultCode;
|
||||
import com.changhu.common.exception.MessageException;
|
||||
import com.changhu.module.assessmentCriteria.mapper.CkAssessmentRecordMapper;
|
||||
import com.changhu.module.assessmentCriteria.mapper.CkProjectMapper;
|
||||
import com.changhu.module.assessmentCriteria.pojo.entity.CkAssessmentRecord;
|
||||
import com.changhu.module.assessmentCriteria.pojo.entity.CkAssessmentRecordDetails;
|
||||
import com.changhu.module.assessmentCriteria.pojo.queryParams.AssessmentRecordPagerQueryParams;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordDetailVo;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordPagerVo;
|
||||
import com.changhu.module.assessmentCriteria.pojo.vo.CkProjectDetailTableVo;
|
||||
import com.changhu.module.assessmentCriteria.service.CkAssessmentRecordService;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import com.changhu.support.mybatisplus.pojo.params.PageParams;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ck_assessment_record (考核记录) 服务实现类
|
||||
* author: luozhun
|
||||
|
@ -14,4 +30,39 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class CkAssessmentRecordServiceImpl extends ServiceImpl<CkAssessmentRecordMapper, CkAssessmentRecord> implements CkAssessmentRecordService {
|
||||
|
||||
@Autowired
|
||||
private CkProjectMapper ckProjectMapper;
|
||||
|
||||
@Override
|
||||
public Page<AssessmentRecordPagerVo> pager(PageParams<AssessmentRecordPagerQueryParams, AssessmentRecordPagerVo> queryParams) {
|
||||
return baseMapper.pager(queryParams.getPage(), queryParams.getParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AssessmentRecordDetailVo> deductedDetail(Long assessmentRecordId) {
|
||||
CkAssessmentRecord ckAssessmentRecord = Db.lambdaQuery(CkAssessmentRecord.class)
|
||||
.eq(BaseEntity::getSnowFlakeId, assessmentRecordId)
|
||||
.oneOpt()
|
||||
.orElseThrow(() -> new MessageException(ResultCode.DATA_NOT_FOUND));
|
||||
|
||||
List<CkProjectDetailTableVo> ckProjectDetailTableVos = ckProjectMapper.ckProjectDetail(ckAssessmentRecord.getCkProjectId());
|
||||
|
||||
List<Long> assessmentRecordDetailCkStandardIds = Db.lambdaQuery(CkAssessmentRecordDetails.class)
|
||||
.select(CkAssessmentRecordDetails::getCkStandardId)
|
||||
.eq(CkAssessmentRecordDetails::getCkAssessmentRecordId, assessmentRecordId)
|
||||
.list()
|
||||
.stream()
|
||||
.map(CkAssessmentRecordDetails::getCkStandardId)
|
||||
.toList();
|
||||
|
||||
return ckProjectDetailTableVos.stream()
|
||||
.map(item -> {
|
||||
AssessmentRecordDetailVo assessmentRecordDetailVo = BeanUtil.copyProperties(item, AssessmentRecordDetailVo.class);
|
||||
if (assessmentRecordDetailCkStandardIds.contains(item.getCkStandardId())) {
|
||||
assessmentRecordDetailVo.setIsSelected(true);
|
||||
}
|
||||
return assessmentRecordDetailVo;
|
||||
})
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.changhu.module.miniProgram.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
import com.changhu.common.annotation.Desensitized;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
@ -27,9 +29,9 @@ public class ServiceProjectSecurityUserPagerVo {
|
|||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Desensitized(value = DesensitizedUtil.DesensitizedType.MOBILE_PHONE)
|
||||
@Schema(description = "手机号")
|
||||
private String telephone;
|
||||
;
|
||||
|
||||
@Schema(description = "工作岗位")
|
||||
private String workPost;
|
||||
|
@ -40,6 +42,7 @@ public class ServiceProjectSecurityUserPagerVo {
|
|||
@Schema(description = "籍贯")
|
||||
private String nativePlace;
|
||||
|
||||
@Desensitized(value = DesensitizedUtil.DesensitizedType.ID_CARD)
|
||||
@Schema(description = "身份证")
|
||||
private String idCard;
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.changhu.pojo.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/11/11 上午11:16
|
||||
* @desc DataViewDTO...
|
||||
*/
|
||||
@Data
|
||||
public class DataViewDTO {
|
||||
@Schema(description = "公安单位数量")
|
||||
private Integer policeUnitCount;
|
||||
@Schema(description = "保安单位数量")
|
||||
private Integer securityUnitCount;
|
||||
@Schema(description = "企事业单位数量")
|
||||
private Integer enterprisesUnitCount;
|
||||
@Schema(description = "保安人员总数")
|
||||
private Integer securityUserTotal;
|
||||
@Schema(description = "无证保安数量")
|
||||
private Integer noCardSecurityUserCount;
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.changhu.service;
|
||||
|
||||
import com.changhu.common.pojo.vo.SelectNodeVo;
|
||||
import com.changhu.pojo.dto.DataViewDTO;
|
||||
import com.changhu.pojo.dto.EnterprisesUnitDetailDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -27,4 +28,11 @@ public interface OpenApiService {
|
|||
* @return 企事业单位详情
|
||||
*/
|
||||
EnterprisesUnitDetailDTO enterprisesUnitDetailById(Long enterprisesUnitId);
|
||||
|
||||
/**
|
||||
* 数据总览
|
||||
*
|
||||
* @return 数据总览
|
||||
*/
|
||||
DataViewDTO dataView();
|
||||
}
|
||||
|
|
|
@ -4,15 +4,21 @@ import com.baomidou.mybatisplus.extension.toolkit.Db;
|
|||
import com.changhu.common.exception.MessageException;
|
||||
import com.changhu.common.pojo.vo.SelectNodeVo;
|
||||
import com.changhu.module.management.pojo.entity.EnterprisesUnit;
|
||||
import com.changhu.module.management.pojo.entity.PoliceUnit;
|
||||
import com.changhu.module.management.pojo.entity.SecurityUnit;
|
||||
import com.changhu.module.management.service.ServiceProjectService;
|
||||
import com.changhu.module.miniProgram.pojo.entity.SecurityUser;
|
||||
import com.changhu.pojo.dto.DataViewDTO;
|
||||
import com.changhu.pojo.dto.EnterprisesUnitDetailDTO;
|
||||
import com.changhu.pojo.dto.ServiceProjectDTO;
|
||||
import com.changhu.service.OpenApiService;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
|
@ -57,4 +63,42 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|||
.build())
|
||||
.orElseThrow(() -> new MessageException("企事业单位不存在"));
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public DataViewDTO dataView() {
|
||||
DataViewDTO dataViewDTO = new DataViewDTO();
|
||||
CountDownLatch countDownLatch = new CountDownLatch(5);
|
||||
try {
|
||||
dataViewDTO.setPoliceUnitCount(Db.lambdaQuery(PoliceUnit.class).count().intValue());
|
||||
} finally {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
try {
|
||||
dataViewDTO.setSecurityUnitCount(Db.lambdaQuery(SecurityUnit.class).count().intValue());
|
||||
} finally {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
try {
|
||||
dataViewDTO.setEnterprisesUnitCount(Db.lambdaQuery(EnterprisesUnit.class).count().intValue());
|
||||
} finally {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
try {
|
||||
dataViewDTO.setSecurityUserTotal(Db.lambdaQuery(SecurityUser.class).count().intValue());
|
||||
} finally {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
try {
|
||||
dataViewDTO.setNoCardSecurityUserCount(Db.lambdaQuery(SecurityUser.class)
|
||||
.isNull(SecurityUser::getSecurityNumber)
|
||||
.or()
|
||||
.eq(SecurityUser::getSecurityNumber, "")
|
||||
.count().intValue());
|
||||
} finally {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
countDownLatch.await();
|
||||
return dataViewDTO;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?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.changhu.module.assessmentCriteria.mapper.CkAssessmentRecordMapper">
|
||||
<select id="pager" resultType="com.changhu.module.assessmentCriteria.pojo.vo.AssessmentRecordPagerVo">
|
||||
select car.*,
|
||||
eu.name as 'enterprisesUnitName',
|
||||
cp.name as 'ckProjectName',
|
||||
cp.total_score,
|
||||
cp.type,
|
||||
cp.remark as 'ckProjectRemark',
|
||||
pu.name as 'policeUnitName',
|
||||
mpu.name as 'createUserName',
|
||||
sum(cs.deduction_points) as 'deductionPointsTotal'
|
||||
from ck_assessment_record car
|
||||
left join enterprises_unit eu on car.enterprises_unit_id = eu.snow_flake_id and eu.delete_flag = 0
|
||||
left join ck_project cp on car.ck_project_id = cp.snow_flake_id and cp.delete_flag = 0
|
||||
left join mini_program_user mpu on mpu.identity = 'police' and car.create_by = mpu.snow_flake_id and mpu.delete_flag = 0
|
||||
left join police_unit pu on mpu.unit_id = pu.snow_flake_id and pu.delete_flag = 0
|
||||
left join ck_assessment_record_details card on car.snow_flake_id = card.ck_assessment_record_id and card.delete_flag = 0
|
||||
left join ck_standard cs on card.ck_standard_id = cs.snow_flake_id
|
||||
where car.delete_flag = 0
|
||||
|
||||
group by car.snow_flake_id
|
||||
order by car.create_time desc
|
||||
</select>
|
||||
</mapper>
|
|
@ -22,7 +22,7 @@
|
|||
cg.remark as 'groupRemark',
|
||||
ci.snow_flake_id as 'ckItemId',
|
||||
ci.name as 'itemName',
|
||||
ci.type,
|
||||
ci.type as 'itemType',
|
||||
ci.remark as 'itemRemark',
|
||||
cs.snow_flake_id as 'ckStandardId',
|
||||
cs.`name` as 'standardName',
|
||||
|
@ -33,5 +33,6 @@
|
|||
left join ck_standard cs on ci.snow_flake_id = cs.ck_item_id and cs.delete_flag = 0
|
||||
where cp.delete_flag = 0
|
||||
and cp.snow_flake_id = #{ckProjectId}
|
||||
order by cp.snow_flake_id, cg.create_time, cs.create_time
|
||||
</select>
|
||||
</mapper>
|
|
@ -37,6 +37,12 @@ export const SYSTEM_MENUS: SystemMenu[] = [
|
|||
path: '/police/assessmentCriteria',
|
||||
type: 'menu',
|
||||
component: () => import('@/views/unitManage/police/assessmentCriteria/index.vue')
|
||||
}, {
|
||||
title: '考核记录',
|
||||
name: 'policeAssessmentRecord',
|
||||
path: '/police/assessmentRecord',
|
||||
type: 'menu',
|
||||
component: () => import('@/views/unitManage/police/assessmentRecord/index.vue')
|
||||
}]
|
||||
}, {
|
||||
title: '保安单位',
|
||||
|
|
|
@ -86,5 +86,5 @@ export interface CkProjectDetailRes {
|
|||
/*扣分数 */
|
||||
deductionPoints: number;
|
||||
/*选择类型,可用值:RADIO,MULTIPLE */
|
||||
type: BaseEnum<string>;
|
||||
itemType: BaseEnum<string>;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
import {BaseTableRowRecord} from "@/types/components/table";
|
||||
|
||||
export interface AssessmentRecordPagerVo extends BaseTableRowRecord {
|
||||
/** 企事业单位名称 **/
|
||||
enterprisesUnitName: string;
|
||||
/** 考核项目名称 **/
|
||||
ckProjectName: string;
|
||||
/** 考核项目总分 **/
|
||||
totalScore: number;
|
||||
/** 考核项目类型 **/
|
||||
type: BaseEnum<string>;
|
||||
/** 考核项目备注 **/
|
||||
ckProjectRemark: string;
|
||||
/** 公安单位名称 **/
|
||||
policeUnitName: string;
|
||||
/** 考核人员签字 **/
|
||||
assessmentUserSignature: string;
|
||||
/** 被考核单位人员签字 **/
|
||||
byAssessmentEnterprisesUnitUserSignature: string;
|
||||
/** 考核备注 **/
|
||||
remark: string;
|
||||
/** 总扣分 **/
|
||||
deductionPointsTotal: number;
|
||||
}
|
||||
|
||||
|
||||
export interface AssessmentRecordPagerQueryParams {
|
||||
type: string
|
||||
}
|
||||
|
||||
export interface DeductedDetailRes {
|
||||
/*考核分组id */
|
||||
ckGroupId: number;
|
||||
groupRowSpan: number;
|
||||
/*考核分组名字 */
|
||||
groupName: string;
|
||||
/*考核分组总分 */
|
||||
groupTotalScore: number;
|
||||
/*考核分组备注 */
|
||||
groupRemark: string;
|
||||
/*考核项id */
|
||||
ckItemId: number;
|
||||
itemRowSpan: number;
|
||||
/*考核项名字 */
|
||||
itemName: string;
|
||||
/*组件类型,可用值:RADIO,MULTIPLE */
|
||||
itemType: BaseEnum<string>;
|
||||
/*考核项备注 */
|
||||
itemRemark: string;
|
||||
/*考核标准id */
|
||||
ckStandardId: number;
|
||||
/*考核标准 */
|
||||
standardName: string;
|
||||
/*扣分数 */
|
||||
deductionPoints: Record<string, unknown>;
|
||||
/*是否选中 */
|
||||
isSelected: boolean;
|
||||
}
|
|
@ -167,7 +167,7 @@ const ckProjectTableColumns: CkProjectTableProps['columns'] = [
|
|||
return '/'
|
||||
}
|
||||
return <div class="flex-justify-between">
|
||||
<p>{_record.itemName}({_record.type?.label})
|
||||
<p>{_record.itemName}({_record.itemType?.label})
|
||||
</p>
|
||||
<a-dropdown trigger={['click']} v-slots={{
|
||||
overlay: () => <a-menu>
|
||||
|
@ -185,7 +185,7 @@ const ckProjectTableColumns: CkProjectTableProps['columns'] = [
|
|||
snowFlakeId: _record.ckItemId,
|
||||
ckGroupId: _record.ckGroupId,
|
||||
name: _record.itemName,
|
||||
type: _record.type.value,
|
||||
type: _record.itemType.value,
|
||||
remark: _record.itemRemark
|
||||
}, initData)}>编辑
|
||||
</a-button>
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
import api from "@/axios";
|
||||
import {AssessmentRecordPagerVo, DeductedDetailRes} from "@/types/views/unitManage/police/assessmentRecord.ts";
|
||||
import {ColumnsType} from "ant-design-vue/es/table";
|
||||
import {Modal, Table} from "ant-design-vue";
|
||||
|
||||
export const deductedDetail = async (assessmentRecord: AssessmentRecordPagerVo) => {
|
||||
const {data} = await api.get<DeductedDetailRes[]>('/assessmentRecord/deductedDetail', {assessmentRecordId: assessmentRecord.snowFlakeId})
|
||||
const groupRowSpan: Record<string, { firstIndex: number, count: number }> = {}
|
||||
const itemRowSpan: Record<string, { firstIndex: number, count: number }> = {}
|
||||
|
||||
data.forEach((item, index) => {
|
||||
//如果第一次没有值
|
||||
if (item.ckGroupId) {
|
||||
if (!groupRowSpan[item.ckGroupId]) {
|
||||
groupRowSpan[item.ckGroupId] = {count: 1, firstIndex: index}
|
||||
} else {
|
||||
groupRowSpan[item.ckGroupId].count++;
|
||||
data[index].groupRowSpan = 0
|
||||
}
|
||||
}
|
||||
|
||||
if (item.ckItemId) {
|
||||
if (!itemRowSpan[item.ckItemId]) {
|
||||
itemRowSpan[item.ckItemId] = {count: 1, firstIndex: index}
|
||||
} else {
|
||||
itemRowSpan[item.ckItemId].count++;
|
||||
data[index].itemRowSpan = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Object.values(groupRowSpan).forEach(({count, firstIndex}) => {
|
||||
data[firstIndex].groupRowSpan = count;
|
||||
})
|
||||
|
||||
Object.values(itemRowSpan).forEach(({count, firstIndex}) => {
|
||||
data[firstIndex].itemRowSpan = count;
|
||||
})
|
||||
|
||||
const ckProjectDetailTableColumns: ColumnsType<DeductedDetailRes> = [
|
||||
{
|
||||
dataIndex: 'groupName',
|
||||
title: '考核分组',
|
||||
customCell: (_record) => {
|
||||
return {
|
||||
rowspan: _record.groupRowSpan
|
||||
}
|
||||
},
|
||||
customRender: ({record: _record}) => {
|
||||
return <div>
|
||||
<p>{_record.groupName}({_record.groupTotalScore})</p>
|
||||
<p>{_record.groupRemark}</p>
|
||||
</div>
|
||||
}
|
||||
}, {
|
||||
dataIndex: 'itemName',
|
||||
title: '考核项',
|
||||
customCell: (_record) => {
|
||||
return {
|
||||
rowspan: _record.itemRowSpan
|
||||
}
|
||||
},
|
||||
customRender: ({record: _record}) => {
|
||||
if (!_record.ckItemId) {
|
||||
return '/'
|
||||
}
|
||||
return <div>
|
||||
<p>{_record.itemName}({_record.itemType?.label})
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
}, {
|
||||
dataIndex: 'standardName',
|
||||
title: '标准',
|
||||
customRender: ({record: _record}) => {
|
||||
if (!_record.ckStandardId) {
|
||||
return '/'
|
||||
}
|
||||
return <div>
|
||||
<p style={{color: _record.isSelected ? 'red' : ''}}>{_record.standardName}扣{_record.deductionPoints}分</p>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Modal.info({
|
||||
title: `【${assessmentRecord.enterprisesUnitName}/${assessmentRecord.ckProjectName}】扣分详情`,
|
||||
icon: ' ',
|
||||
width: '80%',
|
||||
centered: true,
|
||||
content: () => <div style={{height: '80vh', overflow: 'auto'}}>
|
||||
<Table
|
||||
size="small"
|
||||
bordered
|
||||
pagination={false}
|
||||
class="margin-top-xs"
|
||||
columns={ckProjectDetailTableColumns}
|
||||
data-source={data}
|
||||
></Table>
|
||||
</div>
|
||||
})
|
||||
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
<template>
|
||||
<table-pro-max
|
||||
ref="tableRef"
|
||||
:request-api="reqApi"
|
||||
:columns="columns"
|
||||
>
|
||||
|
||||
</table-pro-max>
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
import TableProMax from "@/components/table/TableProMax.vue";
|
||||
import {ref} from "vue";
|
||||
import {ComponentExposed} from "vue-component-type-helpers";
|
||||
import {TableProMaxProps} from "@/types/components/table";
|
||||
import api from "@/axios";
|
||||
import {Modal} from "ant-design-vue";
|
||||
import {
|
||||
AssessmentRecordPagerQueryParams,
|
||||
AssessmentRecordPagerVo
|
||||
} from "@/types/views/unitManage/police/assessmentRecord.ts";
|
||||
import {deductedDetail} from "@/views/unitManage/police/assessmentRecord/index.tsx";
|
||||
|
||||
type TableProps = TableProMaxProps<AssessmentRecordPagerVo, AssessmentRecordPagerQueryParams>
|
||||
const tableRef = ref<ComponentExposed<typeof TableProMax>>(null)
|
||||
const reqApi: TableProps["requestApi"] = (params) => {
|
||||
return api.post('/assessmentRecord/pager', params)
|
||||
}
|
||||
const columns: TableProps['columns'] = [
|
||||
{
|
||||
dataIndex: 'enterprisesUnitName',
|
||||
title: '单位名称'
|
||||
}, {
|
||||
dataIndex: 'type',
|
||||
title: '类型',
|
||||
customRender: ({text}) => text?.label
|
||||
}, {
|
||||
dataIndex: 'ckProjectName',
|
||||
title: '考核项目'
|
||||
}, {
|
||||
dataIndex: 'totalScore',
|
||||
title: '总分'
|
||||
}, {
|
||||
dataIndex: 'deductionPointsTotal',
|
||||
title: '扣分',
|
||||
customRender: ({record}) => {
|
||||
if (!record.deductionPointsTotal) {
|
||||
return <a-tag color="green">0</a-tag>
|
||||
}
|
||||
return <a-tag class="pointer" color="red"
|
||||
onclick={() => deductedDetail(record)}>{record.deductionPointsTotal}</a-tag>
|
||||
}
|
||||
}, {
|
||||
dataIndex: 'result',
|
||||
title: '得分',
|
||||
customRender: ({record}) => record.totalScore - record.deductionPointsTotal
|
||||
}, {
|
||||
dataIndex: 'policeUnitName',
|
||||
title: '考核单位'
|
||||
}, {
|
||||
dataIndex: 'createUserName',
|
||||
title: '考核人'
|
||||
}, {
|
||||
dataIndex: 'createTime',
|
||||
title: '考核时间'
|
||||
}, {
|
||||
dataIndex: 'remark',
|
||||
title: '考核备注'
|
||||
}, {
|
||||
dataIndex: 'signature',
|
||||
title: '签字',
|
||||
customRender: ({record}) => {
|
||||
return <a-button onClick={() => {
|
||||
Modal.info({
|
||||
title: `【${record.enterprisesUnitName}】${record.ckProjectName} 签字结果`,
|
||||
content: () => <>
|
||||
<div>审核人签字 <a-image src={record.assessmentUserSignature}/>
|
||||
</div>
|
||||
<div>被审核单位人员签字 <a-image src={record.byAssessmentEnterprisesUnitUserSignature}/></div>
|
||||
</>
|
||||
})
|
||||
|
||||
}}>查看</a-button>
|
||||
},
|
||||
}
|
||||
]
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
|
@ -41,7 +41,6 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => {
|
|||
map.clearMap()
|
||||
map.add(maker)
|
||||
map.setFitView()
|
||||
console.log(123);
|
||||
}
|
||||
|
||||
const _formOptions = ref<FormProMaxItemOptions<_FormType>>({
|
||||
|
|
|
@ -129,29 +129,6 @@ const searchFormOptions = ref<TableProps["searchFormOptions"]>({
|
|||
}
|
||||
})
|
||||
|
||||
const a = {
|
||||
groupId1: {
|
||||
itemId1: {
|
||||
standardId: 123123,
|
||||
deductionPoints: 2
|
||||
},
|
||||
itemId2: {
|
||||
standardId: 345345,
|
||||
deductionPoints: 4
|
||||
}
|
||||
},
|
||||
groupId2: {
|
||||
itemId1: {
|
||||
standardId: 456456,
|
||||
deductionPoints: 2
|
||||
},
|
||||
itemId2: {
|
||||
standardId: 567567,
|
||||
deductionPoints: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
Loading…
Reference in New Issue