提交代码

dev_xds
姜玉琦 2023-08-16 20:40:54 +08:00
parent f24b2e3a77
commit 722633ea2e
26 changed files with 1124 additions and 124 deletions

View File

@ -80,7 +80,7 @@ public class SysRegisterService
boolean regFlag = userService.registerUser(sysUser);
if (!regFlag)
{
msg = "注册失败,请联系系统理人员";
msg = "注册失败,请联系系统理人员";
}
else
{

View File

@ -9,10 +9,19 @@ export function listSurProjectInsurance(query) {
})
}
// 查询项目保险详细
export function getSurProjectInsurance(projectId) {
// 查询项目保险列表
export function listSurProjectInsurancev2(query) {
return request({
url: '/project/surProjectInsurance/' + projectId,
url: '/project/surProjectInsurance/listv2',
method: 'get',
params: query
})
}
// 查询项目保险详细
export function getSurProjectInsurance(id) {
return request({
url: '/project/surProjectInsurance/' + id,
method: 'get'
})
}
@ -36,9 +45,9 @@ export function updateSurProjectInsurance(data) {
}
// 删除项目保险
export function delSurProjectInsurance(projectId) {
export function delSurProjectInsurance(id) {
return request({
url: '/project/surProjectInsurance/' + projectId,
url: '/project/surProjectInsurance/' + id,
method: 'delete'
})
}

View File

@ -75,7 +75,7 @@
<el-table-column label="项目主键" align="center" prop="projectId" />
<el-table-column label="部门主键" align="center" prop="deptId" />
<el-table-column label="劳务人员" align="center" prop="servicePersonnel" />
<el-table-column label="理人员" align="center" prop="supervisorPersonnel" />
<el-table-column label="理人员" align="center" prop="supervisorPersonnel" />
<el-table-column label="总包人员" align="center" prop="contractorPersonnel" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -97,7 +97,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -118,8 +118,8 @@
<el-form-item label="劳务人员" prop="servicePersonnel">
<el-input v-model="form.servicePersonnel" placeholder="请输入劳务人员" />
</el-form-item>
<el-form-item label="理人员" prop="supervisorPersonnel">
<el-input v-model="form.supervisorPersonnel" placeholder="请输入理人员" />
<el-form-item label="理人员" prop="supervisorPersonnel">
<el-input v-model="form.supervisorPersonnel" placeholder="请输入理人员" />
</el-form-item>
<el-form-item label="总包人员" prop="contractorPersonnel">
<el-input v-model="form.contractorPersonnel" placeholder="请输入总包人员" />

View File

@ -28,13 +28,13 @@
label="请输入劳务人员"
></el-input-number>
</el-form-item>
<el-form-item label="理人员" prop="supervisorPersonnel">
<el-form-item label="理人员" prop="supervisorPersonnel">
<el-input-number
style="width: 80%"
v-model="form.supervisorPersonnel"
:min="0"
:max="10000"
label="请输入理人员"
label="请输入理人员"
></el-input-number>
</el-form-item>
<el-form-item label="总包人员" prop="contractorPersonnel">
@ -47,7 +47,7 @@
></el-input-number>
</el-form-item>
</el-form>
<div style="text-align: center">
<div style="text-align: center" v-if="isUnit">
<el-button type="primary" @click="doOk"></el-button>
<el-button @click="doCanel"></el-button>
</div>
@ -69,6 +69,7 @@ export default {
isOpen: false,
project: null,
title: "",
isUnit: true,
nodes: [],
form: {
oldServicePersonnel: 0,
@ -95,6 +96,9 @@ export default {
this.isOpen = false;
},
show(project) {
this.form.servicePersonnel = 0;
this.form.supervisorPersonnel = 0;
this.form.contractorPersonnel = 0;
this.project = project;
this.title = project.projectName;
this.isOpen = true;
@ -103,9 +107,13 @@ export default {
unitType: 2,
}).then((d) => {
this.nodes = d.rows;
if (this.nodes.length > 0) {
if (d.rows.length > 0) {
this.activeName = this.nodes[0].unitId + "";
this.isUnit = true;
this.loadData();
} else {
this.$message.error("当前项目未分配总包单位,不能维护在册人员");
this.isUnit = false;
}
});
},

View File

@ -400,6 +400,12 @@
v-hasPermi="['work:emergencyDrill:list']"
>项目应急演练</el-dropdown-item
>
<el-dropdown-item
command="handleProjectInsurance"
icon="el-icon-star-on"
v-hasPermi="['project:surProjectInsurance:list']"
>项目保险管理</el-dropdown-item
>
<el-dropdown-item
command="handleProjectSpecial"
icon="el-icon-user"
@ -747,6 +753,7 @@
></surProjectSpecialDrawer>
<attendance-drawer ref="attDrawer"></attendance-drawer>
<projectDeptWroksDrawer ref="deptWroksDrawer"></projectDeptWroksDrawer>
<insuranceDrawer ref="insurance"></insuranceDrawer>
</div>
</template>
@ -770,6 +777,7 @@ import emergencyDrillDrawer from "../../work/emergencyDrill/emergencyDrillDrawer
import surProjectSpecialDrawer from "../surProjectSpecial/surProjectSpecialDrawer.vue";
import attendanceDrawer from "../surProjectAttendance/attendanceDrawer.vue";
import projectDeptWroksDrawer from "../projectDeptWroks/projectDeptWroksDrawer.vue";
import insuranceDrawer from "../surProjectInsurance/insuranceDrawer.vue";
export default {
name: "SurProject",
@ -784,6 +792,7 @@ export default {
emergencyDrillDrawer,
surProjectSpecialDrawer,
projectDeptWroksDrawer,
insuranceDrawer,
},
dicts: [
"sys_check_state",
@ -1017,6 +1026,9 @@ export default {
case "handleProjectAttendance":
this.$refs.attDrawer.show(row);
break;
case "handleProjectInsurance":
this.$refs.insurance.show(row);
break;
default:
break;
}

View File

@ -33,7 +33,7 @@
><i slot="suffix"></i></el-input
>
</el-form-item>
<el-form-item label="在册理人员" prop="supervisorPersonnel">
<el-form-item label="在册理人员" prop="supervisorPersonnel">
<el-input
style="width: 80%"
v-model="vform.supervisorPersonnel"
@ -59,13 +59,13 @@
label="请输入劳务人员"
></el-input-number>
</el-form-item>
<el-form-item label="理人员" prop="supervisorPersonnel">
<el-form-item label="理人员" prop="supervisorPersonnel">
<el-input-number
style="width: 80%"
v-model="form.supervisorPersonnel"
:min="0"
:max="vform.supervisorPersonnel"
label="请输入理人员"
label="请输入理人员"
></el-input-number>
</el-form-item>
<el-form-item label="总包人员" prop="contractorPersonnel">
@ -78,7 +78,7 @@
></el-input-number>
</el-form-item>
</el-form>
<div style="text-align: center">
<div style="text-align: center" v-if="isUnit">
<el-button type="primary" @click="doOk"></el-button>
<el-button @click="doCanel"></el-button>
</div>
@ -106,6 +106,7 @@ export default {
project: null,
title: "",
nodes: [],
isUnit: true,
vform: {
servicePersonnel: 0,
supervisorPersonnel: 0,
@ -128,17 +129,22 @@ export default {
methods: {
doOk() {
updateSurProjectAttendance(this.form).then((response) => {
this.$modal.msgSuccess("保存成功");
this.isOpen = false;
if (response.code == 200) {
this.$modal.msgSuccess("保存成功");
this.isOpen = false;
} else {
this.$message.error("操作失败,数据异常!请稍后再试!!!");
this.isOpen = false;
}
});
},
doCanel() {
this.isOpen = false;
},
show(project) {
this.form.servicePersonnel = null;
this.form.supervisorPersonnel = null;
this.form.contractorPersonnel = null;
this.form.servicePersonnel = 0;
this.form.supervisorPersonnel = 0;
this.form.contractorPersonnel = 0;
this.project = project;
this.title = project.projectName;
this.isOpen = true;
@ -149,7 +155,13 @@ export default {
this.nodes = d1.rows;
if (this.nodes.length > 0) {
this.activeName = this.nodes[0].unitId + "";
this.isUnit = true;
this.loadData();
} else {
this.$message.error(
"当前项目未分配总包单位,未登记在册人员,今日出勤数据不能维护!"
);
this.isUnit = false;
}
});
},

View File

@ -96,7 +96,7 @@
<el-table-column label="项目主键" align="center" prop="projectId" />
<el-table-column label="部门主键" align="center" prop="deptId" />
<el-table-column label="劳务人员" align="center" prop="servicePersonnel" />
<el-table-column label="理人员" align="center" prop="supervisorPersonnel" />
<el-table-column label="理人员" align="center" prop="supervisorPersonnel" />
<el-table-column label="总包人员" align="center" prop="contractorPersonnel" />
<el-table-column label="工作时间" align="center" prop="workDate" width="180">
<template slot-scope="scope">
@ -149,8 +149,8 @@
<el-form-item label="劳务人员" prop="servicePersonnel">
<el-input v-model="form.servicePersonnel" placeholder="请输入劳务人员" />
</el-form-item>
<el-form-item label="理人员" prop="supervisorPersonnel">
<el-input v-model="form.supervisorPersonnel" placeholder="请输入理人员" />
<el-form-item label="理人员" prop="supervisorPersonnel">
<el-input v-model="form.supervisorPersonnel" placeholder="请输入理人员" />
</el-form-item>
<el-form-item label="总包人员" prop="contractorPersonnel">
<el-input v-model="form.contractorPersonnel" placeholder="请输入总包人员" />

View File

@ -1,18 +1,60 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="安责险" prop="azxInsurance">
<el-form-item label="项目主键" prop="projectId">
<el-input
v-model="queryParams.azxInsurance"
placeholder="请输入安责险"
v-model="queryParams.projectId"
placeholder="请输入项目主键"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="一切险" prop="yqxInsurance">
<el-form-item label="部门主键" prop="deptId">
<el-input
v-model="queryParams.yqxInsurance"
placeholder="请输入一切险"
v-model="queryParams.deptId"
placeholder="请输入部门主键"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="保险类型" prop="insuranceType">
<el-select v-model="queryParams.insuranceType" placeholder="请选择保险类型" clearable>
<el-option
v-for="dict in dict.type.sur_project_insurance_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="保保单号" prop="insuranceNumber">
<el-input
v-model="queryParams.insuranceNumber"
placeholder="请输入保保单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="保险状态" prop="insuranceState">
<el-input
v-model="queryParams.insuranceState"
placeholder="请输入保险状态"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="保险公司" prop="companyName">
<el-input
v-model="queryParams.companyName"
placeholder="请输入保险公司"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数据状态" prop="isDel">
<el-input
v-model="queryParams.isDel"
placeholder="请输入数据状态"
clearable
@keyup.enter.native="handleQuery"
/>
@ -71,9 +113,34 @@
<el-table v-loading="loading" :data="surProjectInsuranceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="项目主键" align="center" prop="projectId" />
<el-table-column label="安责险" align="center" prop="azxInsurance" />
<el-table-column label="一切险" align="center" prop="yqxInsurance" />
<el-table-column label="部门主键" align="center" prop="deptId" />
<el-table-column label="保险类型" align="center" prop="insuranceType">
<template slot-scope="scope">
<dict-tag :options="dict.type.sur_project_insurance_type" :value="scope.row.insuranceType"/>
</template>
</el-table-column>
<el-table-column label="保保单号" align="center" prop="insuranceNumber" />
<el-table-column label="保险文书" align="center" prop="insuranceFile" />
<el-table-column label="保险状态" align="center" prop="insuranceState" />
<el-table-column label="保险生效时间" align="center" prop="beginDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.beginDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="保险截至时间" align="center" prop="endDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="保险公司" align="center" prop="companyName" />
<el-table-column label="数据状态" align="center" prop="isDel">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -105,11 +172,52 @@
<!-- 添加或修改项目保险对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="安责险" prop="azxInsurance">
<el-input v-model="form.azxInsurance" placeholder="请输入安责险" />
<el-form-item label="部门主键" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入部门主键" />
</el-form-item>
<el-form-item label="一切险" prop="yqxInsurance">
<el-input v-model="form.yqxInsurance" placeholder="请输入一切险" />
<el-form-item label="保险类型" prop="insuranceType">
<el-select v-model="form.insuranceType" placeholder="请选择保险类型">
<el-option
v-for="dict in dict.type.sur_project_insurance_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="保保单号" prop="insuranceNumber">
<el-input v-model="form.insuranceNumber" placeholder="请输入保保单号" />
</el-form-item>
<el-form-item label="保险文书" prop="insuranceFile">
<file-upload v-model="form.insuranceFile"/>
</el-form-item>
<el-form-item label="保险状态" prop="insuranceState">
<el-input v-model="form.insuranceState" placeholder="请输入保险状态" />
</el-form-item>
<el-form-item label="保险生效时间" prop="beginDate">
<el-date-picker clearable
v-model="form.beginDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择保险生效时间">
</el-date-picker>
</el-form-item>
<el-form-item label="保险截至时间" prop="endDate">
<el-date-picker clearable
v-model="form.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择保险截至时间">
</el-date-picker>
</el-form-item>
<el-form-item label="保险公司" prop="companyName">
<el-input v-model="form.companyName" placeholder="请输入保险公司" />
</el-form-item>
<el-form-item label="数据状态" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入数据状态" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -125,6 +233,7 @@ import { listSurProjectInsurance, getSurProjectInsurance, delSurProjectInsurance
export default {
name: "SurProjectInsurance",
dicts: ['sur_project_insurance_type'],
data() {
return {
//
@ -149,13 +258,25 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
azxInsurance: null,
yqxInsurance: null
projectId: null,
deptId: null,
insuranceType: null,
insuranceNumber: null,
insuranceFile: null,
insuranceState: null,
companyName: null,
isDel: null,
},
//
form: {},
//
rules: {
projectId: [
{ required: true, message: "项目主键不能为空", trigger: "blur" }
],
deptId: [
{ required: true, message: "部门主键不能为空", trigger: "blur" }
],
}
};
},
@ -180,9 +301,22 @@ export default {
//
reset() {
this.form = {
id: null,
projectId: null,
azxInsurance: null,
yqxInsurance: null
deptId: null,
insuranceType: null,
insuranceNumber: null,
insuranceFile: null,
insuranceState: null,
beginDate: null,
endDate: null,
companyName: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
@ -198,7 +332,7 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.projectId)
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
@ -211,8 +345,8 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const projectId = row.projectId || this.ids
getSurProjectInsurance(projectId).then(response => {
const id = row.id || this.ids
getSurProjectInsurance(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改项目保险";
@ -222,7 +356,7 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.projectId != null) {
if (this.form.id != null) {
updateSurProjectInsurance(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
@ -240,9 +374,9 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const projectIds = row.projectId || this.ids;
this.$modal.confirm('是否确认删除项目保险编号为"' + projectIds + '"的数据项?').then(function() {
return delSurProjectInsurance(projectIds);
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除项目保险编号为"' + ids + '"的数据项?').then(function() {
return delSurProjectInsurance(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");

View File

@ -0,0 +1,376 @@
<template>
<div class="projectect-attendance-drawer">
<el-drawer
v-if="isOpen"
:visible.sync="isOpen"
direction="rtl"
size="50%"
style="padding-left: 20px"
>
<template slot="title">
<div>{{ title + " 【项目保险管理】" }}</div>
</template>
<el-tabs v-model="activeName" style="padding-left: 20px" @tab-click="getList">
<el-tab-pane
v-for="(it, idx) in nodes"
:label="it.unitName + ''"
:name="it.unitId + ''"
:key="idx"
></el-tab-pane>
</el-tabs>
<el-row
:gutter="10"
class="mb8"
style="margin-left: 25px; margin-top: 10px; margin-right: 0px"
>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['project:surProjectUserInfo:add']"
>办理保险</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="surProjectInsuranceList">
<el-table-column label="保险类型" align="center" prop="insuranceTypeName" />
<el-table-column label="保险状态" align="center" prop="insuranceState">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sur_project_insurance_state"
:value="scope.row.insuranceState"
/>
</template>
</el-table-column>
<el-table-column label="保险公司" align="center" prop="companyName" />
<el-table-column label="保保单号" align="center" prop="insuranceNumber" />
<el-table-column label="办理时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, "{y}-{m}-{d} {H}:{i}") }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.insuranceState == 1"
size="mini"
type="text"
icon="el-icon-link"
@click="handleDownload(scope.row)"
v-hasPermi="['project:surProjectInsurance:edit']"
>保险合同</el-button
>
<el-button
v-if="scope.row.insuranceState == 1"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['project:surProjectInsurance:edit']"
>修改</el-button
>
<el-button
v-if="scope.row.insuranceState == 1"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['project:surProjectInsurance:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改项目保险对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="项目名称" prop="projectName">
<el-input
v-model="form.projectName"
placeholder="请输入项目名称"
:disabled="true"
/>
</el-form-item>
<el-form-item label="部门名称" prop="deptName">
<el-input
v-model="form.deptName"
placeholder="请输入部门名称"
:disabled="true"
/>
</el-form-item>
<el-form-item label="保险类型" prop="insuranceType">
<el-select
v-model="form.insuranceType"
placeholder="请选择保险类型"
style="width: 100%"
>
<el-option
v-for="dict in dict.type.sur_project_insurance_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="保险公司" prop="companyName">
<el-input v-model="form.companyName" placeholder="请输入保险公司" />
</el-form-item>
<el-form-item label="保保单号" prop="insuranceNumber">
<el-input v-model="form.insuranceNumber" placeholder="请输入保保单号" />
</el-form-item>
<el-form-item label="保险合同" prop="insuranceFile">
<file-upload v-model="form.insuranceFile" :limit="1" :fileType="['pdf']" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</el-drawer>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { unitList } from "@/api/project/projectDeptWroks";
import {
listSurProjectInsurance,
listSurProjectInsurancev2,
getSurProjectInsurance,
delSurProjectInsurance,
addSurProjectInsurance,
updateSurProjectInsurance,
} from "@/api/project/surProjectInsurance";
export default {
name: "RuoyiUiProjectDeptWroksDrawer",
dicts: ["sur_project_insurance_type", "sur_project_insurance_state"],
data() {
return {
open: false,
isOpen: false,
project: null,
title: "",
isUnit: true,
nodes: [],
form: {},
rules: {
insuranceType: [{ required: true, message: "请选择保险类型", trigger: "blur" }],
companyName: [
{ required: true, message: "请选择所属单位", trigger: "blur" },
{ max: 20, message: "请输入", trigger: "blur" },
],
jobType: [{ required: true, message: "请选择职务类型", trigger: "blur" }],
userIds: [{ required: true, message: "请选择项目人员", trigger: "blur" }],
},
surProjectInsuranceList: [],
activeName: "",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: null,
nowDept: null,
},
};
},
computed: {
...mapGetters(["dept"]),
},
mounted() {},
methods: {
doOk() {
updateProjectDeptWroks(this.form).then((response) => {
this.$modal.msgSuccess("保存成功");
this.isOpen = false;
});
},
doCanel() {
this.isOpen = false;
},
show(project) {
this.project = project;
this.title = project.projectName;
this.isOpen = true;
this.queryParams.projectId = project.id;
unitList({
projectId: project.id,
unitType: 2,
}).then((d) => {
this.nodes = d.rows;
if (d.rows.length > 0) {
this.activeName = this.nodes[0].unitId + "";
this.isUnit = true;
this.getList();
} else {
this.$message.error("当前项目未分配总包单位,不能办理保险!");
this.isUnit = false;
}
});
},
//
getList() {
this.queryParams.nowDept = this.activeName;
this.loading = true;
listSurProjectInsurancev2(this.queryParams).then((response) => {
this.surProjectInsuranceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
projectId: null,
deptId: null,
insuranceType: null,
insuranceNumber: null,
insuranceFile: null,
insuranceState: null,
beginDate: null,
endDate: null,
companyName: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
if (this.nodes.length > 0) {
this.reset();
this.form.projectId = this.project.id;
this.form.projectName = this.project.projectName;
this.form.deptId = this.activeName;
this.nodes.forEach((item) => {
if (item.unitId == this.activeName) {
this.form.deptName = item.unitName;
}
});
this.open = true;
this.title = "添加项目保险";
} else {
this.$message.error("当前项目未分配总包单位,不能办理保险!");
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getSurProjectInsurance(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改项目保险";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateSurProjectInsurance(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSurProjectInsurance(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除项目保险编号为"' + ids + '"的数据项?')
.then(function () {
return delSurProjectInsurance(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"project/surProjectInsurance/export",
{
...this.queryParams,
},
`surProjectInsurance_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,73 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.yanzhu.jh.project.domain.SurProjectDeptWroks;
import com.yanzhu.jh.project.domain.SurProjectWorkAttendance;
import com.yanzhu.jh.project.service.ISurProjectDeptWroksService;
import com.yanzhu.jh.project.service.ISurProjectWorkAttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* Conller
*/
@RestController
@RequestMapping("/bgscreen/attendance")
public class ProjectAttendanceController extends BaseController {
@Autowired
ISurProjectWorkAttendanceService surProjectWorkAttendanceService;
@Autowired
ISurProjectDeptWroksService surProjectDeptWroksService;
/**
*
* @param deptId
* @param projectId
* @return
*/
@GetMapping("/getDeptWorksList")
public TableDataInfo getDeptWorksList(String deptId,String projectId){
SurProjectDeptWroks surProjectDeptWroks = new SurProjectDeptWroks();
if(StringUtils.isNotBlank(deptId) && !"0".equals(deptId)){
surProjectDeptWroks.setDeptId(Convert.toLong(deptId));
}
if(StringUtils.isNotBlank(projectId) && !"0".equals(projectId)){
surProjectDeptWroks.setProjectId(Convert.toLong(projectId));
}
return getDataTable(surProjectDeptWroksService.selectBgscreenDeptWroksList(surProjectDeptWroks));
}
/**
*
* @param deptId
* @param projectId
* @param date
* @return
*/
@GetMapping("/getWorkAttendanceList")
public TableDataInfo getWorkAttendanceList(String deptId,String projectId,String date){
SurProjectWorkAttendance surProjectWorkAttendance = new SurProjectWorkAttendance();
if(StringUtils.isNotBlank(deptId) && !"0".equals(deptId)){
surProjectWorkAttendance.setDeptId(Convert.toLong(deptId));
}
if(StringUtils.isNotBlank(projectId) && !"0".equals(projectId)){
surProjectWorkAttendance.setProjectId(Convert.toLong(projectId));
}
if(StringUtils.isNotBlank(date)){
surProjectWorkAttendance.setWorkDate(DateUtils.parseDate(date));
}else{
surProjectWorkAttendance.setWorkDate(new Date());
}
return getDataTable(surProjectWorkAttendanceService.selectBgscreenWorkAttendanceList(surProjectWorkAttendance));
}
}

View File

@ -25,7 +25,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* Controller
*
* @author JiangYuQi
* @date 2023-08-09
* @date 2023-08-16
*/
@RestController
@RequestMapping("/project/surProjectInsurance")
@ -46,6 +46,18 @@ public class SurProjectInsuranceController extends BaseController
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:surProjectInsurance:list')")
@GetMapping("/listv2")
public TableDataInfo listv2(SurProjectInsurance surProjectInsurance)
{
startPage();
List<SurProjectInsurance> list = surProjectInsuranceService.selectSurProjectInsuranceListv2(surProjectInsurance);
return getDataTable(list);
}
/**
*
*/
@ -63,10 +75,10 @@ public class SurProjectInsuranceController extends BaseController
*
*/
@PreAuthorize("@ss.hasPermi('project:surProjectInsurance:query')")
@GetMapping(value = "/{projectId}")
public AjaxResult getInfo(@PathVariable("projectId") Long projectId)
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(surProjectInsuranceService.selectSurProjectInsuranceByProjectId(projectId));
return success(surProjectInsuranceService.selectSurProjectInsuranceById(id));
}
/**
@ -96,9 +108,9 @@ public class SurProjectInsuranceController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('project:surProjectInsurance:remove')")
@Log(title = "项目保险", businessType = BusinessType.DELETE)
@DeleteMapping("/{projectIds}")
public AjaxResult remove(@PathVariable Long[] projectIds)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(surProjectInsuranceService.deleteSurProjectInsuranceByProjectIds(projectIds));
return toAjax(surProjectInsuranceService.deleteSurProjectInsuranceByIds(ids));
}
}

View File

@ -34,14 +34,18 @@ public class SurProjectDeptWroks extends BaseEntity
@Excel(name = "劳务人员")
private Long servicePersonnel;
/** 理人员 */
@Excel(name = "理人员")
/** 理人员 */
@Excel(name = "理人员")
private Long supervisorPersonnel;
/** 总包人员 */
@Excel(name = "总包人员")
private Long contractorPersonnel;
/** 数据状态 */
@Excel(name = "数据状态")
private Integer isDel;
private Integer oldServicePersonnel;
private Integer oldSupervisorPersonnel;
private Integer oldContractorPersonnel;
@ -133,6 +137,14 @@ public class SurProjectDeptWroks extends BaseEntity
this.oldContractorPersonnel = oldContractorPersonnel;
}
public Integer getIsDel() {
return isDel;
}
public void setIsDel(Integer isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -1,5 +1,7 @@
package com.yanzhu.jh.project.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -9,23 +11,68 @@ import com.ruoyi.common.core.domain.BaseEntity;
* sur_project_insurance
*
* @author JiangYuQi
* @date 2023-08-09
* @date 2023-08-16
*/
public class SurProjectInsurance extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 项目主键 */
@Excel(name = "项目主键")
private Long projectId;
/** 安责险 */
@Excel(name = "安责险")
private String azxInsurance;
/** 部门主键 */
@Excel(name = "部门主键")
private Long deptId;
/** 一切险 */
@Excel(name = "一切险")
private String yqxInsurance;
/** 保险类型 */
@Excel(name = "保险类型")
private String insuranceType;
/** 保保单号 */
@Excel(name = "保保单号")
private String insuranceNumber;
/** 保险文书 */
@Excel(name = "保险文书")
private String insuranceFile;
/** 保险状态 */
@Excel(name = "保险状态")
private String insuranceState;
/** 保险生效时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "保险生效时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date beginDate;
/** 保险截至时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "保险截至时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endDate;
/** 保险公司 */
@Excel(name = "保险公司")
private String companyName;
/** 数据状态 */
@Excel(name = "数据状态")
private String isDel;
private String insuranceTypeName;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setProjectId(Long projectId)
{
this.projectId = projectId;
@ -35,31 +82,115 @@ public class SurProjectInsurance extends BaseEntity
{
return projectId;
}
public void setAzxInsurance(String azxInsurance)
public void setDeptId(Long deptId)
{
this.azxInsurance = azxInsurance;
this.deptId = deptId;
}
public String getAzxInsurance()
public Long getDeptId()
{
return azxInsurance;
return deptId;
}
public void setYqxInsurance(String yqxInsurance)
public void setInsuranceType(String insuranceType)
{
this.yqxInsurance = yqxInsurance;
this.insuranceType = insuranceType;
}
public String getYqxInsurance()
public String getInsuranceType()
{
return yqxInsurance;
return insuranceType;
}
public void setInsuranceNumber(String insuranceNumber)
{
this.insuranceNumber = insuranceNumber;
}
public String getInsuranceNumber()
{
return insuranceNumber;
}
public void setInsuranceFile(String insuranceFile)
{
this.insuranceFile = insuranceFile;
}
public String getInsuranceFile()
{
return insuranceFile;
}
public void setInsuranceState(String insuranceState)
{
this.insuranceState = insuranceState;
}
public String getInsuranceState()
{
return insuranceState;
}
public void setBeginDate(Date beginDate)
{
this.beginDate = beginDate;
}
public Date getBeginDate()
{
return beginDate;
}
public void setEndDate(Date endDate)
{
this.endDate = endDate;
}
public Date getEndDate()
{
return endDate;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
public String getCompanyName()
{
return companyName;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public String getInsuranceTypeName() {
return insuranceTypeName;
}
public void setInsuranceTypeName(String insuranceTypeName) {
this.insuranceTypeName = insuranceTypeName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("projectId", getProjectId())
.append("azxInsurance", getAzxInsurance())
.append("yqxInsurance", getYqxInsurance())
.append("deptId", getDeptId())
.append("insuranceType", getInsuranceType())
.append("insuranceNumber", getInsuranceNumber())
.append("insuranceFile", getInsuranceFile())
.append("insuranceState", getInsuranceState())
.append("beginDate", getBeginDate())
.append("endDate", getEndDate())
.append("companyName", getCompanyName())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -32,8 +32,8 @@ public class SurProjectWorkAttendance extends BaseEntity
@Excel(name = "劳务人员")
private Long servicePersonnel;
/** 理人员 */
@Excel(name = "理人员")
/** 理人员 */
@Excel(name = "理人员")
private Long supervisorPersonnel;
/** 总包人员 */

View File

@ -35,6 +35,15 @@ public interface SurProjectDeptWroksMapper
*/
public List<SurProjectDeptWroks> selectSurProjectDeptWroksListv2(SurProjectDeptWroks surProjectDeptWroks);
/**
*
*
* @param surProjectDeptWroks
* @return
*/
public List<SurProjectDeptWroks> selectBgscreenDeptWroksList(SurProjectDeptWroks surProjectDeptWroks);
/**
*
*

View File

@ -7,17 +7,17 @@ import com.yanzhu.jh.project.domain.SurProjectInsurance;
* Mapper
*
* @author JiangYuQi
* @date 2023-08-09
* @date 2023-08-16
*/
public interface SurProjectInsuranceMapper
{
/**
*
*
* @param projectId
* @param id
* @return
*/
public SurProjectInsurance selectSurProjectInsuranceByProjectId(Long projectId);
public SurProjectInsurance selectSurProjectInsuranceById(Long id);
/**
*
@ -27,6 +27,14 @@ public interface SurProjectInsuranceMapper
*/
public List<SurProjectInsurance> selectSurProjectInsuranceList(SurProjectInsurance surProjectInsurance);
/**
*
*
* @param surProjectInsurance
* @return
*/
public List<SurProjectInsurance> selectSurProjectInsuranceListv2(SurProjectInsurance surProjectInsurance);
/**
*
*
@ -46,16 +54,16 @@ public interface SurProjectInsuranceMapper
/**
*
*
* @param projectId
* @param id
* @return
*/
public int deleteSurProjectInsuranceByProjectId(Long projectId);
public int deleteSurProjectInsuranceById(Long id);
/**
*
*
* @param projectIds
* @param ids
* @return
*/
public int deleteSurProjectInsuranceByProjectIds(Long[] projectIds);
public int deleteSurProjectInsuranceByIds(Long[] ids);
}

View File

@ -27,6 +27,14 @@ public interface SurProjectWorkAttendanceMapper
*/
public List<SurProjectWorkAttendance> selectSurProjectWorkAttendanceList(SurProjectWorkAttendance surProjectWorkAttendance);
/**
*
*
* @param surProjectWorkAttendance
* @return
*/
public List<SurProjectWorkAttendance> selectBgscreenWorkAttendanceList(SurProjectWorkAttendance surProjectWorkAttendance);
/**
*
*

View File

@ -35,6 +35,14 @@ public interface ISurProjectDeptWroksService
*/
public List<SurProjectDeptWroks> selectSurProjectDeptWroksListv2(SurProjectDeptWroks surProjectDeptWroks);
/**
*
*
* @param surProjectDeptWroks
* @return
*/
public List<SurProjectDeptWroks> selectBgscreenDeptWroksList(SurProjectDeptWroks surProjectDeptWroks);
/**
*
*

View File

@ -7,17 +7,17 @@ import com.yanzhu.jh.project.domain.SurProjectInsurance;
* Service
*
* @author JiangYuQi
* @date 2023-08-09
* @date 2023-08-16
*/
public interface ISurProjectInsuranceService
{
/**
*
*
* @param projectId
* @param id
* @return
*/
public SurProjectInsurance selectSurProjectInsuranceByProjectId(Long projectId);
public SurProjectInsurance selectSurProjectInsuranceById(Long id);
/**
*
@ -27,6 +27,14 @@ public interface ISurProjectInsuranceService
*/
public List<SurProjectInsurance> selectSurProjectInsuranceList(SurProjectInsurance surProjectInsurance);
/**
*
*
* @param surProjectInsurance
* @return
*/
public List<SurProjectInsurance> selectSurProjectInsuranceListv2(SurProjectInsurance surProjectInsurance);
/**
*
*
@ -46,16 +54,16 @@ public interface ISurProjectInsuranceService
/**
*
*
* @param projectIds
* @param ids
* @return
*/
public int deleteSurProjectInsuranceByProjectIds(Long[] projectIds);
public int deleteSurProjectInsuranceByIds(Long[] ids);
/**
*
*
* @param projectId
* @param id
* @return
*/
public int deleteSurProjectInsuranceByProjectId(Long projectId);
public int deleteSurProjectInsuranceById(Long id);
}

View File

@ -27,6 +27,14 @@ public interface ISurProjectWorkAttendanceService
*/
public List<SurProjectWorkAttendance> selectSurProjectWorkAttendanceList(SurProjectWorkAttendance surProjectWorkAttendance);
/**
*
*
* @param surProjectWorkAttendance
* @return
*/
public List<SurProjectWorkAttendance> selectBgscreenWorkAttendanceList(SurProjectWorkAttendance surProjectWorkAttendance);
/**
*
*

View File

@ -58,6 +58,17 @@ public class SurProjectDeptWroksServiceImpl implements ISurProjectDeptWroksServi
return surProjectDeptWroksMapper.selectSurProjectDeptWroksListv2(surProjectDeptWroks);
}
/**
*
*
* @param surProjectDeptWroks
* @return
*/
public List<SurProjectDeptWroks> selectBgscreenDeptWroksList(SurProjectDeptWroks surProjectDeptWroks) {
return surProjectDeptWroksMapper.selectBgscreenDeptWroksList(surProjectDeptWroks);
}
/**
*
*

View File

@ -1,6 +1,7 @@
package com.yanzhu.jh.project.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.jh.project.mapper.SurProjectInsuranceMapper;
@ -11,7 +12,7 @@ import com.ruoyi.common.utils.SecurityUtils;
* Service
*
* @author JiangYuQi
* @date 2023-08-09
* @date 2023-08-16
*/
@Service
public class SurProjectInsuranceServiceImpl implements ISurProjectInsuranceService
@ -22,13 +23,13 @@ public class SurProjectInsuranceServiceImpl implements ISurProjectInsuranceServi
/**
*
*
* @param projectId
* @param id
* @return
*/
@Override
public SurProjectInsurance selectSurProjectInsuranceByProjectId(Long projectId)
public SurProjectInsurance selectSurProjectInsuranceById(Long id)
{
return surProjectInsuranceMapper.selectSurProjectInsuranceByProjectId(projectId);
return surProjectInsuranceMapper.selectSurProjectInsuranceById(id);
}
/**
@ -43,6 +44,18 @@ public class SurProjectInsuranceServiceImpl implements ISurProjectInsuranceServi
return surProjectInsuranceMapper.selectSurProjectInsuranceList(surProjectInsurance);
}
/**
*
*
* @param surProjectInsurance
* @return
*/
@Override
public List<SurProjectInsurance> selectSurProjectInsuranceListv2(SurProjectInsurance surProjectInsurance)
{
return surProjectInsuranceMapper.selectSurProjectInsuranceListv2(surProjectInsurance);
}
/**
*
*
@ -52,6 +65,8 @@ public class SurProjectInsuranceServiceImpl implements ISurProjectInsuranceServi
@Override
public int insertSurProjectInsurance(SurProjectInsurance surProjectInsurance)
{
surProjectInsurance.setCreateBy(SecurityUtils.getUsername());
surProjectInsurance.setCreateTime(DateUtils.getNowDate());
return surProjectInsuranceMapper.insertSurProjectInsurance(surProjectInsurance);
}
@ -64,30 +79,32 @@ public class SurProjectInsuranceServiceImpl implements ISurProjectInsuranceServi
@Override
public int updateSurProjectInsurance(SurProjectInsurance surProjectInsurance)
{
surProjectInsurance.setUpdateBy(SecurityUtils.getUsername());
surProjectInsurance.setUpdateTime(DateUtils.getNowDate());
return surProjectInsuranceMapper.updateSurProjectInsurance(surProjectInsurance);
}
/**
*
*
* @param projectIds
* @param ids
* @return
*/
@Override
public int deleteSurProjectInsuranceByProjectIds(Long[] projectIds)
public int deleteSurProjectInsuranceByIds(Long[] ids)
{
return surProjectInsuranceMapper.deleteSurProjectInsuranceByProjectIds(projectIds);
return surProjectInsuranceMapper.deleteSurProjectInsuranceByIds(ids);
}
/**
*
*
* @param projectId
* @param id
* @return
*/
@Override
public int deleteSurProjectInsuranceByProjectId(Long projectId)
public int deleteSurProjectInsuranceById(Long id)
{
return surProjectInsuranceMapper.deleteSurProjectInsuranceByProjectId(projectId);
return surProjectInsuranceMapper.deleteSurProjectInsuranceById(id);
}
}

View File

@ -55,6 +55,17 @@ public class SurProjectWorkAttendanceServiceImpl implements ISurProjectWorkAtten
return surProjectWorkAttendanceMapper.selectSurProjectWorkAttendanceList(surProjectWorkAttendance);
}
/**
*
*
* @param surProjectWorkAttendance
* @return
*/
@Override
public List<SurProjectWorkAttendance> selectBgscreenWorkAttendanceList(SurProjectWorkAttendance surProjectWorkAttendance) {
return surProjectWorkAttendanceMapper.selectBgscreenWorkAttendanceList(surProjectWorkAttendance);
}
/**
*
*

View File

@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="servicePersonnel" column="service_personnel" />
<result property="supervisorPersonnel" column="supervisor_personnel" />
<result property="contractorPersonnel" column="contractor_personnel" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -56,6 +57,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="nowDept != null and nowDept != ''"> and spui.unitId = #{nowDept}</if>
</where>
</select>
<select id="selectBgscreenDeptWroksList" parameterType="SurProjectDeptWroks" resultMap="SurProjectDeptWroksResult">
SELECT
<if test="projectId != null ">spdw.project_id,</if>
<if test="deptId != null and projectId == null ">spdw.dept_id,</if>
SUM(spdw.service_personnel) AS service_personnel,
SUM(spdw.supervisor_personnel) AS supervisor_personnel,
SUM(spdw.contractor_personnel) AS contractor_personnel
FROM
sur_project_dept_wroks spdw
<where>
and spdw.is_del=0
<if test="projectId != null "> and spdw.project_id = #{projectId}</if>
<if test="deptId != null "> and spdw.dept_id = #{deptId}</if>
</where>
<if test="projectId != null "> group by spdw.project_id</if>
<if test="deptId != null and projectId == null"> group by spdw.dept_id</if>
</select>
<select id="selectSurProjectDeptWroksById" parameterType="Long" resultMap="SurProjectDeptWroksResult">
<include refid="selectSurProjectDeptWroksVo"/>

View File

@ -5,57 +5,152 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.yanzhu.jh.project.mapper.SurProjectInsuranceMapper">
<resultMap type="SurProjectInsurance" id="SurProjectInsuranceResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="azxInsurance" column="azx_insurance" />
<result property="yqxInsurance" column="yqx_insurance" />
<result property="deptId" column="dept_id" />
<result property="insuranceType" column="insurance_type" />
<result property="insuranceNumber" column="insurance_number" />
<result property="insuranceFile" column="insurance_file" />
<result property="insuranceState" column="insurance_state" />
<result property="beginDate" column="begin_date" />
<result property="endDate" column="end_date" />
<result property="companyName" column="company_name" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="insuranceTypeName" column="insurance_type_name" />
</resultMap>
<sql id="selectSurProjectInsuranceVo">
select project_id, azx_insurance, yqx_insurance from sur_project_insurance
select id, project_id, dept_id, insurance_type, insurance_number, insurance_file, insurance_state, begin_date, end_date, company_name, is_del, create_by, create_time, update_by, update_time, remark from sur_project_insurance
</sql>
<select id="selectSurProjectInsuranceList" parameterType="SurProjectInsurance" resultMap="SurProjectInsuranceResult">
<include refid="selectSurProjectInsuranceVo"/>
<where>
<if test="azxInsurance != null and azxInsurance != ''"> and azx_insurance = #{azxInsurance}</if>
<if test="yqxInsurance != null and yqxInsurance != ''"> and yqx_insurance = #{yqxInsurance}</if>
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="insuranceType != null and insuranceType != ''"> and insurance_type = #{insuranceType}</if>
<if test="insuranceNumber != null and insuranceNumber != ''"> and insurance_number like concat('%', #{insuranceNumber}, '%')</if>
<if test="insuranceFile != null and insuranceFile != ''"> and insurance_file = #{insuranceFile}</if>
<if test="insuranceState != null and insuranceState != ''"> and insurance_state = #{insuranceState}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectSurProjectInsuranceListv2" parameterType="SurProjectInsurance" resultMap="SurProjectInsuranceResult">
SELECT
spi.id,
spi.project_id,
sp.projectName,
sdd.dict_value,
sdd.dict_label as insurance_type_name,
spi.insurance_number,
spi.insurance_file,
CASE WHEN spi.insurance_state IS NULL THEN 0 ELSE 1 END AS insurance_state,
spi.begin_date,
spi.end_date,
spi.company_name,
spi.is_del,
spi.create_by,
spi.create_time,
spi.update_by,
spi.update_time,
spi.remark
FROM
sur_project sp
RIGHT JOIN sys_dict_data sdd ON sdd.dict_type = 'sur_project_insurance_type'
LEFT JOIN sur_project_insurance spi ON spi.project_id = sp.id
AND spi.insurance_type = sdd.dict_value
AND spi.dept_id = #{deptId}
AND spi.is_del = 0
<where>
and sdd.dict_type = 'sur_project_insurance_type'
<if test="projectId != null "> and sp.id = #{projectId}</if>
<if test="deptId != null "> and dept_id = </if>
</where>
ORDER BY
sp.projectSort,
sdd.dict_sort
</select>
<select id="selectSurProjectInsuranceByProjectId" parameterType="Long" resultMap="SurProjectInsuranceResult">
<select id="selectSurProjectInsuranceById" parameterType="Long" resultMap="SurProjectInsuranceResult">
<include refid="selectSurProjectInsuranceVo"/>
where project_id = #{projectId}
where id = #{id}
</select>
<insert id="insertSurProjectInsurance" parameterType="SurProjectInsurance" useGeneratedKeys="true" keyProperty="projectId">
<insert id="insertSurProjectInsurance" parameterType="SurProjectInsurance" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_insurance
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="azxInsurance != null">azx_insurance,</if>
<if test="yqxInsurance != null">yqx_insurance,</if>
<if test="projectId != null">project_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="insuranceType != null">insurance_type,</if>
<if test="insuranceNumber != null">insurance_number,</if>
<if test="insuranceFile != null">insurance_file,</if>
<if test="insuranceState != null">insurance_state,</if>
<if test="beginDate != null">begin_date,</if>
<if test="endDate != null">end_date,</if>
<if test="companyName != null">company_name,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="azxInsurance != null">#{azxInsurance},</if>
<if test="yqxInsurance != null">#{yqxInsurance},</if>
<if test="projectId != null">#{projectId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="insuranceType != null">#{insuranceType},</if>
<if test="insuranceNumber != null">#{insuranceNumber},</if>
<if test="insuranceFile != null">#{insuranceFile},</if>
<if test="insuranceState != null">#{insuranceState},</if>
<if test="beginDate != null">#{beginDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="companyName != null">#{companyName},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSurProjectInsurance" parameterType="SurProjectInsurance">
update sur_project_insurance
<trim prefix="SET" suffixOverrides=",">
<if test="azxInsurance != null">azx_insurance = #{azxInsurance},</if>
<if test="yqxInsurance != null">yqx_insurance = #{yqxInsurance},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="insuranceType != null">insurance_type = #{insuranceType},</if>
<if test="insuranceNumber != null">insurance_number = #{insuranceNumber},</if>
<if test="insuranceFile != null">insurance_file = #{insuranceFile},</if>
<if test="insuranceState != null">insurance_state = #{insuranceState},</if>
<if test="beginDate != null">begin_date = #{beginDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where project_id = #{projectId}
where id = #{id}
</update>
<delete id="deleteSurProjectInsuranceByProjectId" parameterType="Long">
delete from sur_project_insurance where project_id = #{projectId}
<delete id="deleteSurProjectInsuranceById" parameterType="Long">
delete from sur_project_insurance where id = #{id}
</delete>
<delete id="deleteSurProjectInsuranceByProjectIds" parameterType="String">
delete from sur_project_insurance where project_id in
<foreach item="projectId" collection="array" open="(" separator="," close=")">
#{projectId}
<delete id="deleteSurProjectInsuranceByIds" parameterType="String">
delete from sur_project_insurance where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -42,13 +42,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
sur_project_work_attendance spwa
<where>
and spwa.is_del=0
<if test="projectId != null "> and spwa.project_id = #{projectId}</if>
<if test="deptId != null "> and spwa.dept_id = #{deptId}</if>
<if test="params.beginWorkDate != null and params.beginWorkDate != '' and params.endWorkDate != null and params.endWorkDate != ''"> and spwa.work_date between #{params.beginWorkDate} and #{params.endWorkDate}</if>
<if test="workDate != null"> and DATE_FORMAT(spwa.work_date,'%Y-%m-%d')=DATE_FORMAT(#{workDate},'%Y-%m-%d')</if>
<if test="isDel != null "> and spwa.is_del = #{isDel}</if>
</where>
</select>
<select id="selectBgscreenWorkAttendanceList" parameterType="SurProjectWorkAttendance" resultMap="SurProjectWorkAttendanceResult">
SELECT
<if test="projectId != null ">spwa.project_id,</if>
<if test="deptId != null and projectId == null ">spwa.dept_id,</if>
SUM(spwa.service_personnel) AS service_personnel,
SUM(spwa.supervisor_personnel) AS supervisor_personnel,
SUM(spwa.contractor_personnel) AS contractor_personnel
FROM
sur_project_work_attendance spwa
<where>
and spwa.is_del=0
<if test="projectId != null "> and spwa.project_id = #{projectId}</if>
<if test="deptId != null "> and spwa.dept_id = #{deptId}</if>
<if test="workDate != null"> and DATE_FORMAT(spwa.work_date,'%Y-%m-%d')=DATE_FORMAT(#{workDate},'%Y-%m-%d')</if>
</where>
<if test="projectId != null "> group by spwa.project_id</if>
<if test="deptId != null and projectId == null"> group by spwa.dept_id</if>
</select>
<select id="selectSurProjectWorkAttendanceById" parameterType="Long" resultMap="SurProjectWorkAttendanceResult">
<include refid="selectSurProjectWorkAttendanceVo"/>