报表权限
This commit is contained in:
parent
41ea12a1ed
commit
76fe998670
|
|
@ -7,7 +7,6 @@ import com.bonus.common.core.utils.ServletUtils;
|
|||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.back.domain.BackApplyInfo;
|
||||
import com.bonus.material.basic.domain.report.*;
|
||||
import com.bonus.material.basic.service.BmReportService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -275,9 +274,10 @@ public class BmReportController extends BaseController {
|
|||
@GetMapping("/getBackInputList")
|
||||
public AjaxResult getBackInputList(BackInputInfo bean) {
|
||||
bean.setIsExport(1);
|
||||
startPage();
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
List<BackInputInfo> pageList = bmReportService.getBackInputList(bean);
|
||||
return AjaxResult.success(getDataTable(pageList));
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, pageList));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public class ComplexQueryController extends BaseController {
|
|||
@GetMapping("/getRetainedEquipmentListNoPage")
|
||||
public AjaxResult getRetainedEquipmentListNoPage(RetainedEquipmentInfo bean) {
|
||||
bean.setIsExport(0);
|
||||
bean.setUserId( SecurityUtils.getLoginUser().getUserid());
|
||||
List<RetainedEquipmentInfo> list = complexQueryService.getRetainedEquipmentList(bean);
|
||||
RetainedEquipmentInfo dto = new RetainedEquipmentInfo();
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
|
|
@ -91,6 +92,7 @@ public class ComplexQueryController extends BaseController {
|
|||
@PostMapping("/exportRetainedEquipmentList")
|
||||
public void exportRetainedEquipmentList(HttpServletResponse response, RetainedEquipmentInfo bean)
|
||||
{
|
||||
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
bean.setIsExport(0);
|
||||
List<RetainedEquipmentInfo> list = complexQueryService.getRetainedEquipmentList(bean);
|
||||
ExcelUtil<RetainedEquipmentInfo> util = new ExcelUtil<>(RetainedEquipmentInfo.class);
|
||||
|
|
@ -304,6 +306,8 @@ public class ComplexQueryController extends BaseController {
|
|||
@ApiOperation(value = "综合查询--工程机具使用列表不带分页")
|
||||
@GetMapping("/getProjUsingRecordListNoPage")
|
||||
public AjaxResult getProjUsingRecordListNoPage(ProjUsingRecord bean) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
bean.setUserId(loginUser.getUserid());
|
||||
List<ProjUsingRecord> list = complexQueryService.exportProjUsingRecord(bean);
|
||||
ProjUsingDto projUsingDto = new ProjUsingDto();
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
|
|
@ -326,6 +330,7 @@ public class ComplexQueryController extends BaseController {
|
|||
@PostMapping("/exportProjUsingRecord")
|
||||
public void exportProjUsingRecord(HttpServletResponse response, ProjUsingRecord bean)
|
||||
{
|
||||
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
List<ProjUsingRecord> list = complexQueryService.exportProjUsingRecord(bean);
|
||||
ExcelUtil<ProjUsingRecord> util = new ExcelUtil<>(ProjUsingRecord.class);
|
||||
util.exportExcel(response, list, "综合查询--工程机具使用查询");
|
||||
|
|
@ -339,6 +344,7 @@ public class ComplexQueryController extends BaseController {
|
|||
@ApiOperation(value = "综合查询--设备使用追溯查询")
|
||||
@GetMapping("/getMachineHistoryRecordList")
|
||||
public AjaxResult getMachineHistoryRecordList(MachineHistoryRecordBean bean) {
|
||||
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
startPage();
|
||||
List<MachineHistoryRecordBean> list = complexQueryService.getMachineHistoryRecordList(bean);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
|
|
@ -353,6 +359,7 @@ public class ComplexQueryController extends BaseController {
|
|||
@PostMapping("/exportMachineHistoryRecord")
|
||||
public void exportMachineHistoryRecord(HttpServletResponse response, MachineHistoryRecordBean bean)
|
||||
{
|
||||
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
List<MachineHistoryRecordBean> list = complexQueryService.getMachineHistoryRecordList(bean);
|
||||
ExcelUtil<MachineHistoryRecordBean> util = new ExcelUtil<>(MachineHistoryRecordBean.class);
|
||||
util.exportExcel(response, list, "综合查询--设备使用追溯查询");
|
||||
|
|
|
|||
|
|
@ -97,4 +97,6 @@ public class MachineHistoryRecordBean {
|
|||
|
||||
@ApiModelProperty(value="关键字")
|
||||
private String keyWord;
|
||||
|
||||
private Long userId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,4 +77,7 @@ public class BackInputInfo {
|
|||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,4 +93,7 @@ public class LeaseOutInfo {
|
|||
|
||||
@ApiModelProperty(value = "任务类型")
|
||||
private int taskType;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,4 +99,6 @@ public class PurChaseReportInfo {
|
|||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
private Long userId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,4 +90,7 @@ public class RepairInfo {
|
|||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,4 +78,7 @@ public class RepairInputDto {
|
|||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,4 +101,7 @@ public class ScrapInfo {
|
|||
/** 维修ID */
|
||||
@ApiModelProperty(value = "维修ID")
|
||||
private Long repairId;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,4 +145,11 @@ public interface ComplexQueryMapper {
|
|||
* @return
|
||||
*/
|
||||
String getPartInfoList(MaTypeSelectInfo dto);
|
||||
|
||||
/**
|
||||
* 查询用户权限
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectTypeIdList(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.alibaba.nacos.common.utils.CollectionUtils;
|
|||
import com.bonus.common.biz.domain.BmFileInfo;
|
||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.report.*;
|
||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.basic.mapper.BmReportMapper;
|
||||
|
|
@ -36,6 +37,7 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
*/
|
||||
@Override
|
||||
public List<PurChaseReportInfo> getPurChaseReportList(PurChaseReportInfo bean) {
|
||||
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
BigDecimal totalPurchaseNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalPassNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
|
|
@ -114,11 +116,15 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
*/
|
||||
@Override
|
||||
public List<LeaseOutInfo> getLeaseOutList(LeaseOutInfo bean) {
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
BigDecimal totalLeaseNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalOutNumNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalPendingOutNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
List<LeaseOutInfo> list = bmReportMapper.getLeaseOutList(bean);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 将list集合中userId不为空,且和userId相等的数据过滤处理
|
||||
list = list.stream().filter(item -> item.getUserId() != null && item.getUserId().equals(userId))
|
||||
.collect(Collectors.toList());
|
||||
for (LeaseOutInfo leaseOutInfo : list) {
|
||||
totalLeaseNum = totalLeaseNum.add(leaseOutInfo.getLeaseNum());
|
||||
totalOutNumNum = totalOutNumNum.add(leaseOutInfo.getOutNum());
|
||||
|
|
@ -177,9 +183,12 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
*/
|
||||
@Override
|
||||
public List<BackInputInfo> getBackInputList(BackInputInfo bean) {
|
||||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||
BigDecimal totalBackNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
List<BackInputInfo> list = bmReportMapper.getBackInputList(bean);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list = list.stream().filter(item -> item.getUserId() != null && item.getUserId().equals(userid))
|
||||
.collect(Collectors.toList());
|
||||
for (BackInputInfo backInputInfo : list) {
|
||||
totalBackNum = totalBackNum.add(backInputInfo.getBackNum());
|
||||
}
|
||||
|
|
@ -210,6 +219,7 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
*/
|
||||
@Override
|
||||
public List<RepairInfo> getRepairList(RepairInfo bean) {
|
||||
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
BigDecimal totalBackNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalRepairedNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalPendingScrapNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
|
|
@ -252,6 +262,7 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
*/
|
||||
@Override
|
||||
public List<RepairInputDto> getRepairInputList(RepairInputDto bean) {
|
||||
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
BigDecimal totalRepairedNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalPendingInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
|
|
@ -291,6 +302,7 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
*/
|
||||
@Override
|
||||
public List<ScrapInfo> getScrapList(ScrapInfo bean) {
|
||||
bean.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
BigDecimal totalScrapNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
List<ScrapInfo> list = bmReportMapper.getScrapList(bean);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
|
|
|
|||
|
|
@ -38,8 +38,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM bm_storage_log
|
||||
GROUP BY task_id, type_id
|
||||
) a ON pcd.task_id = a.task_id AND pcd.type_id = a.type_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
|
||||
WHERE
|
||||
pcd.check_num > 0
|
||||
<if test="userId != null ">
|
||||
and mtm.user_id = #{userId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt2.type_name LIKE CONCAT('%', #{keyWord}, '%')
|
||||
|
|
@ -208,7 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt1.manage_type as manageType,
|
||||
lad.parent_id as parentId,
|
||||
lad.type_id as typeId,
|
||||
tt.task_type as taskType
|
||||
tt.task_type as taskType,
|
||||
mtm.user_id as userId
|
||||
FROM
|
||||
lease_apply_details lad
|
||||
LEFT JOIN ma_type mt1 ON lad.type_id = mt1.type_id
|
||||
|
|
@ -223,9 +230,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN ( SELECT parent_id, type_id, GROUP_CONCAT( DISTINCT create_by ) AS createBy, MAX( create_time ) AS createTime FROM lease_out_details GROUP BY parent_id, type_id ) a ON a.parent_id = lad.parent_id
|
||||
AND a.type_id = lad.type_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
|
||||
WHERE
|
||||
1 = 1
|
||||
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
|
|
@ -272,7 +281,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bai.`code` as code,
|
||||
bad.parent_id as parentId,
|
||||
bad.type_id as typeId,
|
||||
mt1.manage_type as manageType
|
||||
mt1.manage_type as manageType,
|
||||
mtm.user_id as userId
|
||||
FROM
|
||||
back_apply_details bad
|
||||
LEFT JOIN ma_type mt1 ON bad.type_id = mt1.type_id
|
||||
|
|
@ -284,8 +294,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id
|
||||
LEFT JOIN bm_unit bu ON ba.unit_id = bu.unit_id
|
||||
LEFT JOIN bm_project bp ON ba.project_id = bp.pro_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
|
||||
WHERE
|
||||
1 = 1
|
||||
mt2.type_name is not null and mt1.type_name is not null
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt2.type_name LIKE CONCAT('%', #{keyWord}, '%')
|
||||
|
|
@ -360,8 +373,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id
|
||||
LEFT JOIN bm_unit bu ON ba.unit_id = bu.unit_id
|
||||
LEFT JOIN bm_project bp ON ba.project_id = bp.pro_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="userId != null ">
|
||||
and mtm.user_id = #{userId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt2.type_name LIKE CONCAT('%', #{keyWord}, '%')
|
||||
|
|
@ -430,8 +449,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN tm_task tt on rid.task_id = tt.task_id
|
||||
LEFT JOIN ( SELECT task_id, type_id, GROUP_CONCAT( DISTINCT creator ) AS creator, MAX( create_time ) AS create_time FROM bm_storage_log GROUP BY task_id, type_id) a ON rid.task_id = a.task_id
|
||||
AND rid.type_id = a.type_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="userId != null ">
|
||||
and mtm.user_id = #{userId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt2.type_name LIKE CONCAT('%', #{keyWord}, '%')
|
||||
|
|
@ -522,8 +547,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND bpi.del_flag = '0'
|
||||
LEFT JOIN ma_machine mm ON sad.ma_id = mm.ma_id
|
||||
LEFT JOIN repair_audit_details rad ON rad.id = sad.parent_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt1.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
|
||||
WHERE
|
||||
sad.ledger_status = '1'
|
||||
<if test="userId != null ">
|
||||
and mtm.user_id = #{userId}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[AND DATE_FORMAT(sad.create_time, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}]]>
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -110,9 +110,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
|
||||
LEFT JOIN back_apply_info baif ON baif.id = sai.back_id
|
||||
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
|
||||
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt3.parent_id = mtm.type_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND sai.ma_id IS NOT NULL
|
||||
<if test="userId != null">
|
||||
and mtm.user_id = #{userId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (bai.agreement_code like concat('%',#{keyWord},'%') or
|
||||
bui.unit_name like concat('%',#{keyWord},'%') or
|
||||
|
|
@ -1058,4 +1064,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectTypeIdList" resultType="java.lang.Long">
|
||||
select
|
||||
type_id
|
||||
from
|
||||
ma_type_manage
|
||||
where
|
||||
user_id = #{userId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue