From 055cf540342621c344eef2aaeee08845faab540e Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Mon, 11 Nov 2024 11:36:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(assessmentRecord):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=80=83=E6=A0=B8=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增考核记录分页查询接口和扣分详情接口 - 实现考核记录列表展示和扣分详情弹窗功能 - 添加数据总览接口,展示公安单位、保安单位、企事业单位数量及保安人员总数等信息 - 优化考核标准列表展示,增加组件类型字段 --- .../com/changhu/common/enums/OpenApiType.java | 5 +- .../changhu/controller/OpenController.java | 8 ++ .../AssessmentRecordController.java | 42 +++++++ .../mapper/CkAssessmentRecordMapper.java | 16 +++ .../AssessmentRecordPagerQueryParams.java | 16 +++ .../pojo/vo/AssessmentRecordDetailVo.java | 43 ++++++++ .../pojo/vo/AssessmentRecordPagerVo.java | 48 ++++++++ .../pojo/vo/CkProjectDetailTableVo.java | 2 +- .../service/CkAssessmentRecordService.java | 22 ++++ .../impl/CkAssessmentRecordServiceImpl.java | 51 +++++++++ .../vo/ServiceProjectSecurityUserPagerVo.java | 5 +- .../com/changhu/pojo/dto/DataViewDTO.java | 23 ++++ .../com/changhu/service/OpenApiService.java | 8 ++ .../service/impl/OpenApiServiceImpl.java | 44 ++++++++ .../mapper/CkAssessmentRecordMapper.xml | 26 +++++ .../main/resources/mapper/CkProjectMapper.xml | 3 +- superManagement/src/config/index.ts | 6 + .../unitManage/police/assessmentCriteria.ts | 2 +- .../unitManage/police/assessmentRecord.ts | 58 ++++++++++ .../police/assessmentCriteria/index.vue | 4 +- .../police/assessmentRecord/index.tsx | 103 ++++++++++++++++++ .../police/assessmentRecord/index.vue | 91 ++++++++++++++++ .../unitManage/police/unitManage/index.tsx | 1 - .../unitManage/police/unitManage/index.vue | 23 ---- 24 files changed, 619 insertions(+), 31 deletions(-) create mode 100644 policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/controller/AssessmentRecordController.java create mode 100644 policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/queryParams/AssessmentRecordPagerQueryParams.java create mode 100644 policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/AssessmentRecordDetailVo.java create mode 100644 policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/AssessmentRecordPagerVo.java create mode 100644 policeSecurityServer/src/main/java/com/changhu/pojo/dto/DataViewDTO.java create mode 100644 policeSecurityServer/src/main/resources/mapper/CkAssessmentRecordMapper.xml create mode 100644 superManagement/src/types/views/unitManage/police/assessmentRecord.ts create mode 100644 superManagement/src/views/unitManage/police/assessmentRecord/index.tsx create mode 100644 superManagement/src/views/unitManage/police/assessmentRecord/index.vue diff --git a/policeSecurityServer/src/main/java/com/changhu/common/enums/OpenApiType.java b/policeSecurityServer/src/main/java/com/changhu/common/enums/OpenApiType.java index 370b5a2..c68e356 100644 --- a/policeSecurityServer/src/main/java/com/changhu/common/enums/OpenApiType.java +++ b/policeSecurityServer/src/main/java/com/changhu/common/enums/OpenApiType.java @@ -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 openApiKeys; diff --git a/policeSecurityServer/src/main/java/com/changhu/controller/OpenController.java b/policeSecurityServer/src/main/java/com/changhu/controller/OpenController.java index 99ec8d7..238dd31 100644 --- a/policeSecurityServer/src/main/java/com/changhu/controller/OpenController.java +++ b/policeSecurityServer/src/main/java/com/changhu/controller/OpenController.java @@ -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(); + } } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/controller/AssessmentRecordController.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/controller/AssessmentRecordController.java new file mode 100644 index 0000000..7cfb7fc --- /dev/null +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/controller/AssessmentRecordController.java @@ -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 pager(@RequestBody PageParams queryParams) { + return assessmentRecordService.pager(queryParams); + } + + @Operation(summary = "扣分详情") + @GetMapping("/deductedDetail") + public List deductedDetail(@RequestParam Long assessmentRecordId) { + return assessmentRecordService.deductedDetail(assessmentRecordId); + } + +} diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/mapper/CkAssessmentRecordMapper.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/mapper/CkAssessmentRecordMapper.java index 36dea56..9c0cadb 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/mapper/CkAssessmentRecordMapper.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/mapper/CkAssessmentRecordMapper.java @@ -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 { + /** + * 分页查询 + * + * @param page 分页对象 + * @param params 查询参数 + * @return 结果 + */ + Page pager(@Param("page") Page page, + @Param("params") AssessmentRecordPagerQueryParams params); } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/queryParams/AssessmentRecordPagerQueryParams.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/queryParams/AssessmentRecordPagerQueryParams.java new file mode 100644 index 0000000..ff6d855 --- /dev/null +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/queryParams/AssessmentRecordPagerQueryParams.java @@ -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; +} diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/AssessmentRecordDetailVo.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/AssessmentRecordDetailVo.java new file mode 100644 index 0000000..6630a70 --- /dev/null +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/AssessmentRecordDetailVo.java @@ -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; +} diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/AssessmentRecordPagerVo.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/AssessmentRecordPagerVo.java new file mode 100644 index 0000000..f371242 --- /dev/null +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/AssessmentRecordPagerVo.java @@ -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; + +} diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/CkProjectDetailTableVo.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/CkProjectDetailTableVo.java index c83b28f..c8d9514 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/CkProjectDetailTableVo.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/pojo/vo/CkProjectDetailTableVo.java @@ -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; diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/service/CkAssessmentRecordService.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/service/CkAssessmentRecordService.java index 276cf04..d2418bf 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/service/CkAssessmentRecordService.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/service/CkAssessmentRecordService.java @@ -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 { + /** + * 分页查询 + * + * @param queryParams 查询参数 + * @return 结果 + */ + Page pager(PageParams queryParams); + + /** + * 扣分详情 + * + * @param assessmentRecordId 考核记录id + * @return 结果 + */ + List deductedDetail(Long assessmentRecordId); } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/service/impl/CkAssessmentRecordServiceImpl.java b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/service/impl/CkAssessmentRecordServiceImpl.java index 489e736..de08d5b 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/service/impl/CkAssessmentRecordServiceImpl.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/assessmentCriteria/service/impl/CkAssessmentRecordServiceImpl.java @@ -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 implements CkAssessmentRecordService { + @Autowired + private CkProjectMapper ckProjectMapper; + + @Override + public Page pager(PageParams queryParams) { + return baseMapper.pager(queryParams.getPage(), queryParams.getParams()); + } + + @Override + public List deductedDetail(Long assessmentRecordId) { + CkAssessmentRecord ckAssessmentRecord = Db.lambdaQuery(CkAssessmentRecord.class) + .eq(BaseEntity::getSnowFlakeId, assessmentRecordId) + .oneOpt() + .orElseThrow(() -> new MessageException(ResultCode.DATA_NOT_FOUND)); + + List ckProjectDetailTableVos = ckProjectMapper.ckProjectDetail(ckAssessmentRecord.getCkProjectId()); + + List 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(); + } } diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/vo/ServiceProjectSecurityUserPagerVo.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/vo/ServiceProjectSecurityUserPagerVo.java index 0dc1a84..283d75e 100644 --- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/vo/ServiceProjectSecurityUserPagerVo.java +++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/vo/ServiceProjectSecurityUserPagerVo.java @@ -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; diff --git a/policeSecurityServer/src/main/java/com/changhu/pojo/dto/DataViewDTO.java b/policeSecurityServer/src/main/java/com/changhu/pojo/dto/DataViewDTO.java new file mode 100644 index 0000000..8fa6a12 --- /dev/null +++ b/policeSecurityServer/src/main/java/com/changhu/pojo/dto/DataViewDTO.java @@ -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; +} diff --git a/policeSecurityServer/src/main/java/com/changhu/service/OpenApiService.java b/policeSecurityServer/src/main/java/com/changhu/service/OpenApiService.java index cb97c56..cbe9870 100644 --- a/policeSecurityServer/src/main/java/com/changhu/service/OpenApiService.java +++ b/policeSecurityServer/src/main/java/com/changhu/service/OpenApiService.java @@ -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(); } diff --git a/policeSecurityServer/src/main/java/com/changhu/service/impl/OpenApiServiceImpl.java b/policeSecurityServer/src/main/java/com/changhu/service/impl/OpenApiServiceImpl.java index 88a3bf4..ed346bd 100644 --- a/policeSecurityServer/src/main/java/com/changhu/service/impl/OpenApiServiceImpl.java +++ b/policeSecurityServer/src/main/java/com/changhu/service/impl/OpenApiServiceImpl.java @@ -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; + } } diff --git a/policeSecurityServer/src/main/resources/mapper/CkAssessmentRecordMapper.xml b/policeSecurityServer/src/main/resources/mapper/CkAssessmentRecordMapper.xml new file mode 100644 index 0000000..b2716f3 --- /dev/null +++ b/policeSecurityServer/src/main/resources/mapper/CkAssessmentRecordMapper.xml @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file diff --git a/policeSecurityServer/src/main/resources/mapper/CkProjectMapper.xml b/policeSecurityServer/src/main/resources/mapper/CkProjectMapper.xml index 582f133..cce7070 100644 --- a/policeSecurityServer/src/main/resources/mapper/CkProjectMapper.xml +++ b/policeSecurityServer/src/main/resources/mapper/CkProjectMapper.xml @@ -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 \ No newline at end of file diff --git a/superManagement/src/config/index.ts b/superManagement/src/config/index.ts index 93fcb7f..4743ad7 100644 --- a/superManagement/src/config/index.ts +++ b/superManagement/src/config/index.ts @@ -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: '保安单位', diff --git a/superManagement/src/types/views/unitManage/police/assessmentCriteria.ts b/superManagement/src/types/views/unitManage/police/assessmentCriteria.ts index 206ea15..05a4611 100644 --- a/superManagement/src/types/views/unitManage/police/assessmentCriteria.ts +++ b/superManagement/src/types/views/unitManage/police/assessmentCriteria.ts @@ -86,5 +86,5 @@ export interface CkProjectDetailRes { /*扣分数 */ deductionPoints: number; /*选择类型,可用值:RADIO,MULTIPLE */ - type: BaseEnum; + itemType: BaseEnum; } diff --git a/superManagement/src/types/views/unitManage/police/assessmentRecord.ts b/superManagement/src/types/views/unitManage/police/assessmentRecord.ts new file mode 100644 index 0000000..9a9a891 --- /dev/null +++ b/superManagement/src/types/views/unitManage/police/assessmentRecord.ts @@ -0,0 +1,58 @@ +import {BaseTableRowRecord} from "@/types/components/table"; + +export interface AssessmentRecordPagerVo extends BaseTableRowRecord { + /** 企事业单位名称 **/ + enterprisesUnitName: string; + /** 考核项目名称 **/ + ckProjectName: string; + /** 考核项目总分 **/ + totalScore: number; + /** 考核项目类型 **/ + type: BaseEnum; + /** 考核项目备注 **/ + 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; + /*考核项备注 */ + itemRemark: string; + /*考核标准id */ + ckStandardId: number; + /*考核标准 */ + standardName: string; + /*扣分数 */ + deductionPoints: Record; + /*是否选中 */ + isSelected: boolean; +} diff --git a/superManagement/src/views/unitManage/police/assessmentCriteria/index.vue b/superManagement/src/views/unitManage/police/assessmentCriteria/index.vue index 12f2aef..fe62cb5 100644 --- a/superManagement/src/views/unitManage/police/assessmentCriteria/index.vue +++ b/superManagement/src/views/unitManage/police/assessmentCriteria/index.vue @@ -167,7 +167,7 @@ const ckProjectTableColumns: CkProjectTableProps['columns'] = [ return '/' } return
-

