权限管理,功能优化
This commit is contained in:
parent
397766e40a
commit
0045746422
|
|
@ -13,12 +13,16 @@ import com.bonus.common.security.annotation.InnerAuth;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.bonus.bmw.utils.OwnPermissionUtil.dealWithPermission;
|
||||
|
||||
/**
|
||||
* 考勤机
|
||||
|
|
@ -41,6 +45,11 @@ public class PmAttDeviceController extends BaseController {
|
|||
@SysLog(title = "考勤机", businessType = OperaType.QUERY, logType = 0, module = "考勤机->考勤机列表")
|
||||
public TableDataInfo list(PmAttDevice pmAttDevice) {
|
||||
try {
|
||||
Map<String,String> map = dealWithPermission();
|
||||
if(!map.isEmpty()){
|
||||
// 3. 将 map 中的值复制到 o 对象中
|
||||
BeanUtils.populate(pmAttDevice, map);
|
||||
}
|
||||
startPage();
|
||||
List<PmAttDeviceVo> list = pmAttDeviceService.selectPmAttDeviceList(pmAttDevice);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.bonus.common.security.annotation.InnerAuth;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -20,6 +21,9 @@ import javax.annotation.Resource;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.bonus.bmw.utils.OwnPermissionUtil.dealWithPermission;
|
||||
|
||||
/**
|
||||
* 项目部
|
||||
|
|
@ -42,6 +46,11 @@ public class PmOrgController extends BaseController {
|
|||
@SysLog(title = "项目部管理", businessType = OperaType.QUERY, logType = 0, module = "项目部管理->项目部列表")
|
||||
public TableDataInfo list(PmOrg pmOrg) {
|
||||
try {
|
||||
Map<String,String> map = dealWithPermission();
|
||||
if(!map.isEmpty()){
|
||||
// 3. 将 map 中的值复制到 o 对象中
|
||||
BeanUtils.populate(pmOrg, map);
|
||||
}
|
||||
startPage();
|
||||
List<PmOrgVo> list = pmOrgService.selectPmOrgList(pmOrg);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import com.bonus.common.security.annotation.InnerAuth;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ public class PmProjectController extends BaseController {
|
|||
Map<String,String> map = dealWithPermission();
|
||||
if(!map.isEmpty()){
|
||||
// 3. 将 map 中的值复制到 o 对象中
|
||||
BeanUtils.copyProperties(map, pmProject);
|
||||
BeanUtils.populate(pmProject, map);
|
||||
}
|
||||
startPage();
|
||||
List<PmProjectVo> list = pmProjectService.selectProjectList(pmProject);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.bmw.controller;
|
|||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSub;
|
||||
import com.bonus.bmw.service.PmSubService;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
|
|
@ -129,4 +130,19 @@ public class PmSubController extends BaseController {
|
|||
logger.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工程查询分包商下拉框
|
||||
*/
|
||||
@GetMapping("/getSublistByProId")
|
||||
@SysLog(title = "分包商管理", businessType = OperaType.QUERY, logType = 0, module = "分包商管理->分包商列表")
|
||||
public TableDataInfo getSublistByProId(BmSubContract bmSubContract) {
|
||||
try {
|
||||
List<PmSub> list = pmSubService.getSublistByProId(bmSubContract);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public class PmSubTeamContractController extends BaseController {
|
|||
logger.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取班组人员出入场信息
|
||||
*/
|
||||
|
|
@ -132,4 +132,19 @@ public class PmSubTeamContractController extends BaseController {
|
|||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工程和分包商获取所有班组
|
||||
*/
|
||||
@GetMapping("/getSubTeamContractList")
|
||||
@SysLog(title = "分包班组入场信息", businessType = OperaType.UPDATE, logType = 0, module = "分包班组入场信息->获取班组人员出入场信息")
|
||||
public AjaxResult getSubTeamContractList(PmSubTeamContract pmSubTeamContract) {
|
||||
try {
|
||||
List<PmSubTeamContract> res = pmSubTeamContractService.getSubTeamContractList(pmSubTeamContract);
|
||||
return success(res);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,5 +78,4 @@ public class PmAttDevice {
|
|||
* 在线状态
|
||||
*/
|
||||
private String onLine;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,4 +80,14 @@ public class PmAttDeviceVo {
|
|||
* 在线状态
|
||||
*/
|
||||
private String onLine;
|
||||
|
||||
/**
|
||||
* 分包商id
|
||||
*/
|
||||
private Integer subId;
|
||||
|
||||
/**
|
||||
* 班组id
|
||||
*/
|
||||
private Integer teamId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSub;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -43,4 +44,5 @@ public interface PmSubMapper {
|
|||
|
||||
List<PmSub> selectSubListAll(PmSub pmSub);
|
||||
|
||||
List<PmSub> getSublistByProId(BmSubContract bmSubContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,4 +31,6 @@ public interface PmSubTeamContractMapper {
|
|||
List<PmWorker> getPmWorkerByTeamId(Integer id);
|
||||
|
||||
Integer countProNum(PmSubTeamContract pmSubTeamContract);
|
||||
|
||||
List<PmSubTeamContract> getSubTeamContractList(PmSubTeamContract pmSubTeamContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSub;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -35,4 +36,5 @@ public interface PmSubService {
|
|||
*/
|
||||
List<PmSub> selectSubListAll(PmSub pmSub);
|
||||
|
||||
List<PmSub> getSublistByProId(BmSubContract bmSubContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,6 @@ public interface PmSubTeamContractService {
|
|||
PmSubTeamContract getSubTeamContractById(PmSubTeamContract pmSubTeamContract);
|
||||
|
||||
Map<String, Object> getPeoNum(PmSubTeamContract pmSubTeamContract);
|
||||
|
||||
List<PmSubTeamContract> getSubTeamContractList(PmSubTeamContract pmSubTeamContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,4 +135,9 @@ public class PmSubServiceImpl implements PmSubService {
|
|||
public List<PmSub> selectSubListAll(PmSub pmSub) {
|
||||
return pmSubMapper.selectSubListAll(pmSub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmSub> getSublistByProId(BmSubContract bmSubContract) {
|
||||
return pmSubMapper.getSublistByProId(bmSubContract);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,4 +109,9 @@ public class PmSubTeamContractServiceImpl implements PmSubTeamContractService {
|
|||
map.put("perNum",perNum);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmSubTeamContract> getSubTeamContractList(PmSubTeamContract pmSubTeamContract) {
|
||||
return pmSubTeamContractMapper.getSubTeamContractList(pmSubTeamContract);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class OwnPermissionUtil {
|
|||
Map<String,String> map=new HashMap<>();
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
if("公司级".equals(sysUser.getRoleLevel())){
|
||||
|
||||
map.put("comId",sysUser.getCompanyId().toString());
|
||||
}else if("分公司级".equals(sysUser.getRoleLevel())){
|
||||
map.put("subComId", sysUser.getBandId());
|
||||
}else if("项目部级".equals(sysUser.getRoleLevel())){
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
<mapper namespace="com.bonus.bmw.mapper.PmAttDeviceMapper">
|
||||
<insert id="addPmAttDevice">
|
||||
insert into pm_att_device (device_code, device_name,serial_number, pro_id,create_user, update_user,
|
||||
create_time, update_time,dev_model,on_line)
|
||||
create_time, update_time,dev_model,on_line,sub_id,team_id)
|
||||
values (#{deviceCode}, #{deviceName},#{serialNumber},#{proId}, #{createUser}, #{updateUser},
|
||||
#{createTime}, #{updateTime},#{devModel},#{onLine})
|
||||
#{createTime}, #{updateTime},#{devModel},#{onLine},#{subId},#{teamId})
|
||||
</insert>
|
||||
<insert id="addPmAttDeviceHis">
|
||||
insert into pm_att_device_his (device_code, device_name,serial_number, pro_id,create_user, update_user,
|
||||
create_time, update_time)
|
||||
create_time, update_time,sub_id,team_id)
|
||||
values (#{deviceCode}, #{deviceName},#{serialNumber},#{proId}, #{createUser}, #{updateUser},
|
||||
#{createTime}, #{updateTime})
|
||||
#{createTime}, #{updateTime},#{subId},#{teamId})
|
||||
</insert>
|
||||
<update id="updatePmAttDevice">
|
||||
update pm_att_device set pro_id = #{proId},update_time = #{updateTime},update_user = #{updateUser}
|
||||
|
|
@ -29,7 +29,9 @@
|
|||
pp.pro_name as proName,
|
||||
pp.is_shanghai as isShanghai,
|
||||
pad2.update_user as updateUser,
|
||||
pad2.update_time as updateTime
|
||||
pad2.update_time as updateTime,
|
||||
pad2.sub_id as subId,
|
||||
pad2.team_id as teamId
|
||||
from pm_att_device pad2
|
||||
left join pm_project pp on pp.id = pad2.pro_id
|
||||
where pad2.is_active = '1'
|
||||
|
|
@ -48,13 +50,21 @@
|
|||
<if test="isShanghai!=null and isShanghai!=''">
|
||||
and pp.is_shanghai LIKE CONCAT('%', #{isShanghai}, '%')
|
||||
</if>
|
||||
<if test="onLine!=null and onLine!=''">
|
||||
and pp.on_line = #{onLine}
|
||||
</if>
|
||||
<if test="proId!=null ">
|
||||
and (pad2.pro_id = #{proId} or pad2.pro_id is null)
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPmAttDeviceByCoode" resultType="com.bonus.bmw.domain.po.PmAttDevice">
|
||||
select pad2.device_code as deviceCode,
|
||||
pad2.device_name as deviceName,
|
||||
pad2.pro_id as proId,
|
||||
pad2.update_user as updateUser,
|
||||
pad2.update_time as updateTime
|
||||
pad2.update_time as updateTime,
|
||||
pad2.sub_id as subId,
|
||||
pad2.team_id as teamId
|
||||
from pm_att_device pad2
|
||||
where pad2.is_active = '1' and pad2.device_code = #{deviceCode}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -85,4 +85,10 @@
|
|||
select id,sub_name
|
||||
from pm_sub where is_active='1'
|
||||
</select>
|
||||
<select id="getSublistByProId" resultType="com.bonus.bmw.domain.po.PmSub">
|
||||
select ps.id as id,ps.sub_name as subName
|
||||
from bm_sub_contract bsc
|
||||
left join pm_sub ps on bsc.sub_id= ps.id
|
||||
where bsc.is_active ='1' and bsc.pro_id = #{proId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -61,4 +61,8 @@
|
|||
<select id="countProNum" resultType="java.lang.Integer">
|
||||
select count(1) from bm_worker_ein_pro_record where is_active='1' and team_id = #{teamId} and ein_status!=2
|
||||
</select>
|
||||
<select id="getSubTeamContractList" resultType="com.bonus.bmw.domain.po.PmSubTeamContract">
|
||||
select team_id,team_name from pm_sub_team_contract
|
||||
where is_active = '1' and sub_id = #{subId} and pro_id = #{proId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue