|
@@ -447,7 +447,7 @@ public class AxCtl extends BaseWebCtl {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/exportExcelAll")
|
|
|
- public String exportExcelAll(HttpServletResponse response, final String axmc, final String szdid, final String szgkid, final String szgqid, final String ssjyr) {
|
|
|
+ public String exportExcelAll(HttpServletResponse response, final String axmc, final String szdid, final String szgkid, final String szgqid, final String ssjyr, final String lyztid) {
|
|
|
Specification<AxEntity> spec = new Specification<AxEntity>() {
|
|
|
// 查询条件
|
|
|
@Override
|
|
@@ -455,7 +455,7 @@ public class AxCtl extends BaseWebCtl {
|
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(axmc)) {
|
|
|
- list.add(cb.like(root.get("axmc").as(String.class), "%" + enCodeStr(axmc) + "%"));
|
|
|
+ list.add(cb.like(root.get("axmc").as(String.class), "%" + axmc + "%"));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(szdid)) {
|
|
|
list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + szdid + "%"));
|
|
@@ -467,14 +467,27 @@ public class AxCtl extends BaseWebCtl {
|
|
|
list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" + szgqid + "%"));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(ssjyr)) {
|
|
|
- list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" + enCodeStr(ssjyr) + "%"));
|
|
|
+ list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" + ssjyr + "%"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(lyztid)) {
|
|
|
+ list.add(cb.like(root.get("lyzt").get("id").as(String.class), "%" + lyztid + "%"));
|
|
|
}
|
|
|
// 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
|
|
|
if (isJyr()) {
|
|
|
list.add(cb.like(root.get("ssjyr").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
|
|
|
} else {
|
|
|
- list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + SecUtils.getCurrUser().getSzd().getId() + "%"));
|
|
|
+ In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ List<String> gqlist = (List<String>) Utils.getSession()
|
|
|
+ .getAttribute("gqList");
|
|
|
+ if (gqlist != null && gqlist.size() > 0) {
|
|
|
+ for (int i = 0; i < gqlist.size(); i++) {
|
|
|
+ in.value(gqlist.get(i));
|
|
|
+ }
|
|
|
+ list.add(in);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
|
|
|
list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORE_STATE_COPY));
|
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
@@ -531,12 +544,12 @@ public class AxCtl extends BaseWebCtl {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/exportExcelthisPage")
|
|
|
- public String exportExcelthisPage(SimplePageRequest page, HttpServletResponse response, final String axmc, final String szdid, final String szgkid, final String szgqid, final String ssjyr, int pageNum, int pageSize) {
|
|
|
+ public String exportExcelthisPage(SimplePageRequest page, HttpServletResponse response, final String axmc, final String szdid, final String szgkid, final String szgqid, final String ssjyr, int pageNum, int pageSize, final String lyztid) {
|
|
|
Specification<AxEntity> spec = new Specification<AxEntity>() {
|
|
|
@Override
|
|
|
public Predicate toPredicate(Root<AxEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isNotEmpty(axmc)) {
|
|
|
list.add(cb.like(root.get("axmc").as(String.class), "%" + axmc + "%"));
|
|
|
}
|
|
@@ -550,13 +563,27 @@ public class AxCtl extends BaseWebCtl {
|
|
|
list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" + szgqid + "%"));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(ssjyr)) {
|
|
|
- list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" + enCodeStr(ssjyr) + "%"));
|
|
|
+ list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" + ssjyr + "%"));
|
|
|
}
|
|
|
+ if (StringUtils.isNotEmpty(lyztid)) {
|
|
|
+ list.add(cb.like(root.get("lyzt").get("id").as(String.class), "%" + lyztid + "%"));
|
|
|
+ }
|
|
|
+ // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
|
|
|
if (isJyr()) {
|
|
|
list.add(cb.like(root.get("ssjyr").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
|
|
|
} else {
|
|
|
- list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + SecUtils.getCurrUser().getSzd().getId() + "%"));
|
|
|
+ In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ List<String> gqlist = (List<String>) Utils.getSession()
|
|
|
+ .getAttribute("gqList");
|
|
|
+ if (gqlist != null && gqlist.size() > 0) {
|
|
|
+ for (int i = 0; i < gqlist.size(); i++) {
|
|
|
+ in.value(gqlist.get(i));
|
|
|
+ }
|
|
|
+ list.add(in);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
|
|
|
list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORE_STATE_COPY));
|
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
@@ -564,8 +591,8 @@ public class AxCtl extends BaseWebCtl {
|
|
|
};
|
|
|
page.setPage(pageNum);
|
|
|
page.setRows(pageSize);
|
|
|
- page.setSort("axmc");
|
|
|
- page.setOrder("asc");
|
|
|
+ page.setSort("id");
|
|
|
+ page.setOrder("desc");
|
|
|
Page<AxEntity> list = query.findAll(spec, toPageRequest(page), AxEntity.class);
|
|
|
List<AxVo> voList = new ArrayList<AxVo>();
|
|
|
for (AxEntity entity : list) {
|