{_record.itemName}({_record.type?.label}) +

{_record.itemName}({_record.itemType?.label})

@@ -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)}>编辑 diff --git a/superManagement/src/views/unitManage/police/assessmentRecord/index.tsx b/superManagement/src/views/unitManage/police/assessmentRecord/index.tsx new file mode 100644 index 0000000..0a62bbe --- /dev/null +++ b/superManagement/src/views/unitManage/police/assessmentRecord/index.tsx @@ -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('/assessmentRecord/deductedDetail', {assessmentRecordId: assessmentRecord.snowFlakeId}) + const groupRowSpan: Record = {} + const itemRowSpan: Record = {} + + 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 = [ + { + dataIndex: 'groupName', + title: '考核分组', + customCell: (_record) => { + return { + rowspan: _record.groupRowSpan + } + }, + customRender: ({record: _record}) => { + return
+

{_record.groupName}({_record.groupTotalScore})

+

{_record.groupRemark}

+
+ } + }, { + dataIndex: 'itemName', + title: '考核项', + customCell: (_record) => { + return { + rowspan: _record.itemRowSpan + } + }, + customRender: ({record: _record}) => { + if (!_record.ckItemId) { + return '/' + } + return
+

{_record.itemName}({_record.itemType?.label}) +

+
+ } + }, { + dataIndex: 'standardName', + title: '标准', + customRender: ({record: _record}) => { + if (!_record.ckStandardId) { + return '/' + } + return
+

{_record.standardName}扣{_record.deductionPoints}分

+
+ } + } + ] + + Modal.info({ + title: `【${assessmentRecord.enterprisesUnitName}/${assessmentRecord.ckProjectName}】扣分详情`, + icon: ' ', + width: '80%', + centered: true, + content: () =>
+
+
+ }) + +} diff --git a/superManagement/src/views/unitManage/police/assessmentRecord/index.vue b/superManagement/src/views/unitManage/police/assessmentRecord/index.vue new file mode 100644 index 0000000..2800200 --- /dev/null +++ b/superManagement/src/views/unitManage/police/assessmentRecord/index.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/superManagement/src/views/unitManage/police/unitManage/index.tsx b/superManagement/src/views/unitManage/police/unitManage/index.tsx index e4ef716..2490f56 100644 --- a/superManagement/src/views/unitManage/police/unitManage/index.tsx +++ b/superManagement/src/views/unitManage/police/unitManage/index.tsx @@ -41,7 +41,6 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => { map.clearMap() map.add(maker) map.setFitView() - console.log(123); } const _formOptions = ref>({ diff --git a/superManagement/src/views/unitManage/police/unitManage/index.vue b/superManagement/src/views/unitManage/police/unitManage/index.vue index 3c3975d..68b9f03 100644 --- a/superManagement/src/views/unitManage/police/unitManage/index.vue +++ b/superManagement/src/views/unitManage/police/unitManage/index.vue @@ -129,29 +129,6 @@ const searchFormOptions = ref({ } }) -const a = { - groupId1: { - itemId1: { - standardId: 123123, - deductionPoints: 2 - }, - itemId2: { - standardId: 345345, - deductionPoints: 4 - } - }, - groupId2: { - itemId1: { - standardId: 456456, - deductionPoints: 2 - }, - itemId2: { - standardId: 567567, - deductionPoints: 4 - } - } -} -