Merge branch 'main' of http://175.6.124.250:3100/luozhun/policeSecurity
This commit is contained in:
commit
c037a3ab53
|
@ -9,6 +9,7 @@ type EnumType =
|
|||
| 'Sex'
|
||||
| 'ServiceProjectType'
|
||||
| 'MiniProgramUserIdentity'
|
||||
| 'EducationLevel'
|
||||
|
||||
export const initEnum = () => {
|
||||
api.get<Record<EnumType, SelectNodeVo<any>[]>>('/common/enums').then(resp => {
|
||||
|
|
|
@ -96,10 +96,11 @@
|
|||
<nut-dialog no-cancel-btn content="详情" v-model:visible="detailVisible">
|
||||
<slot>
|
||||
<view style="margin-bottom: 5px">
|
||||
<view>籍贯:{{ securityUserDetail.nativePlace }}</view>
|
||||
<view>公司:{{ securityUserDetail.securityUnitName }}</view>
|
||||
<view>家庭地址:{{ securityUserDetail.homeAddress }}</view>
|
||||
<view>备注:{{ securityUserDetail.remark }}</view>
|
||||
<view>籍贯:{{ securityUserDetail?.nativePlace }}</view>
|
||||
<view>公司:{{ securityUserDetail?.securityUnitName }}</view>
|
||||
<view>家庭地址:{{ securityUserDetail?.homeAddress }}</view>
|
||||
<view>文化程度:{{ securityUserDetail.educationLevel?.label }}</view>
|
||||
<view>备注:{{ securityUserDetail?.remark }}</view>
|
||||
</view>
|
||||
</slot>
|
||||
</nut-dialog>
|
||||
|
@ -240,7 +241,7 @@ const detail = (item: ServiceProjectSecurityUserPagerVo) => {
|
|||
}
|
||||
const securityUserEdit = (item: ServiceProjectSecurityUserPagerVo) => {
|
||||
console.log(item)
|
||||
const params = {...item, sex: item.sex.value}
|
||||
const params = {...item, sex: item.sex.value,educationLevel:item.educationLevel}
|
||||
Taro.navigateTo({url: `/subPages/projectManager/securityUserForm/securityUserForm?securityUser=${JSON.stringify(params)}&type=formInput`})
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<view class="form">
|
||||
<nut-form ref="formRef" :model-value="formData" :rules="rules">
|
||||
<nut-form-item label="头像" prop="avatar">
|
||||
<!-- <view class="uploadPictures" @click="chooseImage">-->
|
||||
<!-- <view v-if="!formData.photo">-->
|
||||
<!-- <IconFont name="uploader" size="25" color="#98a7b0"></IconFont>-->
|
||||
<!-- </view>-->
|
||||
<!-- <image v-else :src="minioBaseUrl +formData.photo" style="width: 100%; height: 100%"></image>-->
|
||||
<!-- </view>-->
|
||||
<nut-form-item label="头像" prop="avatar">
|
||||
<!-- <view class="uploadPictures" @click="chooseImage">-->
|
||||
<!-- <view v-if="!formData.photo">-->
|
||||
<!-- <IconFont name="uploader" size="25" color="#98a7b0"></IconFont>-->
|
||||
<!-- </view>-->
|
||||
<!-- <image v-else :src="minioBaseUrl +formData.photo" style="width: 100%; height: 100%"></image>-->
|
||||
<!-- </view>-->
|
||||
<view @click="chooseImage" size>
|
||||
<image v-if="!formData.photo" src="@/assets/logo/avatar1.png" style="width: 50px; height: 50px"></image>
|
||||
<image v-else :src="minioBaseUrl +formData.photo" style="width: 160px; height: 128px"></image>
|
||||
|
@ -15,16 +15,16 @@
|
|||
</nut-form-item>
|
||||
<nut-form-item label="身份证" prop="idCard">
|
||||
<view style="display: flex; justify-content: space-between; align-items: center">
|
||||
<nut-input v-model="formData.idCard" placeholder="请填写身份证" type="text" @blur="cardBlur" />
|
||||
<nut-input v-model="formData.idCard" placeholder="请填写身份证" type="text" @blur="cardBlur"/>
|
||||
<view style="color: #3a6bbe; width: 70px; text-align: center" @click="idCardBlur(formData, 0)">查询</view>
|
||||
</view>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="姓名" prop="name">
|
||||
<nut-input v-model="formData.name" placeholder="请输入姓名" type="text" />
|
||||
<nut-input v-model="formData.name" placeholder="请输入姓名" type="text"/>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="性别" prop="sex">
|
||||
<nut-radio-group v-model="formData.sex" direction="horizontal">
|
||||
<nut-radio v-for="item in SEX" :key="item.value" :label="item.value">{{ item.label }} </nut-radio>
|
||||
<nut-radio v-for="item in SEX" :key="item.value" :label="item.value">{{ item.label }}</nut-radio>
|
||||
</nut-radio-group>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="出生日期" prop="dateOfBirth">
|
||||
|
@ -33,25 +33,30 @@
|
|||
</view>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="工作岗位" prop="workPost">
|
||||
<nut-input v-model="formData.workPost" placeholder="请输入工作岗位" type="text" />
|
||||
<nut-input v-model="formData.workPost" placeholder="请输入工作岗位" type="text"/>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="手机号" prop="telephone">
|
||||
<nut-input v-model="formData.telephone" placeholder="请输入手机号" type="text" />
|
||||
<nut-input v-model="formData.telephone" placeholder="请输入手机号" type="text"/>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="文化程度" prop="educationLevel">
|
||||
<view @click="showBottom = true" >
|
||||
{{educationLevelValue?educationLevelValue:'请选择文化程度'}}
|
||||
</view>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="籍贯" prop="nativePlace">
|
||||
<nut-input v-model="formData.nativePlace" placeholder="请输入籍贯" type="text" />
|
||||
<nut-input v-model="formData.nativePlace" placeholder="请输入籍贯" type="text"/>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="地址" prop="homeAddress">
|
||||
<nut-input v-model="formData.homeAddress" placeholder="请输入地址" type="text" />
|
||||
<nut-input v-model="formData.homeAddress" placeholder="请输入地址" type="text"/>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="保安证件号" prop="securityNumber">
|
||||
<nut-input v-model="formData.securityNumber" placeholder="请输入保安证号" type="text" />
|
||||
<nut-input v-model="formData.securityNumber" placeholder="请输入保安证号" type="text"/>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="无证说明" v-if="!formData.securityNumber">
|
||||
<nut-input v-model="formData.noSecurityNumberDesc" placeholder="无证说明" type="text" />
|
||||
<nut-input v-model="formData.noSecurityNumberDesc" placeholder="无证说明" type="text"/>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="备注" prop="remark">
|
||||
<nut-input v-model="formData.remark" placeholder="请填写备注" type="text" />
|
||||
<nut-input v-model="formData.remark" placeholder="请填写备注" type="text"/>
|
||||
</nut-form-item>
|
||||
</nut-form>
|
||||
<view class="formButton">
|
||||
|
@ -71,30 +76,44 @@
|
|||
<nut-dialog content="详情" v-model:visible="visible" @ok="onOk" @cancel="cancel">
|
||||
<slot>
|
||||
<view style="margin-bottom: 5px">
|
||||
<view>姓名:{{ securityNumberByIdCard.name ? securityNumberByIdCard.name : '无' }}</view>
|
||||
<view>姓名:{{ securityNumberByIdCard?.name ? securityNumberByIdCard.name : '无' }}</view>
|
||||
<view>保安证件号:{{ securityNumberByIdCard?.bayzh ? securityNumberByIdCard?.bayzh : '无' }}</view>
|
||||
<view>身份证:{{ securityNumberByIdCard?.sfzhm ? securityNumberByIdCard?.sfzhm : '无' }}</view>
|
||||
</view>
|
||||
</slot>
|
||||
</nut-dialog>
|
||||
<nut-popup v-model:visible="showBottom" position="bottom" :style="{ height: '40%' }">
|
||||
<nut-picker
|
||||
:columns="columns"
|
||||
:field-names="{
|
||||
text: 'label',
|
||||
value: 'value',
|
||||
children: 'extData'
|
||||
}"
|
||||
title="学历选择"
|
||||
@confirm="confirm"
|
||||
@cancel="showBottom = false"
|
||||
/>
|
||||
</nut-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { enumSelectNodes } from '@/enums'
|
||||
import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'
|
||||
import {ref} from 'vue'
|
||||
import {enumSelectNodes} from '@/enums'
|
||||
import {FormRules} from '@nutui/nutui-taro/dist/types/__VUE/form/types'
|
||||
import api from '@/request'
|
||||
import './securityUserForm.scss'
|
||||
import Taro, { useLoad } from '@tarojs/taro'
|
||||
import Taro, {useLoad} from '@tarojs/taro'
|
||||
import dayjs from 'dayjs'
|
||||
import { SecurityUserFormParams, securityNumberByIdCard } from '@/types/subPages/projectManager/securityUserForm'
|
||||
import { FormInstance } from '@nutui/nutui-taro'
|
||||
import { generateSimpleObjectName, getResignedObjectUrl } from '@/utils'
|
||||
import {SecurityUserFormParams, securityNumberByIdCard} from '@/types/subPages/projectManager/securityUserForm'
|
||||
import {FormInstance} from '@nutui/nutui-taro'
|
||||
import {generateSimpleObjectName, getResignedObjectUrl} from '@/utils'
|
||||
|
||||
const SEX:any = enumSelectNodes('Sex')
|
||||
const SEX: any = enumSelectNodes('Sex')
|
||||
const minioBaseUrl = process.env.TARO_APP_MINIO_URL
|
||||
const BUCKET = process.env.TARO_APP_MINIO_BUCKET
|
||||
const showPicker = ref(false)
|
||||
const showBottom = ref(false)
|
||||
const Url = ref('')
|
||||
const type = ref<'formInput' | 'QcCodeInput'>(null!)
|
||||
const formData = ref<SecurityUserFormParams>({} as any)
|
||||
|
@ -103,23 +122,37 @@ const visible = ref<boolean>(false)
|
|||
const securityNumberByIdCard = ref<securityNumberByIdCard | any>()
|
||||
const uploadRef = ref<any>(null)
|
||||
const modelValue = ref('')
|
||||
const columns: any = enumSelectNodes('EducationLevel')
|
||||
|
||||
|
||||
const rules: FormRules = {
|
||||
name: [{ required: true, message: '请输入姓名' }],
|
||||
sex: [{ required: true, message: '请选择性别' }],
|
||||
name: [{required: true, message: '请输入姓名'}],
|
||||
sex: [{required: true, message: '请选择性别'}],
|
||||
idCard: [
|
||||
{ required: true, message: '请输入身份证号' },
|
||||
{required: true, message: '请输入身份证号'},
|
||||
{
|
||||
regex: /^(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))((0[1-9])|([12][0-9])|(30|31))\d{3}(\d|X)$)/,
|
||||
message: '身份证格式错误',
|
||||
},
|
||||
],
|
||||
telephone: [{ required: true, message: '请输入手机号' }],
|
||||
telephone: [{required: true, message: '请输入手机号'}],
|
||||
educationLevel:[{required: true, message: '请选择文化程度'}]
|
||||
}
|
||||
|
||||
const educationLevelValue = ref('')
|
||||
// 文化程度
|
||||
const confirm = ({selectedOptions}) => {
|
||||
Object.keys(selectedOptions).forEach((item:any,index:number)=>{
|
||||
console.log(item)
|
||||
educationLevelValue.value = selectedOptions[index].label
|
||||
formData.value.educationLevel = selectedOptions[index].value
|
||||
})
|
||||
showBottom.value = false
|
||||
}
|
||||
useLoad((options) => {
|
||||
type.value = options.type
|
||||
if (type.value === 'QcCodeInput') {
|
||||
console.log(1111)
|
||||
formData.value = {
|
||||
name: '',
|
||||
serviceProjectId: options.pid,
|
||||
|
@ -130,13 +163,16 @@ useLoad((options) => {
|
|||
dateOfBirth: null,
|
||||
noSecurityNumberDesc: options.noSecurityNumberDesc,
|
||||
photo: '',
|
||||
educationLevel: ''
|
||||
}
|
||||
} else {
|
||||
const form = JSON.parse(options.securityUser)
|
||||
educationLevelValue.value = form.educationLevel.label
|
||||
formData.value = Object.assign({}, form, {
|
||||
idCard: form.idCard.originalValue,
|
||||
telephone: form.telephone.originalValue,
|
||||
photo: form.photo
|
||||
photo: form.photo,
|
||||
educationLevel: form.educationLevel.value
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -144,31 +180,31 @@ useLoad((options) => {
|
|||
const idCardBlur = async (e: any, num: number) => {
|
||||
const value = e.idCard
|
||||
if (value) {
|
||||
if(BUCKET === 'police-security-dev'){
|
||||
Taro.request({
|
||||
url: 'https://www.hnjinglian.cn:5678/common/querySecurityNumberByIdCard',
|
||||
data: {
|
||||
idCard: value,
|
||||
},
|
||||
method: 'GET',
|
||||
success: ({ data }) => {
|
||||
console.log(data.data)
|
||||
visible.value = true
|
||||
securityNumberByIdCard.value = data.data
|
||||
},
|
||||
})
|
||||
}else{
|
||||
const resp = await api.get('/common/querySecurityNumberByIdCard',{ idCard: value})
|
||||
visible.value = true
|
||||
securityNumberByIdCard.value = resp?.data
|
||||
}
|
||||
if (BUCKET === 'police-security-dev') {
|
||||
Taro.request({
|
||||
url: 'https://www.hnjinglian.cn:5678/common/querySecurityNumberByIdCard',
|
||||
data: {
|
||||
idCard: value,
|
||||
},
|
||||
method: 'GET',
|
||||
success: ({data}) => {
|
||||
console.log(data.data)
|
||||
visible.value = true
|
||||
securityNumberByIdCard.value = data.data
|
||||
},
|
||||
})
|
||||
} else {
|
||||
const resp = await api.get('/common/querySecurityNumberByIdCard', {idCard: value})
|
||||
visible.value = true
|
||||
securityNumberByIdCard.value = resp?.data
|
||||
}
|
||||
} else {
|
||||
visible.value = false
|
||||
}
|
||||
cardBlur(value, num)
|
||||
}
|
||||
|
||||
const cardBlur = (e:any, num:number) => {
|
||||
const cardBlur = (e: any, num: number) => {
|
||||
let value: string
|
||||
if (num === 0) {
|
||||
value = e
|
||||
|
@ -201,10 +237,10 @@ const chooseImage = () => {
|
|||
count: 1, // 选择一个文件
|
||||
mediaType: ['image', 'video'],
|
||||
sourceType: ['album', 'camera'],
|
||||
sizeType:['original', 'compressed'],
|
||||
sizeType: ['original', 'compressed'],
|
||||
camera: 'front',
|
||||
success: async (res) => {
|
||||
Url.value = res.tempFiles[0].tempFilePath
|
||||
Url.value = res.tempFiles[0].tempFilePath
|
||||
const objectName = generateSimpleObjectName(Url.value, '/securityUser')
|
||||
const uploadUrl = await getResignedObjectUrl(process.env.TARO_APP_MINIO_BUCKET, objectName)
|
||||
|
||||
|
@ -236,7 +272,7 @@ const chooseImage = () => {
|
|||
}
|
||||
const submit = () => {
|
||||
formData.value.photo = modelValue.value
|
||||
formRef.value?.validate().then(async ({ valid }) => {
|
||||
formRef.value?.validate().then(async ({valid}) => {
|
||||
if (valid) {
|
||||
let url: string
|
||||
if (type.value === 'formInput') {
|
||||
|
@ -244,6 +280,7 @@ const submit = () => {
|
|||
} else {
|
||||
url = '/mp/user/qrCodeFormInputSecurityUser'
|
||||
}
|
||||
console.log(formData.value)
|
||||
const resp = await api.post(url, formData.value)
|
||||
Taro.showToast({
|
||||
title: resp.message,
|
||||
|
@ -267,7 +304,9 @@ const submit = () => {
|
|||
homeAddress: '',
|
||||
noSecurityNumberDesc: '',
|
||||
photo: '',
|
||||
educationLevel: ''
|
||||
}
|
||||
educationLevelValue.value = ''
|
||||
uploadRef.value?.clearUploadQueue()
|
||||
}
|
||||
})
|
||||
|
|
|
@ -62,5 +62,9 @@ export interface ServiceProjectSecurityUserPagerVo {
|
|||
snowFlakeId: string;
|
||||
workPost?: string;
|
||||
sex: BaseEnum<number>
|
||||
educationLevel:{
|
||||
label:string,
|
||||
value:string
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@ export interface SecurityUserFormParams {
|
|||
photo?:string;
|
||||
remark?: string;
|
||||
noSecurityNumberDesc:string;
|
||||
homeAddress?: string
|
||||
homeAddress?: string;
|
||||
educationLevel:string
|
||||
}
|
||||
|
||||
export interface value{
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.changhu.common.db.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
import com.changhu.common.db.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/12/19 上午9:31
|
||||
* @desc EducationLevel...
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EducationLevel implements BaseEnum<String>, IEnum<String> {
|
||||
PRIMARY_SCHOOL("primary_school", "小学"),
|
||||
JUNIOR_SCHOOL("junior_school", "初中"),
|
||||
HIGH_SCHOOL("high_school", "高中"),
|
||||
COLLEGE("college", "大专"),
|
||||
UNDERGRADUATE("undergraduate", "本科"),
|
||||
UNDERGRADUATE_MORE("undergraduate_more", "本科以上"),
|
||||
;
|
||||
private final String value;
|
||||
private final String label;
|
||||
}
|
|
@ -68,4 +68,11 @@ public class OpenController {
|
|||
return openApiService.securityUserRoster(id, type);
|
||||
}
|
||||
|
||||
@Operation(summary = "单位下的安保人员花名册")
|
||||
@GetMapping("/unitSecurityUserRoster")
|
||||
public List<SecurityUserRosterDTO> unitSecurityUserRoster(@Schema(description = "代码") @RequestParam String code,
|
||||
@Schema(description = "等级") @RequestParam Integer level) {
|
||||
return openApiService.unitSecurityUserRoster(code, level);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,4 +51,9 @@ public interface OpenApiMapper {
|
|||
*/
|
||||
List<SecurityUserRosterDTO> securityUserRoster(@Param("id") Long id,
|
||||
@Param("type") EnterprisesUnitOrServiceProjectType type);
|
||||
|
||||
/**
|
||||
* 单位下的服务人员花名册
|
||||
*/
|
||||
List<SecurityUserRosterDTO> unitSecurityUserRoster(String code, Integer level);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.changhu.module.miniProgram.pojo.params;
|
||||
|
||||
import com.changhu.common.db.enums.EducationLevel;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import com.changhu.common.validator.annotation.IdCard;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -66,4 +67,8 @@ public class SecurityUserSaveOrUpdateParams {
|
|||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@NotNull(message = "文化程度为必选")
|
||||
@Schema(description = "文化程度")
|
||||
private EducationLevel educationLevel;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,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.EducationLevel;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
@ -63,6 +64,9 @@ public class ServiceProjectSecurityUserPagerVo {
|
|||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "文化程度")
|
||||
private EducationLevel educationLevel;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,8 @@ public class SecurityUnitUseStatisticsDTO {
|
|||
|
||||
@Schema(description = "公安单位id")
|
||||
private Long policeUnitId;
|
||||
@Schema(description = "公安代为代码")
|
||||
private String policeUnitCode;
|
||||
@Schema(description = "公安单位名称")
|
||||
private String policeUnitName;
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package com.changhu.pojo.dto;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.changhu.common.annotation.Desensitized;
|
||||
import com.changhu.common.db.enums.EducationLevel;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import com.changhu.support.fastjson2.serializer.MinioPrefixSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -15,6 +18,9 @@ import lombok.Data;
|
|||
public class SecurityUserRosterDTO {
|
||||
@Schema(description = "id")
|
||||
private Long snowFlakeId;
|
||||
@Schema(description = "照片")
|
||||
@JSONField(serializeUsing = MinioPrefixSerializer.class)
|
||||
private String photo;
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
@Schema(description = "性别")
|
||||
|
@ -33,4 +39,6 @@ public class SecurityUserRosterDTO {
|
|||
private String securityUnitName;
|
||||
@Schema(description = "保安证号")
|
||||
private String securityNumber;
|
||||
@Schema(description = "文化程度")
|
||||
private EducationLevel educationLevel;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.changhu.pojo.dto;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.changhu.common.db.enums.EducationLevel;
|
||||
import com.changhu.common.db.enums.ServiceProjectType;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import com.changhu.pojo.model.LegalPersonInfo;
|
||||
|
@ -81,6 +82,9 @@ public class ServiceProjectDTO {
|
|||
static class SecurityUserInfo {
|
||||
@Schema(description = "id")
|
||||
private Long snowFlakeId;
|
||||
@JSONField(serializeUsing = MinioPrefixSerializer.class)
|
||||
@Schema(description = "照片")
|
||||
private String photo;
|
||||
@Schema(description = "名字")
|
||||
private String name;
|
||||
@Schema(description = "手机号")
|
||||
|
@ -103,5 +107,7 @@ public class ServiceProjectDTO {
|
|||
private String remark;
|
||||
@Schema(description = "创建时间")
|
||||
private String createTime;
|
||||
@Schema(description = "文化程度")
|
||||
private EducationLevel educationLevel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.changhu.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.changhu.common.db.enums.EducationLevel;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -99,5 +100,9 @@ public class SecurityUser extends BaseEntity implements Serializable {
|
|||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 文化程度
|
||||
*/
|
||||
private EducationLevel educationLevel;
|
||||
|
||||
}
|
||||
|
|
|
@ -56,4 +56,9 @@ public interface OpenApiService {
|
|||
* @return 花名册
|
||||
*/
|
||||
List<SecurityUserRosterDTO> securityUserRoster(Long id, EnterprisesUnitOrServiceProjectType type);
|
||||
|
||||
/**
|
||||
* 单位下的安保人员花名册
|
||||
*/
|
||||
List<SecurityUserRosterDTO> unitSecurityUserRoster(String code, Integer level);
|
||||
}
|
||||
|
|
|
@ -123,4 +123,10 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|||
public List<SecurityUserRosterDTO> securityUserRoster(Long id, EnterprisesUnitOrServiceProjectType type) {
|
||||
return openApiMapper.securityUserRoster(id, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SecurityUserRosterDTO> unitSecurityUserRoster(String code, Integer level) {
|
||||
return openApiMapper.unitSecurityUserRoster(code, level);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.changhu.support.fastjson2.serializer;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.alibaba.fastjson2.JSONWriter;
|
||||
import com.alibaba.fastjson2.writer.ObjectWriter;
|
||||
|
@ -22,6 +23,9 @@ public class MinioPrefixSerializer implements ObjectWriter<String> {
|
|||
|
||||
@Override
|
||||
public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {
|
||||
jsonWriter.writeString(minioPrefix + object);
|
||||
if (object instanceof String path && StrUtil.isNotEmpty(path)) {
|
||||
jsonWriter.writeString(minioPrefix + object);
|
||||
}
|
||||
jsonWriter.writeNull();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,42 +43,43 @@
|
|||
property="securityUserList" />
|
||||
</resultMap>
|
||||
<select id="getServiceProjectByEnterprisesUnitId" resultMap="ServiceProjectDTOResultMap">
|
||||
SELECT
|
||||
sp.*,
|
||||
IF(mpu.snow_flake_id IS NOT NULL,json_object( 'name', mpu.NAME, 'sex', mpu.sex, 'telephone', mpu.telephone, 'idCard', mpu.id_card ),NULL) AS 'projectManagerInfo',
|
||||
json_object(
|
||||
'name',su1.name,
|
||||
'socialCode',su1.social_code,
|
||||
'businessLicense',su1.business_license,
|
||||
'legalPersonInfo',su1.legal_person_info,
|
||||
'address',su1.address,
|
||||
'nature',su1.nature
|
||||
) as 'securityUnitInfo',
|
||||
if(COUNT(su.snow_flake_id)>0,JSON_ARRAYAGG(json_object(
|
||||
'snowFlakeId',su.snow_flake_id,
|
||||
'name',su.name,
|
||||
'telephone',su.telephone,
|
||||
'workPost',su.work_post,
|
||||
'sex',su.sex,
|
||||
'nativePlace',su.native_place,
|
||||
'idCard',su.id_card,
|
||||
'dateOfBirth',su.date_of_birth,
|
||||
'securityNumber',su.security_number,
|
||||
'homeAddress',su.home_address,
|
||||
'remark',su.remark,
|
||||
'createTime',su.create_time
|
||||
)),JSON_ARRAY()) as 'securityUserList'
|
||||
FROM
|
||||
service_project sp
|
||||
left join security_unit su1 on sp.security_unit_id = su1.snow_flake_id
|
||||
LEFT JOIN mini_program_user mpu ON sp.project_manager_mini_program_user_id = mpu.snow_flake_id AND mpu.identity = 'project_manager'
|
||||
left join security_user su on su.service_project_id = sp.snow_flake_id and su.delete_flag = 0
|
||||
WHERE
|
||||
sp.delete_flag = 0
|
||||
SELECT sp.*,
|
||||
IF(mpu.snow_flake_id IS NOT NULL,
|
||||
json_object('name', mpu.NAME, 'sex', mpu.sex, 'telephone', mpu.telephone, 'idCard', mpu.id_card),
|
||||
NULL) AS 'projectManagerInfo',
|
||||
json_object(
|
||||
'name', su1.name,
|
||||
'socialCode', su1.social_code,
|
||||
'businessLicense', su1.business_license,
|
||||
'legalPersonInfo', su1.legal_person_info,
|
||||
'address', su1.address,
|
||||
'nature', su1.nature
|
||||
) as 'securityUnitInfo',
|
||||
if(COUNT(su.snow_flake_id) > 0, JSON_ARRAYAGG(json_object(
|
||||
'snowFlakeId', su.snow_flake_id,
|
||||
'photo', su.photo,
|
||||
'name', su.name,
|
||||
'telephone', su.telephone,
|
||||
'workPost', su.work_post,
|
||||
'sex', su.sex,
|
||||
'nativePlace', su.native_place,
|
||||
'idCard', su.id_card,
|
||||
'dateOfBirth', su.date_of_birth,
|
||||
'securityNumber', su.security_number,
|
||||
'homeAddress', su.home_address,
|
||||
'remark', su.remark,
|
||||
'educationLevel', su.education_level,
|
||||
'createTime', su.create_time
|
||||
)), JSON_ARRAY()) as 'securityUserList'
|
||||
FROM service_project sp
|
||||
left join security_unit su1 on sp.security_unit_id = su1.snow_flake_id
|
||||
LEFT JOIN mini_program_user mpu ON sp.project_manager_mini_program_user_id = mpu.snow_flake_id AND
|
||||
mpu.identity = 'project_manager'
|
||||
left join security_user su on su.service_project_id = sp.snow_flake_id and su.delete_flag = 0
|
||||
WHERE sp.delete_flag = 0
|
||||
AND sp.enterprises_unit_id = #{enterprisesUnitId}
|
||||
group by sp.snow_flake_id
|
||||
ORDER BY
|
||||
sp.create_time DESC
|
||||
ORDER BY sp.create_time DESC
|
||||
</select>
|
||||
<resultMap id="SecurityUnitUseStatisticsDTOResultMap" type="com.changhu.pojo.dto.SecurityUnitUseStatisticsDTO">
|
||||
<result
|
||||
|
@ -109,6 +110,7 @@
|
|||
ad4.name as 'streetName',
|
||||
eu.address as 'address',
|
||||
pu.snow_flake_id as 'policeUnitId',
|
||||
pu.code as 'policeUnitCode',
|
||||
pu.name as 'policeUnitName',
|
||||
json_arrayagg(
|
||||
json_object(
|
||||
|
@ -166,9 +168,11 @@
|
|||
select su.snow_flake_id,
|
||||
su.name,
|
||||
su.sex,
|
||||
su.photo,
|
||||
TIMESTAMPDIFF(YEAR, su.date_of_birth, CURDATE()) AS 'age',
|
||||
su.id_card,
|
||||
su.telephone,
|
||||
su.education_level,
|
||||
eu.name as 'enterprisesUnitName',
|
||||
suu.name as 'securityUnitName',
|
||||
su.security_number
|
||||
|
@ -190,4 +194,42 @@
|
|||
</choose>
|
||||
order by su.create_time desc
|
||||
</select>
|
||||
<select id="unitSecurityUserRoster" resultType="com.changhu.pojo.dto.SecurityUserRosterDTO">
|
||||
select su.snow_flake_id,
|
||||
su.name,
|
||||
su.sex,
|
||||
su.photo,
|
||||
TIMESTAMPDIFF(YEAR, su.date_of_birth, CURDATE()) AS 'age',
|
||||
su.id_card,
|
||||
su.telephone,
|
||||
su.education_level,
|
||||
eu.name as 'enterprisesUnitName',
|
||||
suu.name as 'securityUnitName',
|
||||
su.security_number
|
||||
from enterprises_unit eu
|
||||
LEFT join police_unit pu on eu.police_unit_id = pu.snow_flake_id and pu.delete_flag = 0
|
||||
LEFT JOIN service_project sp ON sp.enterprises_unit_id = eu.snow_flake_id AND sp.delete_flag = 0
|
||||
JOIN security_user su ON su.service_project_id = sp.snow_flake_id AND su.delete_flag = 0
|
||||
LEFT JOIN security_unit suu ON su.security_unit_id = suu.snow_flake_id AND suu.delete_flag = 0
|
||||
where eu.delete_flag = 0
|
||||
<choose>
|
||||
<when test="level==1">
|
||||
and eu.province = #{code}
|
||||
</when>
|
||||
<when test="level==2">
|
||||
and eu.city = #{code}
|
||||
</when>
|
||||
<when test="level==3">
|
||||
and eu.districts = #{code}
|
||||
</when>
|
||||
<when test="level==4">
|
||||
and eu.street = #{code}
|
||||
</when>
|
||||
<when test="level==5">
|
||||
and pu.code = #{code}
|
||||
</when>
|
||||
<otherwise>and eu.snow_flake_id = -1</otherwise>
|
||||
</choose>
|
||||
order by su.create_time desc
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue