Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
fab6e373b8
|
@ -58,8 +58,8 @@
|
|||
"@tarojs/taro": "3.6.26",
|
||||
"dayjs": "^1.11.13",
|
||||
"pinia": "^2.2.2",
|
||||
"vue": "^3.0.0",
|
||||
"vuex": "^4.0.2"
|
||||
"vue": "^3.0.0"
|
||||
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0",
|
||||
|
|
|
@ -12,19 +12,14 @@ export const useDailyStore = defineStore('daily', {
|
|||
this.userdailyinspection = [...data]
|
||||
},
|
||||
change_base64_1(data) {
|
||||
// console.log("🚀 ~ change_base64_1 ~ data:", data)
|
||||
this.base64_1 = data
|
||||
},
|
||||
change_base64_2(data) {
|
||||
this.base64_2 = data
|
||||
},
|
||||
cleardailtcolour() {
|
||||
this.userdailyinspection = {
|
||||
...this.userdailyinspection,
|
||||
markColor: this.userdailyinspection.markColor,
|
||||
markColor1: this.userdailyinspection.markColor,
|
||||
comment: ''
|
||||
}
|
||||
clearSignData() {
|
||||
this.base64_1 = ''
|
||||
this.base64_2 = ''
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<!-- picker -->
|
||||
<picker mode="selector" :range="selector" rangeKey="label" @change="onChange">
|
||||
<view class="picker">
|
||||
考核单位:
|
||||
|
@ -12,8 +11,6 @@
|
|||
</view>
|
||||
</picker>
|
||||
|
||||
<!-- picker -->
|
||||
<!-- 如果 selectorType 为 undefined 或 null,?.length 会返回 undefined,然后通过 ?? 运算符将其替换为 0,确保条件判断不会出错。 -->
|
||||
<picker v-if="(selectorType?.length ?? 0) > 0" mode="selector" :range="selectorType" rangeKey="label" @change="onChangeType">
|
||||
<view class="picker">
|
||||
当前考核项目:
|
||||
|
@ -24,7 +21,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
<!-- 选择题 -->
|
||||
|
||||
<view class="exit" v-for="item in starRating" :key="item.snowFlakeId" @click="Onrating(item.name, item.snowFlakeId)">
|
||||
<view class="exitItem">
|
||||
<text style="margin-left: 30rpx; font-size: 16px">
|
||||
|
@ -96,7 +93,7 @@ watch(
|
|||
starRating.value = newDaily
|
||||
}
|
||||
submitData.value = newDaily
|
||||
console.log('watch_______________', _form, submitData.value)
|
||||
// console.log('watch_______________', _form, submitData.value)
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
@ -111,74 +108,31 @@ const Onrating = function (name: string, snowFlakeId: string) {
|
|||
url: `/subPages/select/dailyLife/dailyLife?name=${name}&index=${index}`,
|
||||
})
|
||||
}
|
||||
interface UnitEnterprisesUnitList {
|
||||
label: string
|
||||
value: string
|
||||
extData: {
|
||||
type: {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
}
|
||||
}
|
||||
interface CkProjectListByType {
|
||||
label: string
|
||||
value: string
|
||||
extData: {
|
||||
createTime: string
|
||||
remark: string
|
||||
totalScore: number
|
||||
type: {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @assessmentCriteriaRulesByCkProjectId 获取考核规则
|
||||
*/
|
||||
interface StandardList {
|
||||
ckItemId: string
|
||||
deductionPoints: number
|
||||
name: string
|
||||
snowFlakeId: string
|
||||
}
|
||||
interface ItemList {
|
||||
ckGroupId: string
|
||||
name: string
|
||||
remark: string
|
||||
snowFlakeId: string
|
||||
standardList: StandardList[]
|
||||
type: { value: string; label: string }
|
||||
selectedID: string
|
||||
selected_points: number
|
||||
selectedGroup: string[]
|
||||
}
|
||||
interface StarRating {
|
||||
itemList: ItemList[]
|
||||
name: string
|
||||
remark: string
|
||||
snowFlakeId: string
|
||||
totalScore: number
|
||||
currentScore: number
|
||||
}
|
||||
|
||||
const assessmentCriteriaRulesByCkProjectId = async function (ckProjectId) {
|
||||
Taro.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true,
|
||||
})
|
||||
const res = await api.get<StarRating[]>(`/assessmentCriteria/assessmentCriteriaRulesByCkProjectId`, { ckProjectId })
|
||||
// ————————————————————————————————————————处理数据,默认添加已选择项
|
||||
|
||||
res.data?.forEach((item) => {
|
||||
item.currentScore = 0
|
||||
|
||||
item.itemList.forEach((element: ItemList) => {
|
||||
// element.selectedID = element.standardList[0].snowFlakeId
|
||||
element.standardList.forEach((ele) => {
|
||||
ele.isSelected = false
|
||||
})
|
||||
element.standardList.unshift({
|
||||
ckItemId: 'null',
|
||||
deductionPoints: 0,
|
||||
name: '达标',
|
||||
snowFlakeId: 'null',
|
||||
isSelected: true,
|
||||
})
|
||||
element.selectedID = element.standardList[0].snowFlakeId
|
||||
element.selected_points = 0 // 默认达标 默认扣 0 分
|
||||
|
@ -188,7 +142,9 @@ const assessmentCriteriaRulesByCkProjectId = async function (ckProjectId) {
|
|||
}
|
||||
})
|
||||
})
|
||||
starRating.value = res.data ?? [] // 如果 res.data 为 undefined,则使用空数组
|
||||
starRating.value = res.data ?? []
|
||||
// console.log('starRating.value______________________________', starRating.value)
|
||||
|
||||
store.dailyinspectionList(starRating.value)
|
||||
Taro.hideLoading()
|
||||
}
|
||||
|
@ -207,7 +163,6 @@ const onChangeType = function (e: any) {
|
|||
let index = Number(e.detail.value)
|
||||
selectorCheckedType.value = selectorType.value?.[index].label as string
|
||||
currentCkProjectId.value = selectorType.value?.[index].value as string
|
||||
// let ckProjectId = selectorType.value?.[index].value
|
||||
assessmentCriteriaRulesByCkProjectId(currentCkProjectId.value)
|
||||
_form.ckProjectId = selectorType.value?.[index].value as string
|
||||
}
|
||||
|
@ -215,11 +170,15 @@ const onChangeType = function (e: any) {
|
|||
const selector = ref<UnitEnterprisesUnitList[]>()
|
||||
const selectorChecked = ref<string>('')
|
||||
const onChange = function (e: any) {
|
||||
let index = Number(e.detail.value)
|
||||
selectorChecked.value = selector.value?.[index].label as string
|
||||
let type = selector.value?.[index].extData.type.value
|
||||
ckProjectListByType(type)
|
||||
_form.enterprisesUnitId = selector.value?.[index].value as string
|
||||
try {
|
||||
let index = Number(e.detail.value)
|
||||
selectorChecked.value = selector.value?.[index].label as string
|
||||
let type = selector.value?.[index].extData.type.value
|
||||
ckProjectListByType(type)
|
||||
_form.enterprisesUnitId = selector.value?.[index].value as string
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ onChange ~ error:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const getUnitEnterprisesUnitList = async function () {
|
||||
|
@ -238,16 +197,20 @@ const _showToast = function (title) {
|
|||
|
||||
/**
|
||||
* @onSubmit 提交
|
||||
*/
|
||||
/**
|
||||
* @assessmentRecordDetails 选择后的数据用于提交
|
||||
* @clearData 清空数据
|
||||
*/
|
||||
interface Item {
|
||||
itemList: any[] // 根据实际情况调整类型
|
||||
snowFlakeId: string
|
||||
}
|
||||
|
||||
const assessmentRecordDetails = ref<any[]>([])
|
||||
const clearData = function () {
|
||||
store.clearSignData()
|
||||
store.dailyinspectionList([])
|
||||
assessmentRecordDetails.value = []
|
||||
_form.assessmentUserSignature = ''
|
||||
_form.byAssessmentEnterprisesUnitUserSignature = ''
|
||||
_form.remark = ''
|
||||
assessmentCriteriaRulesByCkProjectId(currentCkProjectId.value) //重新获取数据
|
||||
}
|
||||
const onSubmit = async function () {
|
||||
if (_form.enterprisesUnitId === '') {
|
||||
_showToast('请选择企事业单位')
|
||||
|
@ -302,14 +265,9 @@ const onSubmit = async function () {
|
|||
}
|
||||
Object.assign(assessmentRecordParams, _form)
|
||||
assessmentRecordParams.assessmentRecordDetails = [...assessmentRecordDetails.value]
|
||||
console.log('🚀 ~ onSubmit ~ assessmentRecordParams:', assessmentRecordParams)
|
||||
|
||||
const result = await api.post('/assessmentCriteria/submitAssessmentRecord', assessmentRecordParams)
|
||||
console.log('🚀 ~ onSubmit ~ result:', result)
|
||||
Taro.hideLoading()
|
||||
store.dailyinspectionList([]) //清空数据
|
||||
assessmentRecordDetails.value = [] //清空数据
|
||||
assessmentCriteriaRulesByCkProjectId(currentCkProjectId.value) //重新获取数据
|
||||
clearData() //清空数据
|
||||
if (result.code === 200) {
|
||||
Taro.showToast({
|
||||
title: result.message,
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
<nut-collapse v-model="item.snowFlakeId" accordion v-for="(item, index) in starRating[findIndex].itemList" :key="item.snowFlakeId">
|
||||
<nut-collapse-item :name="item.snowFlakeId" :title="item.name">
|
||||
<view class="singleChoice">
|
||||
<!-- v-model="form[item.name]" -->
|
||||
<nut-radio-group v-if="item.type.value === 'radio'" v-model="item.selectedID" @change="(modelValue) => onChange(modelValue, item.name)">
|
||||
<nut-radio v-for="(items, indexs) in item.standardList" size="40" :label="items.snowFlakeId" :key="indexs"> {{ items.name }}</nut-radio>
|
||||
</nut-radio-group>
|
||||
|
||||
<!-- 不能直接去更改 v-model 绑定的 这个数据 ,否则会造成无限递归-->
|
||||
<nut-checkbox-group v-else v-model="item.selectedGroup" @change="(arr) => checkboxGroupChange(arr, index)" style="display: flex; flex-direction: column">
|
||||
<nut-checkbox
|
||||
@change="(state, label) => checkboxChange(state, label)"
|
||||
v-model="items.isSelected"
|
||||
@change="(state, label) => checkboxChange(state, label, index, i)"
|
||||
v-for="(items, i) in item.standardList"
|
||||
size="40"
|
||||
:label="items.snowFlakeId"
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
<script setup>
|
||||
import Taro, { useLoad, useUnload } from '@tarojs/taro'
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { ref, computed, watch, nextTick } from 'vue'
|
||||
|
||||
import { useDailyStore } from '@/store/daily.ts'
|
||||
const store = useDailyStore()
|
||||
|
@ -66,21 +66,17 @@ const onChange = (modelValue, name) => {
|
|||
if (name === element.name) {
|
||||
element.selectedID = modelValue
|
||||
element.standardList.forEach((item) => {
|
||||
// console.log('item.snowFlakeId, modelValue_________________', item.snowFlakeId, modelValue)
|
||||
if (item.snowFlakeId == modelValue) {
|
||||
element.selectedName = item.name // 添加扣分选项名字 selectedName 为标识数据———————便于区分测试
|
||||
element.selected_points = item.deductionPoints //添加扣分项
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const checkboxGroupChange = function (arr, index) {
|
||||
// console.log('🚀 ~ checkboxGroupChange ~ arr:', arr)
|
||||
// console.log(index)
|
||||
|
||||
// console.log(starRating.value[findIndex.value].itemList[index])
|
||||
const checkboxGroupChange = function (arr, index) {
|
||||
let points = 0
|
||||
|
||||
starRating.value[findIndex.value].itemList.forEach((element, i) => {
|
||||
if (i === index) {
|
||||
element.selectedGroup.forEach((selectedId) => {
|
||||
|
@ -93,11 +89,27 @@ const checkboxGroupChange = function (arr, index) {
|
|||
}
|
||||
})
|
||||
starRating.value[findIndex.value].itemList[index].selected_points = points
|
||||
// console.log(points)
|
||||
// console.log(starRating.value[findIndex.value].itemList[index].selected_points)
|
||||
}
|
||||
const checkboxChange = function (state, label) {
|
||||
// console.log('🚀 ~ checkboxChange ~ state, label:', state, label)
|
||||
const checkboxChange = async function (state, label, index, i) {
|
||||
// DOM 还未更新
|
||||
await nextTick() //等待下一次 DOM 更新刷新的工具方法。
|
||||
// DOM 此时已经更新
|
||||
|
||||
let arr
|
||||
|
||||
if (label === '达标' && i === 0) {
|
||||
console.log(11111111111111)
|
||||
arr = ['null']
|
||||
} else {
|
||||
arr = starRating.value[findIndex.value].itemList[index].selectedGroup.filter((selectedId) => selectedId != 'null')
|
||||
}
|
||||
if (arr?.length === 0) {
|
||||
arr = ['null']
|
||||
}
|
||||
|
||||
if (JSON.stringify(arr) !== JSON.stringify(starRating.value[findIndex.value].itemList[index].selectedGroup)) {
|
||||
starRating.value[findIndex.value].itemList[index].selectedGroup = arr
|
||||
}
|
||||
}
|
||||
useUnload(() => {
|
||||
let points = 0
|
||||
|
@ -105,7 +117,6 @@ useUnload(() => {
|
|||
points += element.selected_points
|
||||
})
|
||||
starRating.value[findIndex.value].currentScore = points
|
||||
|
||||
store.dailyinspectionList([...starRating.value])
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -12,7 +12,7 @@ const base64_2 = computed(() => store.get_base64_2)
|
|||
|
||||
const _index = ref(0)
|
||||
useLoad((options) => {
|
||||
console.log(options)
|
||||
// console.log(options)
|
||||
_index.value = Number(options.index)
|
||||
if (_index.value === 1) {
|
||||
imgData.value = base64_1.value
|
||||
|
@ -39,7 +39,7 @@ const convertToBase64 = (imgUrl: string): Promise<string> => {
|
|||
}
|
||||
const confirm = async (canvas: any, data: string) => {
|
||||
if (data) {
|
||||
console.log('imgData', canvas, data)
|
||||
console.log('imgData', canvas)
|
||||
try {
|
||||
const base64Image = await convertToBase64(data)
|
||||
if (_index.value === 1) {
|
||||
|
|
|
@ -102,3 +102,57 @@ interface BaseEnum<T, E = Record<string, any>> {
|
|||
label: string;
|
||||
extData: E;
|
||||
}
|
||||
|
||||
interface StandardList {
|
||||
ckItemId: string
|
||||
deductionPoints: number
|
||||
name: string
|
||||
snowFlakeId: string
|
||||
isSelected: boolean
|
||||
}
|
||||
interface ItemList {
|
||||
ckGroupId: string
|
||||
name: string
|
||||
remark: string
|
||||
snowFlakeId: string
|
||||
standardList: StandardList[]
|
||||
type: { value: string; label: string }
|
||||
selectedID: string
|
||||
selected_points: number
|
||||
selectedGroup: any[]
|
||||
}
|
||||
interface StarRating {
|
||||
itemList: ItemList[]
|
||||
name: string
|
||||
remark: string
|
||||
snowFlakeId: string
|
||||
totalScore: number
|
||||
currentScore: number
|
||||
}
|
||||
interface UnitEnterprisesUnitList {
|
||||
label: string
|
||||
value: string
|
||||
extData: {
|
||||
type: {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
}
|
||||
}
|
||||
interface CkProjectListByType {
|
||||
label: string
|
||||
value: string
|
||||
extData: {
|
||||
createTime: string
|
||||
remark: string
|
||||
totalScore: number
|
||||
type: {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
}
|
||||
}
|
||||
interface Item {
|
||||
itemList: any[] // 根据实际情况调整类型
|
||||
snowFlakeId: string
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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}】` : '添加考核项目',
|
||||
|
|
|
@ -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>>({
|
||||
|
@ -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)}
|
||||
|
|
|
@ -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