This commit is contained in:
TimSpan 2024-11-12 09:47:31 +08:00
commit 4007d4f761
27 changed files with 688 additions and 77 deletions

View File

@ -5,6 +5,9 @@ import com.changhu.common.db.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.stream.Collectors;
/**
* @author 20252
* @createTime 2024/11/5 下午4:22
@ -14,12 +17,28 @@ import lombok.Getter;
@AllArgsConstructor
public enum EnterprisesUnitType implements BaseEnum<String>, IEnum<String> {
school("school", "学校"),
hospital("hospital", "医院"),
community("community", "社区/小区"),
bank("bank", "银行"),
;
party_government("party_government", "党政机关"),
medical("medical", "医疗机构"),
residential("residential", "小区"),
higher_learning("higher_learning", "高等院校"),
primary_and_secondary("primary_and_secondary", "中小学幼儿园"),
shopping_supermarkets("shopping_supermarkets", "商场超市"),
financial("financial", "金融机构"),
hydropower("hydropower", "水电油气"),
key_projects("key_projects", "重点工程建设单位"),
delivery_logistics("delivery_logistics", "寄递物流"),
military("military", "军工、科研单位"),
wen_bo("wen_bo", "文博单位"),
important_news("important_news ", "重要新闻单位"),
large_scale_material("large_scale_material ", "大型物资储备"),
transportation("transportation", "交通运输企业"),
industrial_park("industrial_park", "工业园区企业"),
complex_public_security("complex_public_security", "治安复杂场所"),
making_explosive_easily("making_explosive_easily ", "易制爆"),
hazardous_materials("hazardous_materials ", "危化物品存放场所"),
other("other", "其他单位");
private final String value;
private final String label;
}

View File

@ -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;

View File

@ -63,16 +63,16 @@ public class WebConfig implements WebMvcConfigurer {
.addPathPatterns("/open/**");
}
// @Override
// public void addCorsMappings(CorsRegistry registry) {
// registry.addMapping("/**")
// .allowedOriginPatterns("*")
// .allowedMethods("GET", "POST", "OPTION", "PUT", "DELETE")
// .allowedHeaders("Content-Type", "X-Requested-With", "accept", "Origin", "Access-Control-Request-Method",
// "Access-Control-Request-Headers", "Authorization","Token","*")
// .allowCredentials(true)
// .maxAge(3600);
// }
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOriginPatterns("*")
.allowedMethods("GET", "POST", "OPTION", "PUT", "DELETE")
.allowedHeaders("Content-Type", "X-Requested-With", "accept", "Origin", "Access-Control-Request-Method",
"Access-Control-Request-Headers", "Authorization", "Token", "*")
.allowCredentials(true)
.maxAge(3600);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {

View File

@ -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;
@ -32,9 +33,8 @@ public class OpenController {
@Operation(summary = "获取企事业单位列表")
@CheckOpenApi(value = OpenApiType.Information_on_enterprises_and_institutions)
@GetMapping("/getEnterprisesUnit")
public List<SelectNodeVo<Long>> getEnterprisesUnit(@Schema(description = "行政区划代码") @RequestParam String code,
@Schema(description = "行政区划等级") @RequestParam Integer level) {
return openApiService.getEnterprisesUnit(code, level);
public List<SelectNodeVo<Long>> getEnterprisesUnit(@Schema(description = "公安单位机构代码") @RequestParam String policeCode) {
return openApiService.getEnterprisesUnit(policeCode);
}
@Operation(summary = "企事业单位详情")
@ -43,4 +43,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();
}
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
@ -14,11 +15,10 @@ public interface OpenApiService {
/**
* 获取企事业单位列表
*
* @param code 行政区划代码
* @param level 行政区划等级
* @param policeCode 公安机构代码
* @return 企事业单位列表
*/
List<SelectNodeVo<Long>> getEnterprisesUnit(String code, Integer level);
List<SelectNodeVo<Long>> getEnterprisesUnit(String policeCode);
/**
* 企事业单位详情
@ -27,4 +27,11 @@ public interface OpenApiService {
* @return 企事业单位详情
*/
EnterprisesUnitDetailDTO enterprisesUnitDetailById(Long enterprisesUnitId);
/**
* 数据总览
*
* @return 数据总览
*/
DataViewDTO dataView();
}

View File

