提交代码
parent
c692101bfc
commit
f24b2e3a77
|
@ -9,9 +9,9 @@ export function listProjectDeptWroks(query) {
|
|||
})
|
||||
}
|
||||
|
||||
export function listProjectDeptWroks2(query) {
|
||||
export function deptWroksViewData(query) {
|
||||
return request({
|
||||
url: '/project/projectDeptWroks/list2',
|
||||
url: '/project/projectDeptWroks/viewData',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<template slot="title">
|
||||
<div>{{ title + " 【部门在册人员】" }}</div>
|
||||
</template>
|
||||
<el-tabs v-model="activeName" style="padding-left: 20px">
|
||||
<el-tabs v-model="activeName" style="padding-left: 20px" @tab-click="loadData">
|
||||
<el-tab-pane
|
||||
v-for="(it, idx) in nodes"
|
||||
:label="it.unitName + ''"
|
||||
|
@ -59,7 +59,7 @@
|
|||
import { mapGetters } from "vuex";
|
||||
import {
|
||||
unitList,
|
||||
listProjectDeptWroks2,
|
||||
deptWroksViewData,
|
||||
updateProjectDeptWroks,
|
||||
} from "@/api/project/projectDeptWroks";
|
||||
export default {
|
||||
|
@ -70,7 +70,11 @@ export default {
|
|||
project: null,
|
||||
title: "",
|
||||
nodes: [],
|
||||
form: {},
|
||||
form: {
|
||||
oldServicePersonnel: 0,
|
||||
oldSupervisorPersonnel: 0,
|
||||
oldContractorPersonnel: 0,
|
||||
},
|
||||
rules: {},
|
||||
activeName: "",
|
||||
};
|
||||
|
@ -101,14 +105,21 @@ export default {
|
|||
this.nodes = d.rows;
|
||||
if (this.nodes.length > 0) {
|
||||
this.activeName = this.nodes[0].unitId + "";
|
||||
listProjectDeptWroks2({
|
||||
projectId: this.project.id,
|
||||
}).then((d) => {
|
||||
this.form = d.rows[0];
|
||||
this.form.oldServicePersonnel = this.form.servicePersonnel;
|
||||
this.form.oldSupervisorPersonnel = this.form.supervisorPersonnel;
|
||||
this.form.oldContractorPersonnel = this.form.contractorPersonnel;
|
||||
});
|
||||
this.loadData();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 页签点击
|
||||
loadData() {
|
||||
deptWroksViewData({
|
||||
projectId: this.project.id,
|
||||
nowDept: this.activeName,
|
||||
}).then((d) => {
|
||||
if (d.rows.length > 0) {
|
||||
this.form = d.rows[0];
|
||||
this.form.oldServicePersonnel = this.form.servicePersonnel;
|
||||
this.form.oldSupervisorPersonnel = this.form.supervisorPersonnel;
|
||||
this.form.oldContractorPersonnel = this.form.contractorPersonnel;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -198,7 +198,7 @@
|
|||
<dict-tag :options="dict.type.project_level" :value="scope.row.projiectLevel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目区域" align="center" prop="projectRegional" />
|
||||
<el-table-column label="项目区域" align="center" prop="projectRegionalName" />
|
||||
<el-table-column
|
||||
label="进度展示"
|
||||
align="center"
|
||||
|
@ -326,13 +326,6 @@
|
|||
<el-table-column label="劳务人员" align="center" prop="servicePersonnel" />
|
||||
<el-table-column label="监理人员" align="center" prop="supervisorPersonnel" />
|
||||
<el-table-column label="总包人员" align="center" prop="generalContractor" />
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="left"
|
||||
prop="remark"
|
||||
width="200"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
|
@ -688,7 +681,7 @@
|
|||
></el-col>
|
||||
<el-col :span="8"></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="8"
|
||||
><el-form-item label="劳务人员数" prop="servicePersonnel">
|
||||
<el-input v-model="form.servicePersonnel" placeholder="请输入劳务人员数">
|
||||
|
@ -710,7 +703,7 @@
|
|||
</el-input>
|
||||
</el-form-item></el-col
|
||||
>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<el-form-item label="项目概述" prop="projectSummarize">
|
||||
<el-input
|
||||
v-model="form.projectSummarize"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<template slot="title">
|
||||
<div>{{ title + " 【今日出勤】" }}</div>
|
||||
</template>
|
||||
<el-tabs v-model="activeName" style="padding-left: 20px">
|
||||
<el-tabs v-model="activeName" style="padding-left: 20px" @tab-click="loadData">
|
||||
<el-tab-pane
|
||||
v-for="(it, idx) in nodes"
|
||||
:label="it.unitName + ''"
|
||||
|
@ -29,7 +29,7 @@
|
|||
"
|
||||
>
|
||||
<el-form-item label="在册劳务人员" prop="servicePersonnel">
|
||||
<el-input style="width: 80%" v-model="vform.servicePersonnel" :readonly="true"
|
||||
<el-input style="width: 80%" v-model="vform.servicePersonnel" :disabled="true"
|
||||
><i slot="suffix">人</i></el-input
|
||||
>
|
||||
</el-form-item>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<el-input
|
||||
style="width: 80%"
|
||||
v-model="vform.supervisorPersonnel"
|
||||
:readonly="true"
|
||||
:disabled="true"
|
||||
><i slot="suffix">人</i></el-input
|
||||
>
|
||||
</el-form-item>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<el-input
|
||||
style="width: 80%"
|
||||
v-model="vform.contractorPersonnel"
|
||||
:readonly="true"
|
||||
:disabled="true"
|
||||
><i slot="suffix">人</i></el-input
|
||||
>
|
||||
</el-form-item>
|
||||
|
@ -55,7 +55,7 @@
|
|||
style="width: 80%"
|
||||
v-model="form.servicePersonnel"
|
||||
:min="0"
|
||||
:max="10000"
|
||||
:max="vform.servicePersonnel"
|
||||
label="请输入劳务人员"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
|
@ -64,7 +64,7 @@
|
|||
style="width: 80%"
|
||||
v-model="form.supervisorPersonnel"
|
||||
:min="0"
|
||||
:max="10000"
|
||||
:max="vform.supervisorPersonnel"
|
||||
label="请输入管理人员"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
|
@ -73,7 +73,7 @@
|
|||
style="width: 80%"
|
||||
v-model="form.contractorPersonnel"
|
||||
:min="0"
|
||||
:max="10000"
|
||||
:max="vform.contractorPersonnel"
|
||||
label="请输入总包人员"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
|
@ -90,9 +90,14 @@
|
|||
import { mapGetters } from "vuex";
|
||||
import {
|
||||
unitList,
|
||||
listProjectDeptWroks2,
|
||||
deptWroksViewData,
|
||||
updateProjectDeptWroks,
|
||||
} from "@/api/project/projectDeptWroks";
|
||||
import {
|
||||
listSurProjectAttendance,
|
||||
updateSurProjectAttendance,
|
||||
} from "@/api/project/surProjectAttendance";
|
||||
|
||||
export default {
|
||||
name: "RuoyiUiProjectDeptWroksDrawer",
|
||||
data() {
|
||||
|
@ -101,8 +106,16 @@ export default {
|
|||
project: null,
|
||||
title: "",
|
||||
nodes: [],
|
||||
vform: {},
|
||||
form: {},
|
||||
vform: {
|
||||
servicePersonnel: 0,
|
||||
supervisorPersonnel: 0,
|
||||
contractorPersonnel: 0,
|
||||
},
|
||||
form: {
|
||||
servicePersonnel: null,
|
||||
supervisorPersonnel: null,
|
||||
contractorPersonnel: null,
|
||||
},
|
||||
rules: {},
|
||||
activeName: "",
|
||||
};
|
||||
|
@ -114,7 +127,7 @@ export default {
|
|||
|
||||
methods: {
|
||||
doOk() {
|
||||
updateProjectDeptWroks(this.form).then((response) => {
|
||||
updateSurProjectAttendance(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.isOpen = false;
|
||||
});
|
||||
|
@ -123,21 +136,40 @@ export default {
|
|||
this.isOpen = false;
|
||||
},
|
||||
show(project) {
|
||||
this.form.servicePersonnel = null;
|
||||
this.form.supervisorPersonnel = null;
|
||||
this.form.contractorPersonnel = null;
|
||||
this.project = project;
|
||||
this.title = project.projectName;
|
||||
this.isOpen = true;
|
||||
unitList({
|
||||
projectId: project.id,
|
||||
unitType: 2,
|
||||
}).then((d) => {
|
||||
this.nodes = d.rows;
|
||||
}).then((d1) => {
|
||||
this.nodes = d1.rows;
|
||||
if (this.nodes.length > 0) {
|
||||
this.activeName = this.nodes[0].unitId + "";
|
||||
listProjectDeptWroks2({
|
||||
projectId: this.project.id,
|
||||
}).then((d) => {
|
||||
this.vform = d.rows[0];
|
||||
});
|
||||
this.loadData();
|
||||
}
|
||||
});
|
||||
},
|
||||
loadData() {
|
||||
deptWroksViewData({
|
||||
projectId: this.project.id,
|
||||
nowDept: this.activeName,
|
||||
}).then((d2) => {
|
||||
this.vform = d2.rows[0];
|
||||
});
|
||||
listSurProjectAttendance({
|
||||
projectId: this.project.id,
|
||||
deptId: this.activeName,
|
||||
workDate: "" + new Date(),
|
||||
}).then((d3) => {
|
||||
if (d3.rows.length > 0) {
|
||||
this.form = d3.rows[0];
|
||||
} else {
|
||||
this.form.projectId = this.project.id;
|
||||
this.form.deptId = this.activeName;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<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="prijectId">
|
||||
<el-form-item label="项目主键" prop="projectId">
|
||||
<el-input
|
||||
v-model="queryParams.prijectId"
|
||||
v-model="queryParams.projectId"
|
||||
placeholder="请输入项目主键"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
|
@ -93,7 +93,7 @@
|
|||
<el-table v-loading="loading" :data="surProjectAttendanceList" @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="prijectId" />
|
||||
<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" />
|
||||
|
@ -128,7 +128,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
|
@ -140,8 +140,8 @@
|
|||
<!-- 添加或修改项目出勤对话框 -->
|
||||
<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="prijectId">
|
||||
<el-input v-model="form.prijectId" placeholder="请输入项目主键" />
|
||||
<el-form-item label="项目主键" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门主键" prop="deptId">
|
||||
<el-input v-model="form.deptId" placeholder="请输入部门主键" />
|
||||
|
@ -217,7 +217,7 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
prijectId: null,
|
||||
projectId: null,
|
||||
deptId: null,
|
||||
workDate: null,
|
||||
isDel: null,
|
||||
|
@ -256,7 +256,7 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
prijectId: null,
|
||||
projectId: null,
|
||||
deptId: null,
|
||||
servicePersonnel: null,
|
||||
supervisorPersonnel: null,
|
||||
|
|
|
@ -53,13 +53,7 @@ public class SurProjectDeptWroksController extends BaseController
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(SurProjectDeptWroks surProjectDeptWroks)
|
||||
{
|
||||
surProjectDeptWroks.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||
if(SysRoleEnum.ZGS.getCode().equals(surProjectDeptWroks.getNowRole())){
|
||||
surProjectDeptWroks.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId())));
|
||||
}else{
|
||||
surProjectDeptWroks.setNowDept(Convert.toStr(getDeptId()));
|
||||
}
|
||||
surProjectDeptWroks.setNowUser(Convert.toStr(getUserId()));
|
||||
startPage();
|
||||
List<SurProjectDeptWroks> list = surProjectDeptWroksService.selectSurProjectDeptWroksList(surProjectDeptWroks);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
@ -68,16 +62,9 @@ public class SurProjectDeptWroksController extends BaseController
|
|||
* 查询项目部门在册人员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:projectDeptWroks:list')")
|
||||
@GetMapping("/list2")
|
||||
public TableDataInfo list2(SurProjectDeptWroks surProjectDeptWroks)
|
||||
@GetMapping("/viewData")
|
||||
public TableDataInfo viewData(SurProjectDeptWroks surProjectDeptWroks)
|
||||
{
|
||||
surProjectDeptWroks.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||
if(SysRoleEnum.ZGS.getCode().equals(surProjectDeptWroks.getNowRole())){
|
||||
surProjectDeptWroks.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId())));
|
||||
}else{
|
||||
surProjectDeptWroks.setNowDept(Convert.toStr(getDeptId()));
|
||||
}
|
||||
surProjectDeptWroks.setNowUser(Convert.toStr(getUserId()));
|
||||
List<SurProjectDeptWroks> list = surProjectDeptWroksService.selectSurProjectDeptWroksListv2(surProjectDeptWroks);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
@ -89,6 +76,10 @@ public class SurProjectDeptWroksController extends BaseController
|
|||
@GetMapping("/unitList")
|
||||
public TableDataInfo unitList(SurProjectUnitInfo surProjectUnitInfo)
|
||||
{
|
||||
surProjectUnitInfo.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||
if(SysRoleEnum.ZBDW.getCode().equals(surProjectUnitInfo.getNowRole())){
|
||||
surProjectUnitInfo.setUnitId(getDeptId());
|
||||
}
|
||||
return getDataTable(surProjectUnitInfoService.selectSurProjectUnitInfoList(surProjectUnitInfo));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.jh.project.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -48,6 +49,20 @@ public class SurProjectWorkAttendanceController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目出勤列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:surProjectAttendance:list')")
|
||||
@GetMapping("/viewData")
|
||||
public TableDataInfo viewData(SurProjectWorkAttendance surProjectWorkAttendance)
|
||||
{
|
||||
if(surProjectWorkAttendance.getWorkDate()==null){
|
||||
surProjectWorkAttendance.setWorkDate(new Date());
|
||||
}
|
||||
List<SurProjectWorkAttendance> list = surProjectWorkAttendanceService.selectSurProjectWorkAttendanceList(surProjectWorkAttendance);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出项目出勤列表
|
||||
*/
|
||||
|
|
|
@ -174,6 +174,9 @@ public class SurProject extends BaseEntity
|
|||
@Excel(name = "进度显示")
|
||||
private String progressVisible;
|
||||
|
||||
@Excel(name = "项目区域名称")
|
||||
private String projectRegionalName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
@ -531,6 +534,14 @@ public class SurProject extends BaseEntity
|
|||
this.progressVisible = progressVisible;
|
||||
}
|
||||
|
||||
public String getProjectRegionalName() {
|
||||
return projectRegionalName;
|
||||
}
|
||||
|
||||
public void setProjectRegionalName(String projectRegionalName) {
|
||||
this.projectRegionalName = projectRegionalName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
@ -22,7 +22,7 @@ public class SurProjectWorkAttendance extends BaseEntity
|
|||
|
||||
/** 项目主键 */
|
||||
@Excel(name = "项目主键")
|
||||
private Long prijectId;
|
||||
private Long projectId;
|
||||
|
||||
/** 部门主键 */
|
||||
@Excel(name = "部门主键")
|
||||
|
@ -58,14 +58,14 @@ public class SurProjectWorkAttendance extends BaseEntity
|
|||
{
|
||||
return id;
|
||||
}
|
||||
public void setPrijectId(Long prijectId)
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.prijectId = prijectId;
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getPrijectId()
|
||||
public Long getProjectId()
|
||||
{
|
||||
return prijectId;
|
||||
return projectId;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ public class SurProjectWorkAttendance extends BaseEntity
|
|||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("prijectId", getPrijectId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("servicePersonnel", getServicePersonnel())
|
||||
.append("supervisorPersonnel", getSupervisorPersonnel())
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.yanzhu.jh.project.mapper.SurProjectDeptWroksMapper;
|
|||
import com.yanzhu.jh.project.domain.SurProjectDeptWroks;
|
||||
import com.yanzhu.jh.project.service.ISurProjectDeptWroksService;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 项目部门在册人员Service业务层处理
|
||||
*
|
||||
|
@ -77,6 +79,7 @@ public class SurProjectDeptWroksServiceImpl implements ISurProjectDeptWroksServi
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateSurProjectDeptWroks(SurProjectDeptWroks surProjectDeptWroks)
|
||||
{
|
||||
if(surProjectDeptWroks.getId()!=null){
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
package com.yanzhu.jh.project.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.enums.PublicStateEnum;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.yanzhu.jh.project.domain.SurProjectDeptWroks;
|
||||
import com.yanzhu.jh.project.mapper.SurProjectDeptWroksMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.jh.project.mapper.SurProjectWorkAttendanceMapper;
|
||||
import com.yanzhu.jh.project.domain.SurProjectWorkAttendance;
|
||||
import com.yanzhu.jh.project.service.ISurProjectWorkAttendanceService;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 项目出勤Service业务层处理
|
||||
*
|
||||
|
@ -20,6 +28,9 @@ public class SurProjectWorkAttendanceServiceImpl implements ISurProjectWorkAtten
|
|||
@Autowired
|
||||
private SurProjectWorkAttendanceMapper surProjectWorkAttendanceMapper;
|
||||
|
||||
@Autowired
|
||||
private SurProjectDeptWroksMapper surProjectDeptWroksMapper;
|
||||
|
||||
/**
|
||||
* 查询项目出勤
|
||||
*
|
||||
|
@ -65,11 +76,37 @@ public class SurProjectWorkAttendanceServiceImpl implements ISurProjectWorkAtten
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateSurProjectWorkAttendance(SurProjectWorkAttendance surProjectWorkAttendance)
|
||||
{
|
||||
surProjectWorkAttendance.setUpdateBy(SecurityUtils.getUsername());
|
||||
surProjectWorkAttendance.setUpdateTime(DateUtils.getNowDate());
|
||||
return surProjectWorkAttendanceMapper.updateSurProjectWorkAttendance(surProjectWorkAttendance);
|
||||
int res = -1;
|
||||
surProjectWorkAttendance.setWorkDate(new Date());
|
||||
surProjectWorkAttendance.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode()));
|
||||
//数据效验
|
||||
SurProjectDeptWroks surProjectDeptWroks = new SurProjectDeptWroks();
|
||||
surProjectDeptWroks.setProjectId(surProjectWorkAttendance.getProjectId());
|
||||
surProjectDeptWroks.setNowDept(Convert.toStr(surProjectWorkAttendance.getDeptId()));
|
||||
List<SurProjectDeptWroks> surProjectDeptWroksList =surProjectDeptWroksMapper.selectSurProjectDeptWroksListv2(surProjectDeptWroks);
|
||||
if(surProjectDeptWroksList!=null && surProjectDeptWroksList.size()>0){
|
||||
if(surProjectWorkAttendance.getServicePersonnel()>surProjectDeptWroksList.get(0).getServicePersonnel()){
|
||||
return res;
|
||||
}
|
||||
if(surProjectWorkAttendance.getSupervisorPersonnel()>surProjectDeptWroksList.get(0).getSupervisorPersonnel()){
|
||||
return res;
|
||||
}
|
||||
if(surProjectWorkAttendance.getContractorPersonnel()>surProjectDeptWroksList.get(0).getContractorPersonnel()){
|
||||
return res;
|
||||
}
|
||||
}
|
||||
if(surProjectWorkAttendance.getId()!=null){
|
||||
surProjectWorkAttendance.setUpdateBy(SecurityUtils.getUsername());
|
||||
surProjectWorkAttendance.setUpdateTime(DateUtils.getNowDate());
|
||||
return surProjectWorkAttendanceMapper.updateSurProjectWorkAttendance(surProjectWorkAttendance);
|
||||
}else{
|
||||
surProjectWorkAttendance.setCreateBy(SecurityUtils.getUsername());
|
||||
surProjectWorkAttendance.setCreateTime(DateUtils.getNowDate());
|
||||
return surProjectWorkAttendanceMapper.insertSurProjectWorkAttendance(surProjectWorkAttendance);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND spdw.project_id = sp.id
|
||||
<where>
|
||||
<if test="projectId != null "> and sp.id = #{projectId}</if>
|
||||
<if test='nowRole == "6"'> and spui.unitId = #{nowDept}</if>
|
||||
<if test="nowDept != null and nowDept != ''"> and spui.unitId = #{nowDept}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="weightType" column="weightType" />
|
||||
<result property="projectSort" column="projectSort" />
|
||||
<result property="progressVisible" column="progressVisible" />
|
||||
<result property="projectRegionalName" column="projectRegionalName" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectVo">
|
||||
|
@ -58,8 +59,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectSurProjectList" parameterType="SurProject" resultMap="SurProjectResult">
|
||||
select sp.id, sp.deptId, sp.projectName, sp.projectCode, sp.paretProjectName, sp.paretProjectCode, sp.simpleName, sp.projectType, sp.projiectLevel, sp.projectRegional, sp.projectAddress, sp.projectNature, sp.licenceNumber, sp.projectApproval, sp.projectPerson, sp.projectPhone, sp.longitude, sp.latitude, sp.projectTimeLimit, sp.totalInvestment, sp.floorArea, sp.totalOutputValue, sp.plannedCompletionTime, sp.scheduledStartTime, sp.actualOperatingTime, sp.actualCompletionTime, sp.contractAmount, sp.paidAmount, sp.onAccountAmount, sp.projectSchedule, sp.projectSummarize, sp.isDel, sp.projectStatus, sp.servicePersonnel, sp.supervisorPersonnel, sp.generalContractor, sp.create_by, sp.create_time, sp.update_by, sp.update_time, sp.remark, sp.weightType, sp.projectSort, sp.progressVisible, d.dept_name from sur_project sp
|
||||
select sp.id, sp.deptId, sp.projectName, sp.projectCode, sp.paretProjectName, sp.paretProjectCode, sp.simpleName, sp.projectType, sp.projiectLevel, sp.projectRegional, a.areaName as projectRegionalName, sp.projectAddress, sp.projectNature, sp.licenceNumber, sp.projectApproval, sp.projectPerson, sp.projectPhone, sp.longitude, sp.latitude, sp.projectTimeLimit, sp.totalInvestment, sp.floorArea, sp.totalOutputValue, sp.plannedCompletionTime, sp.scheduledStartTime, sp.actualOperatingTime, sp.actualCompletionTime, sp.contractAmount, sp.paidAmount, sp.onAccountAmount, sp.projectSchedule, sp.projectSummarize, sp.isDel, sp.projectStatus, sp.servicePersonnel, sp.supervisorPersonnel, sp.generalContractor, sp.create_by, sp.create_time, sp.update_by, sp.update_time, sp.remark, sp.weightType, sp.projectSort, sp.progressVisible, d.dept_name from sur_project sp
|
||||
left join sys_dept d on d.dept_id = sp.deptId
|
||||
left join china_area a on sp.projectRegional = a.id
|
||||
<!--监理单位/总包公司/分包单位-->
|
||||
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> left join sur_project_unit_info spui on spui.projectId = sp.id</if>
|
||||
<!--普通用户查询项目人员-->
|
||||
|
|
|
@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<resultMap type="SurProjectWorkAttendance" id="SurProjectWorkAttendanceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="prijectId" column="priject_id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="servicePersonnel" column="service_personnel" />
|
||||
<result property="supervisorPersonnel" column="supervisor_personnel" />
|
||||
|
@ -21,16 +21,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectWorkAttendanceVo">
|
||||
select id, priject_id, dept_id, service_personnel, supervisor_personnel, contractor_personnel, work_date, is_del, create_by, create_time, update_by, update_time, remark from sur_project_work_attendance
|
||||
select id, project_id, dept_id, service_personnel, supervisor_personnel, contractor_personnel, work_date, is_del, create_by, create_time, update_by, update_time, remark from sur_project_work_attendance
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectWorkAttendanceList" parameterType="SurProjectWorkAttendance" resultMap="SurProjectWorkAttendanceResult">
|
||||
<include refid="selectSurProjectWorkAttendanceVo"/>
|
||||
<where>
|
||||
<if test="prijectId != null "> and priject_id = #{prijectId}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="params.beginWorkDate != null and params.beginWorkDate != '' and params.endWorkDate != null and params.endWorkDate != ''"> and work_date between #{params.beginWorkDate} and #{params.endWorkDate}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
SELECT
|
||||
spwa.id,
|
||||
spwa.project_id,
|
||||
spwa.dept_id,
|
||||
IFNULL(spwa.service_personnel, 0) AS service_personnel,
|
||||
IFNULL(spwa.supervisor_personnel, 0) AS supervisor_personnel,
|
||||
IFNULL(spwa.contractor_personnel, 0) AS contractor_personnel,
|
||||
spwa.work_date,
|
||||
spwa.is_del,
|
||||
spwa.create_by,
|
||||
spwa.create_time,
|
||||
spwa.update_by,
|
||||
spwa.update_time,
|
||||
spwa.remark
|
||||
FROM
|
||||
sur_project_work_attendance spwa
|
||||
<where>
|
||||
<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>
|
||||
|
||||
|
@ -42,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="insertSurProjectWorkAttendance" parameterType="SurProjectWorkAttendance" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_work_attendance
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="prijectId != null">priject_id,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="servicePersonnel != null">service_personnel,</if>
|
||||
<if test="supervisorPersonnel != null">supervisor_personnel,</if>
|
||||
|
@ -56,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="prijectId != null">#{prijectId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="servicePersonnel != null">#{servicePersonnel},</if>
|
||||
<if test="supervisorPersonnel != null">#{supervisorPersonnel},</if>
|
||||
|
@ -74,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateSurProjectWorkAttendance" parameterType="SurProjectWorkAttendance">
|
||||
update sur_project_work_attendance
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="prijectId != null">priject_id = #{prijectId},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="servicePersonnel != null">service_personnel = #{servicePersonnel},</if>
|
||||
<if test="supervisorPersonnel != null">supervisor_personnel = #{supervisorPersonnel},</if>
|
||||
|
@ -103,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectByDate" parameterType="SurProjectWorkAttendance" resultMap="SurProjectWorkAttendanceResult">
|
||||
<include refid="selectSurProjectWorkAttendanceVo"/>
|
||||
<where>
|
||||
<if test="prijectId != null "> and priject_id = #{prijectId}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="createTime != null"> and date(create_time)=date(#{createTime}) </if>
|
||||
and is_del = 0
|
||||
|
|
Loading…
Reference in New Issue