1.添加权限的尝试
This commit is contained in:
parent
f9e2dd0ce7
commit
45ecb4c3ee
|
|
@ -19,6 +19,12 @@
|
|||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
|
||||
<!--加密依赖包-->
|
||||
<dependency>
|
||||
<groupId>com.github.ulisesbocchio</groupId>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.bonus.bmw.controller;
|
|||
|
||||
import com.bonus.bmw.domain.vo.*;
|
||||
import com.bonus.bmw.service.BmWorkerAttService;
|
||||
import com.bonus.bmw.service.BmWorkerAttService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
|
|
@ -20,9 +19,13 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.bonus.bmw.utils.OwnPermissionUtil.dealWithPermission;
|
||||
|
||||
/**
|
||||
* 考勤统计
|
||||
*
|
||||
|
|
@ -48,6 +51,12 @@ public class BmWorkerAttController extends BaseController {
|
|||
@SysLog(title = "考勤统计", businessType = OperaType.QUERY, logType = 0, module = "施工人员->考勤管理->考勤统计", details = "分公司考勤统计")
|
||||
public TableDataInfo getSubComAttList(BmWorkerAtt o) {
|
||||
try {
|
||||
Map<String,Integer> map= dealWithPermission();
|
||||
if(!map.isEmpty()){
|
||||
// 3. 将 map 中的值复制到 o 对象中
|
||||
// 一行代码搞定!自动将 map 的 key 匹配到 bean 的属性并赋值
|
||||
org.apache.commons.beanutils.BeanUtils.populate(o, map);
|
||||
}
|
||||
startPage();
|
||||
List<BmWorkerAtt> list = service.getSubComAttList(o);
|
||||
return getDataTable(list);
|
||||
|
|
@ -57,7 +66,6 @@ public class BmWorkerAttController extends BaseController {
|
|||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表-工程
|
||||
* @param o
|
||||
|
|
@ -68,6 +76,11 @@ public class BmWorkerAttController extends BaseController {
|
|||
@SysLog(title = "工程考勤统计", businessType = OperaType.QUERY, logType = 0, module = "施工人员->考勤管理->考勤统计", details = "工程考勤统计")
|
||||
public TableDataInfo getProAttList(BmWorkerAtt o) {
|
||||
try {
|
||||
Map<String,Integer> map=dealWithPermission();
|
||||
if(!map.isEmpty()){
|
||||
// 3. 将 map 中的值复制到 o 对象中
|
||||
BeanUtils.copyProperties(map, o);
|
||||
}
|
||||
startPage();
|
||||
List<BmWorkerAtt> list = service.getProAttList(o);
|
||||
return getDataTable(list);
|
||||
|
|
@ -161,6 +174,11 @@ public class BmWorkerAttController extends BaseController {
|
|||
@SysLog(title = "考勤导出-工程维度", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "考勤导出-工程维度")
|
||||
public void attExportByPro(HttpServletResponse response, BmWorkerAtt o) {
|
||||
try {
|
||||
Map<String,Integer> map=dealWithPermission();
|
||||
if(!map.isEmpty()){
|
||||
// 3. 将 map 中的值复制到 o 对象中
|
||||
BeanUtils.copyProperties(map, o);
|
||||
}
|
||||
List<BmWorkerAtt> list = service.getProAttList(o);
|
||||
List<BmWorkerAttProExport> exportList = list.stream()
|
||||
.map(worker -> {
|
||||
|
|
|
|||
|
|
@ -169,4 +169,6 @@ public class BmWorkerAtt {
|
|||
*/
|
||||
private Integer teamEinStatus;
|
||||
|
||||
private Integer orgId;
|
||||
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ public class BmWorkerAttServiceImpl implements BmWorkerAttService {
|
|||
@Override
|
||||
public List<BmWorkerAtt> getWorkerAttList(BmWorkerAtt o) {
|
||||
//1.查询 工程 班组 时间区间 姓名 身份证号码
|
||||
//根据区间产讯处最新的人员基础数据
|
||||
//根据区间查询最新的人员基础数据
|
||||
List<BmWorkerAtt> list = mapper.getWorkerEinMsgListByDateRange(o);
|
||||
//查询考勤天数 根据 时间区间 工程 班组 查询
|
||||
List<BmWorkerAtt> listAtt = mapper.getWorkerAttDayNumByDateRange(o);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.bonus.bmw.utils;
|
||||
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class OwnPermissionUtil {
|
||||
|
||||
public static Map<String, Integer> dealWithPermission() {
|
||||
Map<String,Integer> map=new HashMap<>();
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
if("公司级".equals(sysUser.getRoleLevel())){
|
||||
|
||||
}else if("分公司级".equals(sysUser.getRoleLevel())){
|
||||
map.put("subComId", Math.toIntExact(sysUser.getBandId()));
|
||||
}else if("项目部级".equals(sysUser.getRoleLevel())){
|
||||
map.put("subComId", Math.toIntExact(sysUser.getAffCompany()));
|
||||
map.put("orgId", Math.toIntExact(sysUser.getBandId()));
|
||||
}else if("分包商级".equals(sysUser.getRoleLevel())){
|
||||
|
||||
}else if("施工人员级".equals(sysUser.getRoleLevel())){
|
||||
map.put("subComId", Math.toIntExact(sysUser.getAffCompany()));
|
||||
map.put("proId", Math.toIntExact(sysUser.getBandId()));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -57,6 +57,9 @@
|
|||
LEFT JOIN bm_att_person bap ON bap.pro_id = pp.id AND bap.att_day = #{startDate}
|
||||
WHERE
|
||||
psc.is_active = 1
|
||||
<if test="subComId != null and subComId != ''">
|
||||
AND psc.id = #{subComId}
|
||||
</if>
|
||||
GROUP BY
|
||||
psc.id
|
||||
</select>
|
||||
|
|
@ -65,7 +68,7 @@
|
|||
SELECT
|
||||
pp.id as pro_id,
|
||||
pp.pro_name,
|
||||
pp.pro_status,
|
||||
pp.pro_status,
|
||||
ps.sub_name,
|
||||
pst.id as team_id,
|
||||
pst.team_name,
|
||||
|
|
@ -80,7 +83,6 @@
|
|||
AND bsc.pro_id = bstc.pro_id
|
||||
AND bstc.is_active = 1
|
||||
LEFT JOIN pm_sub_team pst ON pst.id = bstc.team_id
|
||||
<!-- LEFT JOIN bm_worker_ein_msg bwem ON pp.id = bwem.pro_id-->
|
||||
LEFT JOIN bm_worker_ein_day_record bwem ON pp.id = bwem.pro_id and bwem.ein_day = #{startDate}
|
||||
LEFT JOIN bm_att_person bap ON bap.pro_id = pp.id AND bap.att_day = #{startDate}
|
||||
WHERE
|
||||
|
|
@ -89,6 +91,9 @@
|
|||
<if test="proName != null and proName !=''">
|
||||
AND pp.pro_name LIKE CONCAT('%',#{proName},'%')
|
||||
</if>
|
||||
<if test="orgId != null and orgId !=''">
|
||||
AND pp.org_id = #{orgId}
|
||||
</if>
|
||||
GROUP BY
|
||||
bstc.id
|
||||
</select>
|
||||
|
|
@ -123,7 +128,6 @@
|
|||
</select>
|
||||
|
||||
<select id="getWorkerEinMsgListByDateRange" resultMap="BaseResultMap">
|
||||
|
||||
SELECT
|
||||
bwedr.worker_id,
|
||||
bwedr.id_number,
|
||||
|
|
@ -171,6 +175,12 @@
|
|||
WHERE
|
||||
a.att_day >= #{startDate}
|
||||
AND a.att_day <= #{endDate}
|
||||
<if test="proId != null and proId != ''">
|
||||
and a.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="teamId != null and teamId != ''">
|
||||
and a.team_id = #{teamId}
|
||||
</if>
|
||||
GROUP BY
|
||||
a.worker_id
|
||||
</select>
|
||||
|
|
@ -203,7 +213,7 @@
|
|||
and bwedr.pro_id = #{proId}
|
||||
</if>
|
||||
GROUP BY
|
||||
bwedr.worker_id
|
||||
bwedr.worker_id,bwedr.ein_day
|
||||
</select>
|
||||
|
||||
<select id="getTeamAttListBySevenNotAtt" resultMap="BaseResultMap">
|
||||
|
|
|
|||
Loading…
Reference in New Issue