@ -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
@ -26,12 +32,10 @@ public class OpenApiServiceImpl implements OpenApiService {
private ServiceProjectService serviceProjectService;
@Override
public List<SelectNodeVo<Long>> getEnterprisesUnit(String code, Integer level) {
public List<SelectNodeVo<Long>> getEnterprisesUnit(String policeCode) {
PoliceUnit policeUnit = Db.lambdaQuery(PoliceUnit.class).eq(PoliceUnit::getCode, policeCode).oneOpt().orElseThrow(() -> new MessageException("当前系统没有该派出所"));
return Db.lambdaQuery(EnterprisesUnit.class)
.eq(level == 1, EnterprisesUnit::getProvince, code)
.eq(level == 2, EnterprisesUnit::getCity, code)
.eq(level == 3, EnterprisesUnit::getDistricts, code)
.eq(level == 4, EnterprisesUnit::getStreet, code)
.eq(EnterprisesUnit::getPoliceUnitId, policeUnit.getSnowFlakeId())
.list()
.stream()
.map(item -> SelectNodeVo.<Long>builder()
@ -57,4 +61,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;
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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: '保安单位',

View File

@ -86,5 +86,5 @@ export interface CkProjectDetailRes {
/*扣分数 */
deductionPoints: number;
/*选择类型,可用值:RADIO,MULTIPLE */
type: BaseEnum<string>;
itemType: BaseEnum<string>;
}

View File

@ -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;
}

View File

@ -12,7 +12,7 @@ export const saveOrUpdateCkProject = (params: SaveOrUpdateCkProjectParams = {
name: '',
totalScore: 100,
remark: '',
type: 'school'
type: 'party_government'
}, callback: Function) => {
submitSimpleFormModal<SaveOrUpdateCkProjectParams>({
title: params.snowFlakeId ? `编辑【${params.name}` : '添加考核项目',

View File

@ -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>

View File

@ -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>
})
}

View File

@ -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>

View File

@ -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>>({
@ -62,7 +61,7 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => {
required: true,
componentsProps: {
displayRender: ({labels}): string => {
city = labels[0]
city = labels[1]
return labels.join(' / ');
}
}
@ -78,23 +77,6 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => {
ref={_mapRef}
style={{width: '100%', height: '300px', position: 'relative'}}
initCallback={(map) => {
AMap.plugin(['AMap.AutoComplete'], () => {
//@ts-ignore
const auto = new AMap.AutoComplete({
city,
input: "tipinput"
});
//注册监听,当选中某条记录时会触发
auto.on("select", (e) => {
//有些点位可能没有经纬度信息
if (!e.poi.location) {
message.error('所选点位没有经纬度信息 建议选则附近的手动移动!');
return
}
_formParams.value.point = e.poi.location
initMarker(map)
});
})
if (_formParams.value.point) {
initMarker(map)
}
@ -104,6 +86,31 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => {
<input id={'tipinput'}
placeholder={'请输入详细地址'}
autocomplete="off"
onFocus={() => {
if (!_mapRef.value.mapInstance) {
message.error('地图组件尚未初始化成功 请重新打开页面')
return
}
//@ts-ignore
_mapRef.value.mapInstance.plugin(['AMap.AutoComplete'], () => {
//@ts-ignore
const auto = new AMap.AutoComplete({
city: city,
input: "tipinput",
citylimit: true
});
//注册监听,当选中某条记录时会触发
auto.on("select", (e) => {
//有些点位可能没有经纬度信息
if (!e.poi.location) {
message.error('所选点位没有经纬度信息 建议选则附近的手动移动!');
return
}
_formParams.value.point = e.poi.location
initMarker(_mapRef.value.mapInstance)
});
})
}}
/>
</div>
</MapContainer>
@ -221,7 +228,7 @@ export const showEnterprisesUnit = (policeUnitPagerVo: PoliceUnitPagerVo) => {
class="btn-success"
onClick={() => saveOrUpdateEnterprisesUnit({
name: undefined,
type: 'school',
type: 'party_government',
policeUnitId: policeUnitPagerVo.snowFlakeId,
administrativeDivisionCodes: [policeUnitPagerVo.province, policeUnitPagerVo.city, policeUnitPagerVo.districts, policeUnitPagerVo.street].filter(Boolean)
}, _tableRef.value?.requestGetTableData)}

View File

@ -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">