提交代码
parent
2787535ef5
commit
79faece817
|
@ -542,10 +542,10 @@ public class LabourApiController extends BaseController {
|
|||
throw new ServiceException("人员部门类型信息不完整",HttpStatusEnum.DARA_EXCEPTION.getCode());
|
||||
}
|
||||
//进出门逻辑判断
|
||||
if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){
|
||||
surProjectAttendanceData.setAttendanceOutTime(labourDataVo.getAttendanceTime());
|
||||
surProjectAttendanceData.setAttendanceTime(null);
|
||||
}
|
||||
//if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){
|
||||
//surProjectAttendanceData.setAttendanceOutTime(labourDataVo.getAttendanceTime());
|
||||
surProjectAttendanceData.setAttendanceTime(labourDataVo.getAttendanceTime());
|
||||
//}
|
||||
surProjectAttendanceData.setCfgid(sysApplyConfig.getCfgId());
|
||||
surProjectAttendanceData.setAppId(sysApplyConfig.getAppId());
|
||||
surProjectAttendanceData.setProjectId(sysApplyConfig.getProjectId());
|
||||
|
@ -693,10 +693,10 @@ public class LabourApiController extends BaseController {
|
|||
throw new ServiceException("人员部门类型信息不完整",HttpStatusEnum.DARA_EXCEPTION.getCode());
|
||||
}
|
||||
//进出门逻辑判断
|
||||
if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){
|
||||
surProjectAttendanceData.setAttendanceOutTime(surProjectAttendanceData.getAttendanceTime());
|
||||
surProjectAttendanceData.setAttendanceTime(null);
|
||||
}
|
||||
//if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){
|
||||
//surProjectAttendanceData.setAttendanceOutTime(surProjectAttendanceData.getAttendanceTime());
|
||||
surProjectAttendanceData.setAttendanceTime(surProjectAttendanceData.getAttendanceTime());
|
||||
//}
|
||||
surProjectAttendanceData.setCfgid(sysApplyConfig.getCfgId());
|
||||
surProjectAttendanceData.setAppId(sysApplyConfig.getAppId());
|
||||
surProjectAttendanceData.setProjectId(sysApplyConfig.getProjectId());
|
||||
|
|
|
@ -0,0 +1,176 @@
|
|||
package com.ruoyi.web.project.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
|
||||
import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService;
|
||||
import com.yanzhu.jh.project.service.ISurProjectAttendanceUserService;
|
||||
import com.yanzhu.jh.project.service.ISurProjectDeptWroksService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @version : V1.0
|
||||
* @ClassName: ProjectDeptWroksController
|
||||
* @Description: 在岗人员
|
||||
* @Auther: JiangYuQi
|
||||
* @Date: 2020/7/7 18:03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wechat/attendance")
|
||||
public class ProjectAttendanceController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private ISurProjectDeptWroksService surProjectDeptWroksService;
|
||||
|
||||
@Autowired
|
||||
private ISurProjectAttendanceDataService attendanceDataService;
|
||||
|
||||
@Autowired
|
||||
private ISurProjectAttendanceUserService attendanceUserService;
|
||||
|
||||
/**
|
||||
* 根据项目分组查询统计
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/findSumByProjectId")
|
||||
public AjaxResult findSumByProjectId(Long projectId){
|
||||
return success(surProjectDeptWroksService.findSumByProjectId(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计劳务人员信息
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/groupAllByParams")
|
||||
public AjaxResult groupAllByParams(@RequestBody SurProjectAttendanceData where){
|
||||
String key="WECHAT_ATTENDANCE-groupAllByParams-"+where.getProjectId();
|
||||
Object obj = redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return AjaxResult.success(obj);
|
||||
}
|
||||
List<Map<String, Object>> list = attendanceDataService.groupAllByParams(where);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE*2, TimeUnit.MINUTES);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计劳务人员信息
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/findGroupAllByDays")
|
||||
public AjaxResult findGroupAllByDays(@RequestBody SurProjectAttendanceData where){
|
||||
String key="WECHAT_ATTENDANCE-findGroupAllByDays-"+where.getProjectId();
|
||||
Object obj = redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return AjaxResult.success(obj);
|
||||
}
|
||||
List<Map<String, Object>> users = attendanceUserService.findUserAllByDays(where.getProjectId());
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
where.setAttendanceOutTime(DateUtil.format(calendar.getTime(),DateUtils.YYYY_MM_DD));
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -7);
|
||||
where.setAttendanceTime(DateUtil.format(calendar.getTime(),DateUtils.YYYY_MM_DD));
|
||||
List<Map<String, Object>> list = attendanceDataService.findGroupAllByDays(where);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("list",list);
|
||||
data.put("user",users.stream().mapToInt((u) -> Integer.valueOf(String.valueOf(u.get("total")))).sum());
|
||||
redisCache.setCacheObject(key, data, Constants.BIGSCREEN_QUERY_CACHE*2, TimeUnit.MINUTES);
|
||||
return AjaxResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计劳务人员信息
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/groupUserByParams")
|
||||
public AjaxResult groupUserByParams(@RequestBody SurProjectAttendanceUser where){
|
||||
String key="WECHAT_ATTENDANCE-groupDataByParams-"+where.getProjectId()+"-"+where.getName();
|
||||
Object obj = redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return AjaxResult.success(obj);
|
||||
}
|
||||
List<Map<String, Object>> list = attendanceUserService.groupUserByParams(where);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE*2, TimeUnit.MINUTES);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 劳务人员详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/v1/attendanceUser/{id}")
|
||||
public AjaxResult attendanceUserList(@PathVariable("id") Long id){
|
||||
SurProjectAttendanceUser where = new SurProjectAttendanceUser();
|
||||
where.setId(id);
|
||||
List<SurProjectAttendanceUser> list=attendanceUserService.attendanceUserList(where);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
return success(list.get(0));
|
||||
}else{
|
||||
return error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 劳务人员列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/v1/attendanceUserList")
|
||||
public TableDataInfo attendanceUserList(SurProjectAttendanceUser where){
|
||||
startPage();
|
||||
List<SurProjectAttendanceUser> list=attendanceUserService.attendanceUserList(where);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计劳务人员信息
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/groupDataByParams")
|
||||
public AjaxResult groupDataByParams(@RequestBody SurProjectAttendanceData where){
|
||||
if(StringUtils.isEmpty(where.getWorkerId()) && StringUtils.isEmpty(where.getWorkerName()) && StringUtils.isEmpty(where.getAttendanceTime())){
|
||||
where.setAttendanceTime(DateUtil.formatDate(DateTime.now()));
|
||||
}
|
||||
String key="WECHAT_ATTENDANCE-groupDataByParams-"+where.getProjectId()+"-"+where.getWorkerName()+"-"+where.getAttendanceTime();
|
||||
Object obj = redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return AjaxResult.success(obj);
|
||||
}
|
||||
List<Map<String, Object>> list = attendanceDataService.groupDataByParams(where);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE*2, TimeUnit.MINUTES);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出勤数据列表
|
||||
*/
|
||||
@GetMapping("/v1/attendanceDataList")
|
||||
public TableDataInfo attendanceDataList(SurProjectAttendanceData where){
|
||||
startPage();
|
||||
if(StringUtils.isEmpty(where.getWorkerId()) && StringUtils.isEmpty(where.getWorkerName()) && StringUtils.isEmpty(where.getAttendanceTime())){
|
||||
where.setAttendanceTime(DateUtil.formatDate(DateTime.now()));
|
||||
}
|
||||
List<SurProjectAttendanceData> list = attendanceDataService.attendanceDataList(where);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
package com.ruoyi.web.project.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.yanzhu.jh.project.domain.SurProjectDeptWroks;
|
||||
import com.yanzhu.jh.project.service.ISurProjectDeptWroksService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @version : V1.0
|
||||
* @ClassName: ProjectDeptWroksController
|
||||
* @Description: 在岗人员
|
||||
* @Auther: JiangYuQi
|
||||
* @Date: 2020/7/7 18:03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wechat/projectDeptWroks")
|
||||
public class ProjectDeptWroksController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISurProjectDeptWroksService surProjectDeptWroksService;
|
||||
|
||||
/**
|
||||
* 查询项目在岗人员列表
|
||||
* @param surProjectDeptWroks
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SurProjectDeptWroks surProjectDeptWroks){
|
||||
if(surProjectDeptWroks.getDeptId()==0){
|
||||
surProjectDeptWroks.setDeptId(null);
|
||||
}
|
||||
return success(surProjectDeptWroksService.selectSurProjectDeptWroksList(surProjectDeptWroks));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询在岗人员详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/info")
|
||||
public AjaxResult info(Long id){
|
||||
return success(surProjectDeptWroksService.selectSurProjectDeptWroksById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增在岗人员
|
||||
* @param surProjectDeptWroks
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
@Log(title = "在岗人员", businessType = BusinessType.INSERT)
|
||||
public AjaxResult add(@RequestBody SurProjectDeptWroks surProjectDeptWroks){
|
||||
return success(surProjectDeptWroksService.deleteInsertProjectDeptWroks(surProjectDeptWroks));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除在岗人员
|
||||
*/
|
||||
@Log(title = "在岗人员", businessType = BusinessType.DELETE)
|
||||
@GetMapping("/remove")
|
||||
public AjaxResult remove(@RequestParam Long id)
|
||||
{
|
||||
return toAjax(surProjectDeptWroksService.deleteSurProjectDeptWroksById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目分组查询统计
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/findSumByProjectId")
|
||||
public AjaxResult findSumByProjectId(Long projectId){
|
||||
return success(surProjectDeptWroksService.findSumByProjectId(projectId));
|
||||
}
|
||||
|
||||
}
|
|
@ -51,7 +51,7 @@ spring:
|
|||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_jh_test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_jh?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Sxyanzhu@cf
|
||||
# 从库数据源
|
||||
|
|
|
@ -48,7 +48,6 @@ public class SurProjectController extends BaseController
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(SurProject surProject)
|
||||
{
|
||||
|
||||
surProject.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||
if(SysRoleEnum.ZGS.getCode().equals(surProject.getNowRole())){
|
||||
surProject.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId())));
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.yanzhu.jh.project.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理Mapper接口
|
||||
*
|
||||
|
@ -103,5 +103,33 @@ public interface SurProjectAttendanceDataMapper
|
|||
|
||||
public List<SurProjectAttendanceData> todayAttendance(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByDays(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByParams(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupDataByParams(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectAttendanceData> attendanceDataList(SurProjectAttendanceData where);
|
||||
|
||||
public List<SurProjectAttendanceData> groupTodayCompanyTypeId(SurProjectAttendanceData where);
|
||||
}
|
||||
|
|
|
@ -126,6 +126,27 @@ public interface SurProjectAttendanceUserMapper
|
|||
*/
|
||||
List<SurProjectAttendanceUser> queryWorkerOnDuty(SurProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(SurProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectAttendanceUser> attendanceUserList(SurProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId);
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package com.yanzhu.jh.project.service;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理Service接口
|
||||
*
|
||||
|
@ -104,6 +103,34 @@ public interface ISurProjectAttendanceDataService
|
|||
|
||||
List<SurProjectAttendanceData> todayAttendance(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupAllByParams(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByDays(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectAttendanceData> attendanceDataList(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupDataByParams(SurProjectAttendanceData where);
|
||||
|
||||
List<SurProjectAttendanceData> groupTodayCompanyTypeId(SurProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package com.yanzhu.jh.project.service;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性Service接口
|
||||
*
|
||||
|
@ -119,6 +118,27 @@ public interface ISurProjectAttendanceUserService
|
|||
*/
|
||||
public List<SurProjectAttendanceUser> queryWorkerOnDuty(SurProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(SurProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectAttendanceUser> attendanceUserList(SurProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId);
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
|
|
|
@ -350,6 +350,46 @@ public class SurProjectAttendanceDataServiceImpl implements ISurProjectAttendanc
|
|||
return surProjectAttendanceDataMapper.todayAttendance(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> groupAllByParams(SurProjectAttendanceData where) {
|
||||
return surProjectAttendanceDataMapper.findGroupAllByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> findGroupAllByDays(SurProjectAttendanceData where){
|
||||
return surProjectAttendanceDataMapper.findGroupAllByDays(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> groupDataByParams(SurProjectAttendanceData where){
|
||||
return surProjectAttendanceDataMapper.groupDataByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SurProjectAttendanceData> attendanceDataList(SurProjectAttendanceData where) {
|
||||
return surProjectAttendanceDataMapper.attendanceDataList(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SurProjectAttendanceData> groupTodayCompanyTypeId(SurProjectAttendanceData where) {
|
||||
return surProjectAttendanceDataMapper.groupTodayCompanyTypeId(where);
|
||||
|
|
|
@ -237,6 +237,35 @@ public class SurProjectAttendanceUserServiceImpl implements ISurProjectAttendanc
|
|||
return surProjectAttendanceUserMapper.queryWorkerOnDuty(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(SurProjectAttendanceUser where){
|
||||
return surProjectAttendanceUserMapper.groupUserByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SurProjectAttendanceUser> attendanceUserList(SurProjectAttendanceUser where){
|
||||
return surProjectAttendanceUserMapper.attendanceUserList(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId){
|
||||
return surProjectAttendanceUserMapper.findUserAllByDays(projectId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
|
|
|
@ -368,7 +368,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
@ -436,11 +435,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
|
||||
</select>
|
||||
|
||||
<select id="attendanceDataList" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.* from sur_project_attendance_data_${year} ady
|
||||
where ady.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
<if test="companyTypeId==101">
|
||||
and ady.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and ady.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and ady.companyTypeId =8
|
||||
</if>
|
||||
<if test="workerId != null and workerId != ''"> and ady.workerId = #{workerId}</if>
|
||||
<if test="workerName != null and workerName != ''"> and ady.workerName like concat('%', #{workerName}, '%')</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) = date(#{attendanceTime})</if>
|
||||
and ady.is_del=0
|
||||
order by ady.id desc
|
||||
</select>
|
||||
|
||||
<select id="groupTodayCompanyTypeId" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady
|
||||
left join sur_project sp on sp.id = ady.projectId
|
||||
where sp.isDel=0 and sp.progressVisible=0
|
||||
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and ady.projectId=#{projectId}
|
||||
</if>
|
||||
|
@ -459,4 +476,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
group by ady.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findGroupAllByParams" parameterType="SurProjectAttendanceData" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '2' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=1
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
and date(d.attendance_time) = date(now())
|
||||
group by d.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="groupDataByParams" parameterType="SurProjectAttendanceData" resultType="Map">
|
||||
select d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(d.attendance_time) = date(#{attendanceTime})</if>
|
||||
<if test="workerName != null and workerName != ''"> and d.workerName like concat('%', #{workerName}, '%')</if>
|
||||
group by d.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findGroupAllByDays" parameterType="SurProjectAttendanceData" resultType="Map">
|
||||
select '3' as type, DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
|
||||
select date(d.attendance_time) as attendanceTime, DATE_FORMAT(d.attendance_time, '%m-%d'),count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
and date(d.attendance_time) between #{attendanceTime} and #{attendanceOutTime}
|
||||
group by date(d.attendance_time)
|
||||
order by date(d.attendance_time)
|
||||
)days
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -651,7 +651,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
|
||||
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
|
||||
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.isDel=0 and sp.progressVisible=0 and b.project_id = sp.id
|
||||
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id
|
||||
<if test="id==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
|
@ -674,14 +674,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="attendanceUserList" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
|
||||
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName,g.companyTypeId
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
|
||||
WHERE u.cfgid=b.id and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id
|
||||
<if test="companyTypeId==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and b.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="id != null"> and u.id = #{id}</if>
|
||||
<if test="state != null "> and u.state = #{state}</if>
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<select id="groupByWorkerOnDutyByDept" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT p.id, p.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project p,sys_dept c
|
||||
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.sub_dept_id
|
||||
and p.isDel=0 and p.progressVisible=0
|
||||
and p.isDel=0
|
||||
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and p.deptId=#{deptId}
|
||||
|
@ -697,4 +724,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by p.id
|
||||
</select>
|
||||
|
||||
<select id="groupUserByParams" parameterType="SurProjectAttendanceUser" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '2' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=1
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findUserAllByDays" parameterType="Long" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue