Commit bd2101c7 authored by wanghao's avatar wanghao

1 大屏端 气量监管 按照 企业 政府角色区分查询统计

parent cee87591
......@@ -5,6 +5,8 @@ import java.util.Map;
import com.zehong.system.domain.Statistics;
import com.zehong.system.domain.TSupBalGasSup;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
/**
* 供需平衡-气量监管Mapper接口
......@@ -30,7 +32,7 @@ public interface TSupBalGasSupMapper
*/
public List<TSupBalGasSup> selectTSupBalGasSupList(TSupBalGasSup tSupBalGasSup);
public List<Statistics> tSupBalGasSupStatistics(List<String> sevenDate);
public List<Statistics> tSupBalGasSupStatistics(@Param("list") List<String> sevenDate, @Param("companyInfoId") String companyInfoId);
/**
* 新增供需平衡-气量监管
......
......@@ -29,6 +29,11 @@ public interface ITSupBalGasSupService
*/
public List<TSupBalGasSup> selectTSupBalGasSupList(TSupBalGasSup tSupBalGasSup);
/**
*
* @param sevenDate s
* @return
*/
public List<Statistics> tSupBalGasSupStatistics(List<String> sevenDate);
......
......@@ -4,7 +4,9 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.zehong.common.core.domain.entity.SysRole;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.Statistics;
......@@ -53,7 +55,12 @@ public class TSupBalGasSupServiceImpl implements ITSupBalGasSupService
@Override
public List<Statistics> tSupBalGasSupStatistics(List<String> sevenDate)
{
return tSupBalGasSupMapper.tSupBalGasSupStatistics(sevenDate);
String companyInfoId = SecurityUtils.getLoginUser().getUser().getDeptId();
if (!isQy()) {
companyInfoId = null;
}
return tSupBalGasSupMapper.tSupBalGasSupStatistics(sevenDate,companyInfoId);
}
/**
......@@ -137,4 +144,13 @@ public class TSupBalGasSupServiceImpl implements ITSupBalGasSupService
}
/**
* 判断是否为政府角色
* @return
*/
private boolean isQy(){
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
List<String> roleKeys = roles.stream().map(item -> item.getRoleKey()).collect(Collectors.toList());
return roleKeys.contains("qy");
}
}
......@@ -82,6 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_sup_bal_gas_sup
WHERE
is_del='0'
<if test="companyInfoId != null">
and f_company_info_id = #{companyInfoId}
</if>
and
DATE_FORMAT( f_calendar_date, '%Y-%m-%d' ) IN
<foreach collection="list" item="sevenDate" separator="," open="(" close=")">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment