update code
parent
deef604213
commit
cee46f8bfd
|
@ -42,3 +42,14 @@ export function delSurProjectAttendance(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 查询当前出勤记录
|
||||
export function selectByDate(data) {
|
||||
return request({
|
||||
url: '/project/surProjectAttendance/selectByDate',
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ const getters = {
|
|||
token: state => state.user.token,
|
||||
avatar: state => state.user.avatar,
|
||||
name: state => state.user.name,
|
||||
dept:state=>state.user.dept,
|
||||
introduction: state => state.user.introduction,
|
||||
roles: state => state.user.roles,
|
||||
permissions: state => state.user.permissions,
|
||||
|
|
|
@ -6,6 +6,7 @@ const user = {
|
|||
token: getToken(),
|
||||
name: '',
|
||||
avatar: '',
|
||||
dept:null,
|
||||
roles: [],
|
||||
permissions: []
|
||||
},
|
||||
|
@ -25,6 +26,9 @@ const user = {
|
|||
},
|
||||
SET_PERMISSIONS: (state, permissions) => {
|
||||
state.permissions = permissions
|
||||
},
|
||||
SET_DEPT: (state, dept) => {
|
||||
state.dept = dept
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -36,7 +40,7 @@ const user = {
|
|||
const code = userInfo.code
|
||||
const uuid = userInfo.uuid
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, code, uuid).then(res => {
|
||||
login(username, password, code, uuid).then(res => {
|
||||
setToken(res.token)
|
||||
commit('SET_TOKEN', res.token)
|
||||
resolve()
|
||||
|
@ -49,7 +53,7 @@ const user = {
|
|||
// 获取用户信息
|
||||
GetInfo({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo().then(res => {
|
||||
getInfo().then(res => {
|
||||
const user = res.user
|
||||
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.png") : process.env.VUE_APP_BASE_API + user.avatar;
|
||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
|
@ -59,6 +63,7 @@ const user = {
|
|||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_NAME', user.userName)
|
||||
commit("SET_DEPT",user.dept);
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
|
@ -72,6 +77,7 @@ const user = {
|
|||
return new Promise((resolve, reject) => {
|
||||
logout(state.token).then(() => {
|
||||
commit('SET_TOKEN', '')
|
||||
commit("SET_DEPT",null);
|
||||
commit('SET_ROLES', [])
|
||||
commit('SET_PERMISSIONS', [])
|
||||
removeToken()
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
<el-dropdown-item command="handleProjectSpecial" icon="el-icon-first-aid-kit"
|
||||
v-hasPermi="['project:surProjectSpecial:list']">项目特种人员</el-dropdown-item>
|
||||
<el-dropdown-item command="handleProjectAttendance" icon="el-icon-first-aid-kit"
|
||||
v-hasPermi="['project:surProjectAttendance:list']">项目出勤记录</el-dropdown-item>
|
||||
v-hasPermi="['project:surProjectAttendance:add']">今日出勤</el-dropdown-item>
|
||||
<el-dropdown-item command="handleDelete" icon="el-icon-delete"
|
||||
v-hasPermi="['project:surProject:remove']">删除项目</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
|
@ -473,6 +473,7 @@
|
|||
size="50%"
|
||||
:visible.sync="projectSpecialDrawerVisible"
|
||||
:form-data="formData"></surProjectSpecialDrawer>
|
||||
<attendance-drawer ref="attDrawer"></attendance-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -486,11 +487,12 @@ import buildNodeDrawer from '../surBuildNode/buildNodeDrawer.vue'
|
|||
import workTrainDrawer from '../../work/workTrain/workTrainDrawer.vue'
|
||||
import emergencyDrillDrawer from '../../work/emergencyDrill/emergencyDrillDrawer.vue'
|
||||
import surProjectSpecialDrawer from '../surProjectSpecial/surProjectSpecialDrawer.vue'
|
||||
import attendanceDrawer from '../surProjectAttendance/attendanceDrawer.vue'
|
||||
|
||||
export default {
|
||||
name: "SurProject",
|
||||
components:{
|
||||
ProjectScheduleDlg,projectUserInfoDrawer,BaiduMap,AssessDrawer,buildNodeDrawer,workTrainDrawer,emergencyDrillDrawer,surProjectSpecialDrawer
|
||||
attendanceDrawer, ProjectScheduleDlg,projectUserInfoDrawer,BaiduMap,AssessDrawer,buildNodeDrawer,workTrainDrawer,emergencyDrillDrawer,surProjectSpecialDrawer
|
||||
},
|
||||
dicts: ['sys_check_state','sur_project_xmjd', 'project_build_type', 'sys_common_isdel', 'project_category','project_level','sur_project_weight'],
|
||||
data() {
|
||||
|
@ -710,6 +712,9 @@ export default {
|
|||
case "handleProjectSpecial":
|
||||
this.handleProjectSpecial(row);
|
||||
break;
|
||||
case "handleProjectAttendance":
|
||||
this.$refs.attDrawer.show(row);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -123,10 +123,12 @@
|
|||
<el-button type="primary" @click="doPrjProcessMgr" v-hasPermi="['project:surProject:edit']" icon="el-icon-time">进度管理</el-button>
|
||||
<el-button type="primary" @click="doPrjAssess" v-hasPermi="['system:assess:list']" icon="el-icon-coordinate">季度考核管理</el-button>
|
||||
<el-button type="primary" @click="doPrjBuildNode" v-hasPermi="['project:build_node_data:list']" icon="el-icon-data-analysis">计划节点管理</el-button>
|
||||
<el-button type="primary" @click="doPrjAttendance" v-hasPermi="['project:surProjectAttendance:add']" icon="el-icon-s-check">今日出勤</el-button>
|
||||
</div>
|
||||
<ProjectScheduleDlg ref="prjSchDlg"></ProjectScheduleDlg>
|
||||
<assess-drawer ref="assessDrawer"></assess-drawer>
|
||||
<build-node-drawer ref="nodeDrawer"></build-node-drawer>
|
||||
<attendance-drawer ref="attDrawer"></attendance-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -135,11 +137,12 @@ import { listSurProject} from "@/api/project/surProject";
|
|||
import ProjectScheduleDlg from '../surProjectSchedule/ProjectScheduleDlg.vue'
|
||||
import AssessDrawer from '../surProjectQuarterlyAssess/assessDrawer.vue'
|
||||
import buildNodeDrawer from '../surBuildNode/buildNodeDrawer.vue'
|
||||
import attendanceDrawer from '../surProjectAttendance/attendanceDrawer.vue'
|
||||
export default {
|
||||
dicts: ['sys_check_state','sur_project_xmjd', 'project_build_type', 'sys_common_isdel', 'project_category','project_level','sur_project_weight'],
|
||||
name: 'RuoyiUiMyIndex',
|
||||
components:{
|
||||
ProjectScheduleDlg,AssessDrawer,buildNodeDrawer
|
||||
ProjectScheduleDlg,AssessDrawer,buildNodeDrawer,attendanceDrawer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -154,6 +157,9 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
doPrjAttendance(){
|
||||
this.$refs.attDrawer.show(this.prj);
|
||||
},
|
||||
getWeight(v){
|
||||
let tmps=this.dict.type.sur_project_weight.filter(d=>d.value==v);
|
||||
return tmps.length>0?tmps[0].label:'';
|
||||
|
|
|
@ -55,14 +55,14 @@ public class ProjectController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("getProgressProjects")
|
||||
public AjaxResult getProgressProjects(){
|
||||
String key="bgscreen_prj_getProgressProjects";
|
||||
public AjaxResult getProgressProjects(long deptId){
|
||||
String key="bgscreen_prj_getProgressProjects_"+deptId;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return AjaxResult.success(obj);
|
||||
}
|
||||
|
||||
List<SurProject> list= isurProjectService.selectProgressProjects();
|
||||
List<SurProject> list= isurProjectService.selectProgressProjects(deptId);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.yanzhu.jh.project.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.utils.file.ImageUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -101,4 +103,10 @@ public class SurProjectWorkAttendanceController extends BaseController
|
|||
{
|
||||
return toAjax(surProjectWorkAttendanceService.deleteSurProjectWorkAttendanceByIds(ids));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('project:surProjectAttendance:query')")
|
||||
@PostMapping("/selectByDate")
|
||||
public AjaxResult selectByDate(@RequestBody SurProjectWorkAttendance surProjectWorkAttendance){
|
||||
return AjaxResult.success(surProjectWorkAttendanceService.selectByDate(surProjectWorkAttendance));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public interface SurProjectMapper
|
|||
*/
|
||||
public List<SurProject> groupByLevel(SurProject surProject);
|
||||
|
||||
public List<SurProject> selectProgressProjects();
|
||||
public List<SurProject> selectProgressProjects(long deptId);
|
||||
|
||||
public List<SurProject> groupByProjectCategory();
|
||||
}
|
||||
|
|
|
@ -58,4 +58,6 @@ public interface SurProjectWorkAttendanceMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectWorkAttendanceByIds(Long[] ids);
|
||||
|
||||
public List<SurProjectWorkAttendance> selectByDate(SurProjectWorkAttendance surProjectWorkAttendance);
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public interface ISurProjectService
|
|||
*/
|
||||
public int deleteSurProjectById(Long id);
|
||||
|
||||
public List<SurProject> selectProgressProjects();
|
||||
public List<SurProject> selectProgressProjects(long deptId);
|
||||
|
||||
public List<SurProject> groupByProjectCategory();
|
||||
|
||||
|
|
|
@ -58,4 +58,6 @@ public interface ISurProjectWorkAttendanceService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectWorkAttendanceById(Long id);
|
||||
|
||||
public List<SurProjectWorkAttendance> selectByDate(SurProjectWorkAttendance surProjectWorkAttendance);
|
||||
}
|
||||
|
|
|
@ -96,8 +96,8 @@ public class SurProjectServiceImpl implements ISurProjectService
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<SurProject> selectProgressProjects() {
|
||||
return surProjectMapper.selectProgressProjects();
|
||||
public List<SurProject> selectProgressProjects(long deptId) {
|
||||
return surProjectMapper.selectProgressProjects(deptId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -95,4 +95,9 @@ public class SurProjectWorkAttendanceServiceImpl implements ISurProjectWorkAtten
|
|||
{
|
||||
return surProjectWorkAttendanceMapper.deleteSurProjectWorkAttendanceById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SurProjectWorkAttendance> selectByDate(SurProjectWorkAttendance surProjectWorkAttendance) {
|
||||
return surProjectWorkAttendanceMapper.selectByDate(surProjectWorkAttendance);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="nodeId" column="node_id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="planStartDate" column="plan_start_date" />
|
||||
<result property="planEndDate" column="plan_end_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
|
@ -47,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
<sql id="selectSurProjectBuildNodeDataVoByNode">
|
||||
select * from (
|
||||
SELECT a.id, node_id, project_id, start_date, end_date, STATUS, a.remark, files, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time ,node_text,node_lvl
|
||||
SELECT a.id, node_id, project_id, start_date, end_date,plan_start_date,plan_end_date, STATUS, a.remark, files, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time ,node_text,node_lvl
|
||||
FROM sur_project_build_node_data a,base_build_node b WHERE a.node_id=b.id
|
||||
) sur_project_build_node_data
|
||||
</sql>
|
||||
|
|
|
@ -303,9 +303,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
) a RIGHT JOIN sys_dict_data b ON a.dict_value=b.dict_value WHERE b.dict_type='project_level' ORDER BY cnt DESC
|
||||
</select>
|
||||
|
||||
<select id="selectProgressProjects" parameterType="SurProject" resultMap="SurProjectResult">
|
||||
<select id="selectProgressProjects" parameterType="Long" resultMap="SurProjectResult">
|
||||
<include refid="selectSurProjectVo"/>
|
||||
where progressVisible = 0
|
||||
<if test="deptId!=0">and deptid=#{deptId}</if>
|
||||
order by projectSort,projectName
|
||||
</select>
|
||||
|
||||
|
|
|
@ -100,4 +100,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectByDate" 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="createTime != null"> and date(create_time)=date(#{createTime}) </if>
|
||||
and is_del = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue