人员入场考勤

This commit is contained in:
haozq 2025-12-29 17:58:43 +08:00
parent b86e7be4ae
commit 0c914a7094
7 changed files with 85 additions and 2 deletions

View File

@ -53,6 +53,23 @@ public class SelectController extends BaseController {
return error("系统异常,请联系管理员");
}
@PostMapping("/selectDgcPro")
@SysLog(title = "工程查询", businessType = OperaType.UPDATE, logType = 0, module = "下拉选公用类->多工程入场")
public AjaxResult selectDgcPro(@Validated @RequestBody MapBeanPo po) {
try {
Map<String,String> map = dealWithPermission();
if(!map.isEmpty()){
// 3. map 中的值复制到 o 对象中
org.apache.commons.beanutils.BeanUtils.populate(po, map);
}
List<MapBeanVo> list = service.selectDgcPro(po);
return new AjaxResult(200,"查询成功",list);
} catch (Exception e) {
logger.error(e.toString(), e);
}
return error("系统异常,请联系管理员");
}
/**
* 查询分包下拉框

View File

@ -42,4 +42,11 @@ public interface SelectMapper {
* @return
*/
List<MapBeanVo> selectOrg(MapBeanPo po);
/**
* 允许多工程入场的工程
* @param po
* @return
*/
List<MapBeanVo> selectDgcPro(MapBeanPo po);
}

View File

@ -41,4 +41,11 @@ public interface SelectService {
* @return
*/
List<MapBeanVo> selectOrg(MapBeanPo po);
/**
* 查询多工程入场
* @param po
* @return
*/
List<MapBeanVo> selectDgcPro(MapBeanPo po);
}

View File

@ -245,6 +245,9 @@ public class PmWorkerServiceImpl implements PmWorkerService{
if("1".equals(worker.getIsShanghai())){
//可能已入场多个该工程把工程都查回来
List<MapBeanVo> projectList = mapper.getProListByWorkerId(worker.getId());
StringBuilder sb = new StringBuilder();
for (MapBeanVo mapBeanVo : projectList) {
sb.append(mapBeanVo.getName());

View File

@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
@ -46,4 +47,9 @@ public class SelectServiceImpl implements SelectService {
public List<MapBeanVo> selectOrg(MapBeanPo po) {
return mapper.selectOrg(po);
}
@Override
public List<MapBeanVo> selectDgcPro(MapBeanPo po) {
return mapper.selectDgcPro(po);
}
}

View File

@ -190,11 +190,12 @@
from bm_att_person
where device_code=#{deviceCode}
<if test="userName!=null and userName!=''">
and name like concat('%'#{userName},'%')
and name like concat('%',#{userName},'%')
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and att_day between #{startTime} and #{endTime}
</if>
order by att_time desc
</select>
<select id="getWrcKqList" resultType="com.bonus.bmw.domain.vo.KqCmdBean">
select worker_id userId,device_code deviceCode,att_day attDay,att_time attTime
@ -203,5 +204,6 @@
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and att_day between #{startTime} and #{endTime}
</if>
order by att_time desc
</select>
</mapper>

View File

@ -1,7 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.bmw.mapper.SelectMapper">
<select id="selectDgcPro" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
select
distinct
pp.id,
pp.pro_name as `name`
from pm_project pp
left join tb_pro_config_real pcr
on pcr.sub_id=pp.sub_com_id
and pcr.pro_type=pp.pro_type
and pcr.pro_area=pp.is_shanghai
and pcr.type=1 -- 将pcr的过滤条件移至连接条件保留左连接特性
<if test="subId != null">
-- 改为left join避免数据丢失将bsc的筛选条件移至连接条件
left join bm_sub_contract bsc
on pp.id = bsc.pro_id
and bsc.sub_ein_status = 1
and bsc.is_active = 1
and bsc.sub_id = #{subId}
</if>
<if test="workerId != null">
Left join bm_worker_ein_msg bwem
on pp.id = bwem.pro_id
and bwem.is_active = 1
and bwem.worker_id = #{workerId}
</if>
<where>
pp.is_active = 1
and pp.pro_status != 4
<if test="subComId != null">
and pp.sub_com_id = #{subComId}
</if>
<if test="subId != null">
-- 若需强制筛选有分包合同的项目,保留该条件;否则可删除
and bsc.pro_id is not null
</if>
<if test="workerId != null">
and bwem.pro_id is null
and pcr.is_need=1
</if>
</where>
</select>
<select id="selectPro" resultType="com.bonus.bmw.domain.vo.MapBeanVo">
select
distinct
@ -90,4 +130,5 @@
</if>
</select>
</mapper>