|
@@ -39,6 +39,7 @@ import com.jtgh.yjpt.common.PredicateModel.Operator;
|
|
import com.jtgh.yjpt.common.ReportExportHelper;
|
|
import com.jtgh.yjpt.common.ReportExportHelper;
|
|
import com.jtgh.yjpt.common.SysException;
|
|
import com.jtgh.yjpt.common.SysException;
|
|
import com.jtgh.yjpt.common.Utils;
|
|
import com.jtgh.yjpt.common.Utils;
|
|
|
|
+import com.jtgh.yjpt.dao.jyr.JyrDao;
|
|
import com.jtgh.yjpt.entity.BaseEntity;
|
|
import com.jtgh.yjpt.entity.BaseEntity;
|
|
import com.jtgh.yjpt.entity.auth.UserEntity;
|
|
import com.jtgh.yjpt.entity.auth.UserEntity;
|
|
|
|
|
|
@@ -61,7 +62,8 @@ public abstract class BaseController {
|
|
protected Logger logger = Logger.getLogger(getClass());
|
|
protected Logger logger = Logger.getLogger(getClass());
|
|
@Autowired
|
|
@Autowired
|
|
protected JdbcTemplate jdbcTemplate;
|
|
protected JdbcTemplate jdbcTemplate;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private JyrDao jyrDao;
|
|
/**
|
|
/**
|
|
* jasper打印文件
|
|
* jasper打印文件
|
|
*/
|
|
*/
|
|
@@ -81,7 +83,8 @@ public abstract class BaseController {
|
|
|
|
|
|
if ("FF".equals(getBrowser(request))) {
|
|
if ("FF".equals(getBrowser(request))) {
|
|
// 针对火狐浏览器处理方式不一样了
|
|
// 针对火狐浏览器处理方式不一样了
|
|
- //fileName = new String(fileName.getBytes("UTF-8"), "iso-8859-1");
|
|
|
|
|
|
+ // fileName = new String(fileName.getBytes("UTF-8"),
|
|
|
|
+ // "iso-8859-1");
|
|
} else {
|
|
} else {
|
|
fileName = URLEncoder.encode(fileName, "UTF-8");
|
|
fileName = URLEncoder.encode(fileName, "UTF-8");
|
|
}
|
|
}
|
|
@@ -124,11 +127,11 @@ public abstract class BaseController {
|
|
/**
|
|
/**
|
|
* 时间格式化2
|
|
* 时间格式化2
|
|
*/
|
|
*/
|
|
- public SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
+ public SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
/**
|
|
/**
|
|
* 时间格式化3
|
|
* 时间格式化3
|
|
*/
|
|
*/
|
|
- public SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
|
|
|
|
+ public SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
/**
|
|
/**
|
|
* 时间格式化4
|
|
* 时间格式化4
|
|
*/
|
|
*/
|
|
@@ -136,7 +139,7 @@ public abstract class BaseController {
|
|
/**
|
|
/**
|
|
* 时间格式化5
|
|
* 时间格式化5
|
|
*/
|
|
*/
|
|
- public SimpleDateFormat sdf5 = new SimpleDateFormat("HH:mm:ss");
|
|
|
|
|
|
+ public SimpleDateFormat sdf5 = new SimpleDateFormat("HH:mm:ss");
|
|
/**
|
|
/**
|
|
* 日历
|
|
* 日历
|
|
*/
|
|
*/
|
|
@@ -552,7 +555,7 @@ public abstract class BaseController {
|
|
&& !GlobalData.adminID.equals(Utils.getCurrentUser().getId())) {
|
|
&& !GlobalData.adminID.equals(Utils.getCurrentUser().getId())) {
|
|
List<PredicateModel> orList = new ArrayList<PredicateModel>();
|
|
List<PredicateModel> orList = new ArrayList<PredicateModel>();
|
|
String role = getCurrentRoleCode(functionId);
|
|
String role = getCurrentRoleCode(functionId);
|
|
- // 行政人员可以查找所有比自己低级的数据,以及经营人、建设单位、评价机构的数据
|
|
|
|
|
|
+ // 行政人员可以查找所有比自己低级的数据,以及经 营人、建设单位、评价机构的数据
|
|
if (Constants.NO.equals(Utils.getCurrentUser().getSfjyr())) {
|
|
if (Constants.NO.equals(Utils.getCurrentUser().getSfjyr())) {
|
|
// 行政人员按照所在地过滤
|
|
// 行政人员按照所在地过滤
|
|
if (Utils.getCurrentUser().getSzd() != null)
|
|
if (Utils.getCurrentUser().getSzd() != null)
|
|
@@ -571,19 +574,35 @@ public abstract class BaseController {
|
|
orList.add(new PredicateModel("tbdyid", null, Operator.NNL));
|
|
orList.add(new PredicateModel("tbdyid", null, Operator.NNL));
|
|
} else {
|
|
} else {
|
|
// 经营人可以看自己及自己下级经营人的数据,非行政人员的建设方和评价机构只能看自己所在企业的数据
|
|
// 经营人可以看自己及自己下级经营人的数据,非行政人员的建设方和评价机构只能看自己所在企业的数据
|
|
- if (Utils.getCurrentUser().getJyrjcxx() != null
|
|
|
|
- && Utils.getSession().getAttribute(
|
|
|
|
- GlobalData.USER_SESSION_JYR) != null) {
|
|
|
|
- if (!StringUtils.isEmpty(jyr)) {
|
|
|
|
- orList.add(new PredicateModel(jyr + ".id", Utils
|
|
|
|
- .getSession().getAttribute(
|
|
|
|
- GlobalData.USER_SESSION_JYR),
|
|
|
|
- Operator.IN));
|
|
|
|
- } else {
|
|
|
|
- orList.add(new PredicateModel(user + "jyrjcxx.id",
|
|
|
|
- Utils.getSession().getAttribute(
|
|
|
|
- GlobalData.USER_SESSION_JYR),
|
|
|
|
- Operator.IN));
|
|
|
|
|
|
+ if (Utils.getCurrentUser().getJyrjcxx() != null) {
|
|
|
|
+
|
|
|
|
+ //session!=null invoke from web
|
|
|
|
+ if (Utils.getSession() != null
|
|
|
|
+ && Utils.getSession().getAttribute(
|
|
|
|
+ GlobalData.USER_SESSION_JYR) != null) {
|
|
|
|
+ if (!StringUtils.isEmpty(jyr)) {
|
|
|
|
+ orList.add(new PredicateModel(jyr + ".id", Utils
|
|
|
|
+ .getSession().getAttribute(
|
|
|
|
+ GlobalData.USER_SESSION_JYR),
|
|
|
|
+ Operator.IN));
|
|
|
|
+ } else {
|
|
|
|
+ orList.add(new PredicateModel(user + "jyrjcxx.id",
|
|
|
|
+ Utils.getSession().getAttribute(
|
|
|
|
+ GlobalData.USER_SESSION_JYR),
|
|
|
|
+ Operator.IN));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if(Utils.getSession() == null){//invoke from webservice
|
|
|
|
+ //session.setAttribute(GlobalData.USER_SESSION_JYR,jyrDao.findByParentJyr(user.getJyrjcxx().getId()));
|
|
|
|
+ List<BigDecimal> jyr_sub = jyrDao.findByParentJyr(Utils.getCurrentUser().getJyrjcxx().getId());
|
|
|
|
+ if (!StringUtils.isEmpty(jyr)) {
|
|
|
|
+ orList.add(new PredicateModel(jyr + ".id", jyr_sub,
|
|
|
|
+ Operator.IN));
|
|
|
|
+ } else {
|
|
|
|
+ orList.add(new PredicateModel(user + "jyrjcxx.id",
|
|
|
|
+ jyr_sub,
|
|
|
|
+ Operator.IN));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (Utils.getCurrentUser().getJsdw() != null) {
|
|
if (Utils.getCurrentUser().getJsdw() != null) {
|
|
@@ -595,6 +614,7 @@ public abstract class BaseController {
|
|
.getCurrentUser().getAqpjjg().getId(), Operator.EQ));
|
|
.getCurrentUser().getAqpjjg().getId(), Operator.EQ));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
if (orList != null && orList.size() > 0) {
|
|
if (orList != null && orList.size() > 0) {
|
|
filterList.add(new PredicateModel(JoinType.OR, orList));
|
|
filterList.add(new PredicateModel(JoinType.OR, orList));
|
|
}
|
|
}
|