|
@@ -457,7 +457,7 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
int serverPort = request.getServerPort();
|
|
int serverPort = request.getServerPort();
|
|
String address = InetAddress.getLocalHost().getHostAddress();
|
|
String address = InetAddress.getLocalHost().getHostAddress();
|
|
QrcodeFactory qf = new QrcodeFactory(140, 140, 45, 45);
|
|
QrcodeFactory qf = new QrcodeFactory(140, 140, 45, 45);
|
|
- qf.createQrcode("http://" + address + ":" + serverPort + "/jygl/xkzxx/viewxkzList?id=" + id, path + "twoCodeXkz.png", path + "login_logo.png");
|
|
|
|
|
|
+ qf.createQrcode("http://" + address + ":" + serverPort + request.getContextPath() + "/xkzxx/viewxkzList?id=" + id, path + "twoCodeXkz.png", path + "login_logo.png");
|
|
OutputStream toClient = response.getOutputStream(); // 得到向客户端输出二进制数据的对象
|
|
OutputStream toClient = response.getOutputStream(); // 得到向客户端输出二进制数据的对象
|
|
FileInputStream is = new FileInputStream(path + "twoCodeXkz.png");
|
|
FileInputStream is = new FileInputStream(path + "twoCodeXkz.png");
|
|
int i = is.available(); // 得到文件大小
|
|
int i = is.available(); // 得到文件大小
|
|
@@ -823,7 +823,7 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
WebJsonResult wr = success();
|
|
WebJsonResult wr = success();
|
|
return wr;
|
|
return wr;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@RequestMapping(value = "/exportExcelAll")
|
|
@RequestMapping(value = "/exportExcelAll")
|
|
public String exportExcelAll(HttpServletResponse response, final String gkjyr, final String szgqid, final String gkjyxkzh, final String szdid, final String yxqz, final String szgkid, final Date yxq1, final Date yxq2, final String sfyx, final String xkzsfdq) {
|
|
public String exportExcelAll(HttpServletResponse response, final String gkjyr, final String szgqid, final String gkjyxkzh, final String szdid, final String yxqz, final String szgkid, final Date yxq1, final Date yxq2, final String sfyx, final String xkzsfdq) {
|
|
Specification<XkzxxEntity> spec = new Specification<XkzxxEntity>() {
|
|
Specification<XkzxxEntity> spec = new Specification<XkzxxEntity>() {
|
|
@@ -903,7 +903,7 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
};
|
|
};
|
|
List<XkzxxEntity> list = query.findAll(spec, XkzxxEntity.class);
|
|
List<XkzxxEntity> list = query.findAll(spec, XkzxxEntity.class);
|
|
List<XkzxxVo> voList = entityToVo(list);
|
|
List<XkzxxVo> voList = entityToVo(list);
|
|
-
|
|
|
|
|
|
+
|
|
response.setContentType("application/binary;charset=iso-8859-1");
|
|
response.setContentType("application/binary;charset=iso-8859-1");
|
|
try {
|
|
try {
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
@@ -916,7 +916,7 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- public List<XkzxxVo> entityToVo(List<XkzxxEntity> list){
|
|
|
|
|
|
+ public List<XkzxxVo> entityToVo(List<XkzxxEntity> list) {
|
|
List<XkzxxVo> voList = new ArrayList<XkzxxVo>();
|
|
List<XkzxxVo> voList = new ArrayList<XkzxxVo>();
|
|
for (XkzxxEntity entity : list) {
|
|
for (XkzxxEntity entity : list) {
|
|
XkzxxVo vo = new XkzxxVo();
|
|
XkzxxVo vo = new XkzxxVo();
|
|
@@ -926,7 +926,7 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
}
|
|
}
|
|
|
|
|
|
if (vo.getGkjyr() != null) {
|
|
if (vo.getGkjyr() != null) {
|
|
- String idString=vo.getGkjyr();
|
|
|
|
|
|
+ String idString = vo.getGkjyr();
|
|
GkjyrEntity gkjyrentity = gkjyrService.findOne(idString);
|
|
GkjyrEntity gkjyrentity = gkjyrService.findOne(idString);
|
|
if (null != gkjyrentity) {
|
|
if (null != gkjyrentity) {
|
|
vo.setGkjyrzw(gkjyrentity.getGkjyr());
|
|
vo.setGkjyrzw(gkjyrentity.getGkjyr());
|
|
@@ -946,123 +946,140 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
}
|
|
}
|
|
return voList;
|
|
return voList;
|
|
}
|
|
}
|
|
-// @RequestMapping(value = "/exportExcelAll")
|
|
|
|
-// public String exportExcelAll(HttpServletResponse response, final String gkjyr, final String szgqid, final String gkjyxkzh, final String szdid, final String yxqz, final String szgkid, final Date yxq1, final Date yxq2, final String sfyx, final String xkzsfdq) {
|
|
|
|
-// Specification<XkzxxEntity> spec = new Specification<XkzxxEntity>() {
|
|
|
|
-// // 查询条件
|
|
|
|
-// @Override
|
|
|
|
-// public Predicate toPredicate(Root<XkzxxEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
|
-// List<Predicate> list = new ArrayList<Predicate>();
|
|
|
|
-// if (StringUtils.isNotEmpty(szdid)) {
|
|
|
|
-// list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + szdid + "%"));
|
|
|
|
-// }
|
|
|
|
-// if (StringUtils.isNotEmpty(szgkid)) {
|
|
|
|
-// list.add(cb.like(root.get("szgk").as(String.class), "%" + szgkid + "%"));
|
|
|
|
-// }
|
|
|
|
-// if (StringUtils.isNotEmpty(szgqid)) {
|
|
|
|
-// list.add(cb.like(root.get("ssgq").as(String.class), "%" + szgqid + "%"));
|
|
|
|
-// }
|
|
|
|
-// if (StringUtils.isNotEmpty(gkjyr)) {
|
|
|
|
-// Subquery<GkjyrEntity> subquery = query.subquery(GkjyrEntity.class);
|
|
|
|
-// Root<GkjyrEntity> dpRoot = subquery.from(GkjyrEntity.class);
|
|
|
|
-// subquery.select(dpRoot);
|
|
|
|
-// List<Predicate> subQueryPredicates = new ArrayList<Predicate>();
|
|
|
|
-// subQueryPredicates.add(cb.equal(root.get("gkjyr").as(String.class), dpRoot.get("id").as(String.class)));
|
|
|
|
-// subQueryPredicates.add(cb.like(dpRoot.get("gkjyr").as(String.class), "%" + gkjyr + "%"));
|
|
|
|
-// subquery.where(subQueryPredicates.toArray(new Predicate[] {}));
|
|
|
|
-// list.add(cb.exists(subquery));
|
|
|
|
-// }
|
|
|
|
-// if (StringUtils.isNotEmpty(gkjyxkzh)) {
|
|
|
|
-// list.add(cb.like(root.get("gkjyxkzh").as(String.class), "%" + gkjyxkzh + "%"));
|
|
|
|
-// }
|
|
|
|
-// if (StringUtils.isNotEmpty(sfyx)) {
|
|
|
|
-// // if ("1".equals(sfyx)) {
|
|
|
|
-// list.add(cb.equal(root.get("sfyx").as(String.class), sfyx));
|
|
|
|
-// // } else {
|
|
|
|
-// // list.add(cb.notEqual(root.get("sfyx").as(String.class),
|
|
|
|
-// // "2"));
|
|
|
|
-// // }
|
|
|
|
-// }
|
|
|
|
-// if (yxq1 != null) {
|
|
|
|
-// list.add(cb.greaterThanOrEqualTo(root.get("yxqz").as(Date.class), yxq1));
|
|
|
|
-// }
|
|
|
|
-// if (yxq2 != null) {
|
|
|
|
-// list.add(cb.lessThanOrEqualTo(root.get("yxqz").as(Date.class), yxq2));
|
|
|
|
-// }
|
|
|
|
-// Date now = new Date();
|
|
|
|
-// if (StringUtils.isNotEmpty(xkzsfdq)) {
|
|
|
|
-// if ((xkzsfdq).equals("6103")) {
|
|
|
|
-// list.add(cb.lessThanOrEqualTo(root.get("yxqz").as(Date.class), now));
|
|
|
|
-// } else if ((xkzsfdq).equals("6101")) {
|
|
|
|
-// list.add(cb.greaterThan(root.get("yxqz").as(Date.class), now));
|
|
|
|
-// } else {
|
|
|
|
-// list.add(cb.lessThanOrEqualTo(root.get("yxqz").as(Date.class), DateTime.addDays(now, 30)));
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-// // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在港区的数据
|
|
|
|
-// if (isJyr()) {
|
|
|
|
-// list.add(cb.like(root.get("gkjyr").as(String.class), "%" + getSsjyr().getId() + "%"));
|
|
|
|
-// } else {
|
|
|
|
-// In<String> in = cb.in(root.get("ssgq").as(String.class));
|
|
|
|
-// 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.like(root.get("szd").get("id").as(String.class),
|
|
|
|
-// // "%" + SecUtils.getCurrUser().getSzd().getId() + "%"));
|
|
|
|
-// }
|
|
|
|
-// // 状态为0,9,10,11不显示
|
|
|
|
-// list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORE_STATE_COPY));
|
|
|
|
-// 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_BGFLAG));
|
|
|
|
-// list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORE_STATE_ZXFLAG));
|
|
|
|
-// return cb.and(list.toArray(new Predicate[] {}));
|
|
|
|
-// }
|
|
|
|
-// };
|
|
|
|
-// List<XkzxxEntity> list = query.findAll(spec, XkzxxEntity.class);
|
|
|
|
-// List<XkzxxVo> voList = new ArrayList<XkzxxVo>();
|
|
|
|
-//// SimpleDateFormat formater = new SimpleDateFormat("yyyyMMdd hh:mm:ss");
|
|
|
|
-//
|
|
|
|
-// for (XkzxxEntity entity : list) {
|
|
|
|
-// XkzxxVo vo = new XkzxxVo();
|
|
|
|
-// if (null != entity) {
|
|
|
|
-// if (entity != null) {
|
|
|
|
-// BeanUtils.copyProperties(entity, vo);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// if (vo.getGkjyr() != null) {
|
|
|
|
-//
|
|
|
|
-// GkjyrEntity gkjyrentity = gkjyrService.findOne(vo.getGkjyr());
|
|
|
|
-// if (null != gkjyrentity) {
|
|
|
|
-// vo.setGkjyrzw(gkjyrentity.getGkjyr());
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// if (vo.getSsgq() != null) {
|
|
|
|
-// GqEntity gq = gqService.findOne(vo.getSsgq());
|
|
|
|
-// if (null != gq) {
|
|
|
|
-// vo.setSsgqzw(gq.getGqmc());
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// voList.add(vo);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// response.setContentType("application/binary;charset=iso-8859-1");
|
|
|
|
-// try {
|
|
|
|
-// ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
-// String fileName = new String(("许可证信息全部").getBytes(), "iso-8859-1");
|
|
|
|
-// response.setHeader("Content-disposition", "attachment; filename=" + fileName + ".xlsx");// 组装附件名称和格式
|
|
|
|
-// String[] titles = { "序号", "公司名称", "法定代表人", "办公地址", "经营地域", "经营范围", "许可证编号", "发证机关", "有效期至", "发证日期" };
|
|
|
|
-// xkzxxService.exportExcelAll(voList, titles, outputStream);
|
|
|
|
-// } catch (IOException e) {
|
|
|
|
-// e.printStackTrace();
|
|
|
|
-// }
|
|
|
|
-// return null;
|
|
|
|
-// }
|
|
|
|
|
|
+ // @RequestMapping(value = "/exportExcelAll")
|
|
|
|
+ // public String exportExcelAll(HttpServletResponse response, final String
|
|
|
|
+ // gkjyr, final String szgqid, final String gkjyxkzh, final String szdid,
|
|
|
|
+ // final String yxqz, final String szgkid, final Date yxq1, final Date yxq2,
|
|
|
|
+ // final String sfyx, final String xkzsfdq) {
|
|
|
|
+ // Specification<XkzxxEntity> spec = new Specification<XkzxxEntity>() {
|
|
|
|
+ // // 查询条件
|
|
|
|
+ // @Override
|
|
|
|
+ // public Predicate toPredicate(Root<XkzxxEntity> root, CriteriaQuery<?>
|
|
|
|
+ // query, CriteriaBuilder cb) {
|
|
|
|
+ // List<Predicate> list = new ArrayList<Predicate>();
|
|
|
|
+ // if (StringUtils.isNotEmpty(szdid)) {
|
|
|
|
+ // list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + szdid
|
|
|
|
+ // + "%"));
|
|
|
|
+ // }
|
|
|
|
+ // if (StringUtils.isNotEmpty(szgkid)) {
|
|
|
|
+ // list.add(cb.like(root.get("szgk").as(String.class), "%" + szgkid + "%"));
|
|
|
|
+ // }
|
|
|
|
+ // if (StringUtils.isNotEmpty(szgqid)) {
|
|
|
|
+ // list.add(cb.like(root.get("ssgq").as(String.class), "%" + szgqid + "%"));
|
|
|
|
+ // }
|
|
|
|
+ // if (StringUtils.isNotEmpty(gkjyr)) {
|
|
|
|
+ // Subquery<GkjyrEntity> subquery = query.subquery(GkjyrEntity.class);
|
|
|
|
+ // Root<GkjyrEntity> dpRoot = subquery.from(GkjyrEntity.class);
|
|
|
|
+ // subquery.select(dpRoot);
|
|
|
|
+ // List<Predicate> subQueryPredicates = new ArrayList<Predicate>();
|
|
|
|
+ // subQueryPredicates.add(cb.equal(root.get("gkjyr").as(String.class),
|
|
|
|
+ // dpRoot.get("id").as(String.class)));
|
|
|
|
+ // subQueryPredicates.add(cb.like(dpRoot.get("gkjyr").as(String.class), "%"
|
|
|
|
+ // + gkjyr + "%"));
|
|
|
|
+ // subquery.where(subQueryPredicates.toArray(new Predicate[] {}));
|
|
|
|
+ // list.add(cb.exists(subquery));
|
|
|
|
+ // }
|
|
|
|
+ // if (StringUtils.isNotEmpty(gkjyxkzh)) {
|
|
|
|
+ // list.add(cb.like(root.get("gkjyxkzh").as(String.class), "%" + gkjyxkzh +
|
|
|
|
+ // "%"));
|
|
|
|
+ // }
|
|
|
|
+ // if (StringUtils.isNotEmpty(sfyx)) {
|
|
|
|
+ // // if ("1".equals(sfyx)) {
|
|
|
|
+ // list.add(cb.equal(root.get("sfyx").as(String.class), sfyx));
|
|
|
|
+ // // } else {
|
|
|
|
+ // // list.add(cb.notEqual(root.get("sfyx").as(String.class),
|
|
|
|
+ // // "2"));
|
|
|
|
+ // // }
|
|
|
|
+ // }
|
|
|
|
+ // if (yxq1 != null) {
|
|
|
|
+ // list.add(cb.greaterThanOrEqualTo(root.get("yxqz").as(Date.class), yxq1));
|
|
|
|
+ // }
|
|
|
|
+ // if (yxq2 != null) {
|
|
|
|
+ // list.add(cb.lessThanOrEqualTo(root.get("yxqz").as(Date.class), yxq2));
|
|
|
|
+ // }
|
|
|
|
+ // Date now = new Date();
|
|
|
|
+ // if (StringUtils.isNotEmpty(xkzsfdq)) {
|
|
|
|
+ // if ((xkzsfdq).equals("6103")) {
|
|
|
|
+ // list.add(cb.lessThanOrEqualTo(root.get("yxqz").as(Date.class), now));
|
|
|
|
+ // } else if ((xkzsfdq).equals("6101")) {
|
|
|
|
+ // list.add(cb.greaterThan(root.get("yxqz").as(Date.class), now));
|
|
|
|
+ // } else {
|
|
|
|
+ // list.add(cb.lessThanOrEqualTo(root.get("yxqz").as(Date.class),
|
|
|
|
+ // DateTime.addDays(now, 30)));
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // }
|
|
|
|
+ // // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在港区的数据
|
|
|
|
+ // if (isJyr()) {
|
|
|
|
+ // list.add(cb.like(root.get("gkjyr").as(String.class), "%" +
|
|
|
|
+ // getSsjyr().getId() + "%"));
|
|
|
|
+ // } else {
|
|
|
|
+ // In<String> in = cb.in(root.get("ssgq").as(String.class));
|
|
|
|
+ // 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.like(root.get("szd").get("id").as(String.class),
|
|
|
|
+ // // "%" + SecUtils.getCurrUser().getSzd().getId() + "%"));
|
|
|
|
+ // }
|
|
|
|
+ // // 状态为0,9,10,11不显示
|
|
|
|
+ // list.add(cb.notEqual(root.get("recordStatus").as(Integer.class),
|
|
|
|
+ // BaseEntity.RECORE_STATE_COPY));
|
|
|
|
+ // 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_BGFLAG));
|
|
|
|
+ // list.add(cb.notEqual(root.get("recordStatus").as(Integer.class),
|
|
|
|
+ // BaseEntity.RECORE_STATE_ZXFLAG));
|
|
|
|
+ // return cb.and(list.toArray(new Predicate[] {}));
|
|
|
|
+ // }
|
|
|
|
+ // };
|
|
|
|
+ // List<XkzxxEntity> list = query.findAll(spec, XkzxxEntity.class);
|
|
|
|
+ // List<XkzxxVo> voList = new ArrayList<XkzxxVo>();
|
|
|
|
+ // // SimpleDateFormat formater = new SimpleDateFormat("yyyyMMdd hh:mm:ss");
|
|
|
|
+ //
|
|
|
|
+ // for (XkzxxEntity entity : list) {
|
|
|
|
+ // XkzxxVo vo = new XkzxxVo();
|
|
|
|
+ // if (null != entity) {
|
|
|
|
+ // if (entity != null) {
|
|
|
|
+ // BeanUtils.copyProperties(entity, vo);
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // if (vo.getGkjyr() != null) {
|
|
|
|
+ //
|
|
|
|
+ // GkjyrEntity gkjyrentity = gkjyrService.findOne(vo.getGkjyr());
|
|
|
|
+ // if (null != gkjyrentity) {
|
|
|
|
+ // vo.setGkjyrzw(gkjyrentity.getGkjyr());
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // if (vo.getSsgq() != null) {
|
|
|
|
+ // GqEntity gq = gqService.findOne(vo.getSsgq());
|
|
|
|
+ // if (null != gq) {
|
|
|
|
+ // vo.setSsgqzw(gq.getGqmc());
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // voList.add(vo);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // response.setContentType("application/binary;charset=iso-8859-1");
|
|
|
|
+ // try {
|
|
|
|
+ // ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
+ // String fileName = new String(("许可证信息全部").getBytes(), "iso-8859-1");
|
|
|
|
+ // response.setHeader("Content-disposition", "attachment; filename=" +
|
|
|
|
+ // fileName + ".xlsx");// 组装附件名称和格式
|
|
|
|
+ // String[] titles = { "序号", "公司名称", "法定代表人", "办公地址", "经营地域", "经营范围",
|
|
|
|
+ // "许可证编号", "发证机关", "有效期至", "发证日期" };
|
|
|
|
+ // xkzxxService.exportExcelAll(voList, titles, outputStream);
|
|
|
|
+ // } catch (IOException e) {
|
|
|
|
+ // e.printStackTrace();
|
|
|
|
+ // }
|
|
|
|
+ // return null;
|
|
|
|
+ // }
|
|
}
|
|
}
|