|
@@ -80,7 +80,7 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
@RequestMapping(value = "/main")
|
|
|
@RequiresPermissions("sssbxx:main")
|
|
|
public String main(SimplePageRequest page, Model model, final HttpServletRequest request, final String ssmc, final String szgkid, final String jyr, final String szgqid, final String szdid, final String menuid) throws JsonProcessingException {
|
|
|
- final Map<String, Object> cacheSCmap = CacheSearchCondition.cacheSCmap(request,"sssbxx");
|
|
|
+ final Map<String, Object> cacheSCmap = CacheSearchCondition.cacheSCmap(request, "sssbxx");
|
|
|
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
// 查询条件
|
|
|
Specification<SssbEntity> spec = new Specification<SssbEntity>() {
|
|
@@ -90,67 +90,76 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
|
if (StringUtils.isNotEmpty(szdid)) {
|
|
|
list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + szdid + "%"));
|
|
|
- }else if (isGET(request)) {
|
|
|
- String v=(String)CacheSearchCondition.cacheSCmapVal(cacheSCmap, "szdid");
|
|
|
- if(StringUtils.isNotEmpty(v) ){
|
|
|
+ } else if (isGET(request)) {
|
|
|
+ String v = (String) CacheSearchCondition.cacheSCmapVal(cacheSCmap, "szdid");
|
|
|
+ if (StringUtils.isNotEmpty(v)) {
|
|
|
list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + v + "%"));
|
|
|
}
|
|
|
- }
|
|
|
-// else if (StringUtils.isNotEmpty(SearchCondition.ssszd) && isGET(request)) {
|
|
|
-// list.add(cb.like(root.get("szd").get("id").as(String.class), "%" + SearchCondition.ssszd + "%"));
|
|
|
-// }
|
|
|
+ }
|
|
|
+ // else if (StringUtils.isNotEmpty(SearchCondition.ssszd) &&
|
|
|
+ // isGET(request)) {
|
|
|
+ // list.add(cb.like(root.get("szd").get("id").as(String.class),
|
|
|
+ // "%" + SearchCondition.ssszd + "%"));
|
|
|
+ // }
|
|
|
if (StringUtils.isNotEmpty(szgkid)) {
|
|
|
list.add(cb.like(root.get("szgk").get("id").as(String.class), "%" + szgkid + "%"));
|
|
|
- }else if (isGET(request)) {
|
|
|
- String v=(String)CacheSearchCondition.cacheSCmapVal(cacheSCmap, "szgkid");
|
|
|
- if(StringUtils.isNotEmpty(v) ){
|
|
|
+ } else if (isGET(request)) {
|
|
|
+ String v = (String) CacheSearchCondition.cacheSCmapVal(cacheSCmap, "szgkid");
|
|
|
+ if (StringUtils.isNotEmpty(v)) {
|
|
|
list.add(cb.like(root.get("szgk").get("id").as(String.class), "%" + v + "%"));
|
|
|
}
|
|
|
- }
|
|
|
-// else if (StringUtils.isNotEmpty(SearchCondition.ssszgk) && isGET(request)) {
|
|
|
-// list.add(cb.like(root.get("szgk").get("id").as(String.class), "%" + SearchCondition.ssszgk + "%"));
|
|
|
-// }
|
|
|
+ }
|
|
|
+ // else if (StringUtils.isNotEmpty(SearchCondition.ssszgk) &&
|
|
|
+ // isGET(request)) {
|
|
|
+ // list.add(cb.like(root.get("szgk").get("id").as(String.class),
|
|
|
+ // "%" + SearchCondition.ssszgk + "%"));
|
|
|
+ // }
|
|
|
if (StringUtils.isNotEmpty(szgqid)) {
|
|
|
list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" + szgqid + "%"));
|
|
|
- }else if (isGET(request)) {
|
|
|
- String v=(String)CacheSearchCondition.cacheSCmapVal(cacheSCmap, "szgqid");
|
|
|
- if(StringUtils.isNotEmpty(v) ){
|
|
|
- list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" +v+ "%"));
|
|
|
+ } else if (isGET(request)) {
|
|
|
+ String v = (String) CacheSearchCondition.cacheSCmapVal(cacheSCmap, "szgqid");
|
|
|
+ if (StringUtils.isNotEmpty(v)) {
|
|
|
+ list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" + v + "%"));
|
|
|
}
|
|
|
- }
|
|
|
-// else if (StringUtils.isNotEmpty(SearchCondition.ssszgq) && isGET(request)) {
|
|
|
-// list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" + SearchCondition.ssszgq + "%"));
|
|
|
-// }
|
|
|
+ }
|
|
|
+ // else if (StringUtils.isNotEmpty(SearchCondition.ssszgq) &&
|
|
|
+ // isGET(request)) {
|
|
|
+ // list.add(cb.like(root.get("szgq").get("id").as(String.class),
|
|
|
+ // "%" + SearchCondition.ssszgq + "%"));
|
|
|
+ // }
|
|
|
if (StringUtils.isNotEmpty(jyr)) {
|
|
|
list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" + jyr + "%"));
|
|
|
- }else if (isGET(request)) {
|
|
|
- String v=(String)CacheSearchCondition.cacheSCmapVal(cacheSCmap, "jyr");
|
|
|
- if(StringUtils.isNotEmpty(v) ){
|
|
|
+ } else if (isGET(request)) {
|
|
|
+ String v = (String) CacheSearchCondition.cacheSCmapVal(cacheSCmap, "jyr");
|
|
|
+ if (StringUtils.isNotEmpty(v)) {
|
|
|
list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" + v + "%"));
|
|
|
}
|
|
|
- }
|
|
|
-// else if (StringUtils.isNotEmpty(SearchCondition.ssssjyr) && isGET(request)) {
|
|
|
-// list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" + SearchCondition.ssssjyr + "%"));
|
|
|
-// }
|
|
|
+ }
|
|
|
+ // else if (StringUtils.isNotEmpty(SearchCondition.ssssjyr) &&
|
|
|
+ // isGET(request)) {
|
|
|
+ // list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class),
|
|
|
+ // "%" + SearchCondition.ssssjyr + "%"));
|
|
|
+ // }
|
|
|
if (StringUtils.isNotEmpty(ssmc)) {
|
|
|
list.add(cb.like(root.get("ssmc").as(String.class), "%" + ssmc + "%"));
|
|
|
- }else if (isGET(request)) {
|
|
|
- String v=(String)CacheSearchCondition.cacheSCmapVal(cacheSCmap, "ssmc");
|
|
|
- if(StringUtils.isNotEmpty(v) ){
|
|
|
+ } else if (isGET(request)) {
|
|
|
+ String v = (String) CacheSearchCondition.cacheSCmapVal(cacheSCmap, "ssmc");
|
|
|
+ if (StringUtils.isNotEmpty(v)) {
|
|
|
list.add(cb.like(root.get("ssmc").as(String.class), "%" + v + "%"));
|
|
|
}
|
|
|
- }
|
|
|
-// else if (StringUtils.isNotEmpty(SearchCondition.ssmc) && isGET(request)) {
|
|
|
-// list.add(cb.like(root.get("ssmc").as(String.class), "%" + SearchCondition.ssmc + "%"));
|
|
|
-// }
|
|
|
+ }
|
|
|
+ // else if (StringUtils.isNotEmpty(SearchCondition.ssmc) &&
|
|
|
+ // isGET(request)) {
|
|
|
+ // list.add(cb.like(root.get("ssmc").as(String.class), "%" +
|
|
|
+ // SearchCondition.ssmc + "%"));
|
|
|
+ // }
|
|
|
// 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
|
|
|
if (isJyr()) {
|
|
|
list.add(cb.like(root.get("ssjyr").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
|
|
|
} else {
|
|
|
In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- List<String> gqlist = (List<String>) Utils.getSession()
|
|
|
- .getAttribute("gqList");
|
|
|
+ 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));
|
|
@@ -158,7 +167,7 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
list.add(in);
|
|
|
}
|
|
|
}
|
|
|
- //状态为0,9,10,11不显示
|
|
|
+ // 状态为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));
|
|
@@ -169,8 +178,8 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
|
|
|
String user1 = (String) Utils.getSession().getAttribute("user");
|
|
|
String user2 = SecUtils.getCurrUser().getId();
|
|
|
- if(user2!=null){
|
|
|
- if(!user2.equals(user1)){
|
|
|
+ if (user2 != null) {
|
|
|
+ if (!user2.equals(user1)) {
|
|
|
SearchCondition.sspage = 1;
|
|
|
SearchCondition.ssmc = "";
|
|
|
SearchCondition.ssssjyr = "";
|
|
@@ -178,13 +187,13 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
SearchCondition.ssszgk = "";
|
|
|
SearchCondition.ssszgq = "";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
Utils.getSession().setAttribute("user", user2);
|
|
|
-
|
|
|
-// if (page.getPage() < 1) {
|
|
|
-// page.setPage(SearchCondition.sspage);
|
|
|
-// }
|
|
|
+
|
|
|
+ // if (page.getPage() < 1) {
|
|
|
+ // page.setPage(SearchCondition.sspage);
|
|
|
+ // }
|
|
|
if (page.getPage() < 1) {
|
|
|
Object sspage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "sspage");
|
|
|
if (StringUtils.isEmpty(sspage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(sspage))) {
|
|
@@ -212,35 +221,34 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
vo.setSzgq(entity.getSzgq() != null ? entity.getSzgq().getId() : "");
|
|
|
vo.setSsjyr(entity.getSsjyr() != null ? entity.getSsjyr().getId() : "");
|
|
|
vo.setXkzid(entity.getXkzid() != null ? entity.getXkzid() : "");
|
|
|
- vo.setSzzyq(entity.getSzzyq() !=null ? entity.getSzzyq().getId() : "");
|
|
|
- vo.setSzzyqzw(entity.getSzzyq() !=null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
+ vo.setSzzyq(entity.getSzzyq() != null ? entity.getSzzyq().getId() : "");
|
|
|
+ vo.setSzzyqzw(entity.getSzzyq() != null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
voList.add(vo);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-//
|
|
|
-// if (isPOST(request)) {
|
|
|
-// model.addAttribute("ssmc", ssmc);
|
|
|
-// model.addAttribute("ssjyr", jyr);
|
|
|
-// model.addAttribute("szd", szdid);
|
|
|
-// model.addAttribute("szgk", szgkid);
|
|
|
-// model.addAttribute("szgq", szgqid);
|
|
|
-//
|
|
|
-// SearchCondition.sspage = page.getPage();
|
|
|
-// SearchCondition.ssmc = ssmc;
|
|
|
-// SearchCondition.ssssjyr = jyr;
|
|
|
-// SearchCondition.ssszd = szdid;
|
|
|
-// SearchCondition.ssszgk = szgkid;
|
|
|
-// SearchCondition.ssszgq = szgqid;
|
|
|
-// } else {
|
|
|
-// model.addAttribute("ssmc", SearchCondition.ssmc);
|
|
|
-// model.addAttribute("jyr", SearchCondition.ssssjyr);
|
|
|
-// model.addAttribute("szd", SearchCondition.ssszd);
|
|
|
-// model.addAttribute("szgk", SearchCondition.ssszgk);
|
|
|
-// model.addAttribute("szgq", SearchCondition.ssszgq);
|
|
|
-// }
|
|
|
+ //
|
|
|
+ // if (isPOST(request)) {
|
|
|
+ // model.addAttribute("ssmc", ssmc);
|
|
|
+ // model.addAttribute("ssjyr", jyr);
|
|
|
+ // model.addAttribute("szd", szdid);
|
|
|
+ // model.addAttribute("szgk", szgkid);
|
|
|
+ // model.addAttribute("szgq", szgqid);
|
|
|
+ //
|
|
|
+ // SearchCondition.sspage = page.getPage();
|
|
|
+ // SearchCondition.ssmc = ssmc;
|
|
|
+ // SearchCondition.ssssjyr = jyr;
|
|
|
+ // SearchCondition.ssszd = szdid;
|
|
|
+ // SearchCondition.ssszgk = szgkid;
|
|
|
+ // SearchCondition.ssszgq = szgqid;
|
|
|
+ // } else {
|
|
|
+ // model.addAttribute("ssmc", SearchCondition.ssmc);
|
|
|
+ // model.addAttribute("jyr", SearchCondition.ssssjyr);
|
|
|
+ // model.addAttribute("szd", SearchCondition.ssszd);
|
|
|
+ // model.addAttribute("szgk", SearchCondition.ssszgk);
|
|
|
+ // model.addAttribute("szgq", SearchCondition.ssszgq);
|
|
|
+ // }
|
|
|
|
|
|
if (isPOST(request)) {
|
|
|
cacheSCmap.put("sspage", page.getPage());
|
|
@@ -248,7 +256,7 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
System.out.println(JSONObject.fromObject(cacheSCmap));
|
|
|
}
|
|
|
System.out.println(isPOST(request));
|
|
|
-
|
|
|
+
|
|
|
model.addAttribute("list", voList);
|
|
|
model.addAttribute("menuid", menuid);
|
|
|
model.addAttribute("ssmc", CacheSearchCondition.cacheSCmapVal(cacheSCmap, "ssmc"));
|
|
@@ -256,11 +264,10 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
model.addAttribute("szd", CacheSearchCondition.cacheSCmapVal(cacheSCmap, "szdid"));
|
|
|
model.addAttribute("szgk", CacheSearchCondition.cacheSCmapVal(cacheSCmap, "szgkid"));
|
|
|
model.addAttribute("jyr", CacheSearchCondition.cacheSCmapVal(cacheSCmap, "jyr"));
|
|
|
-
|
|
|
+
|
|
|
List<CodeEntity> listSF = securityMgr.codeService().findValidCodesByGroupCode(Constants.GROUP_CODE_SF);
|
|
|
model.addAttribute("listSF", listSF);
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
// 翻页共通
|
|
|
putPageInfo(model, page, list);
|
|
|
return "gkjygl/gkjyr/sssb/sssbmain";
|
|
@@ -273,126 +280,78 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
// how:如果是新增直接保存,如果更新,先取出数据库中记录,然后更新页面传过来的字段
|
|
|
// why:这样的话一些在前台无需显示的字段保证不会丢失,同时一个个字段设置有助于bug排查
|
|
|
WebJsonResult wr = success();
|
|
|
+ SssbEntity entity = new SssbEntity();
|
|
|
try {
|
|
|
if (!StringUtils.isEmpty(code.getId())) {
|
|
|
- SssbEntity entity = sssbService.findOne(code.getId());
|
|
|
- entity.setSsmc(code.getSsmc());
|
|
|
- entity.setGgxh(code.getGgxh());
|
|
|
- entity.setSl(code.getSl());
|
|
|
-// entity.setSldw(code.getSldw());
|
|
|
- /*
|
|
|
- * entity.setYjfl(code.getYjfl());
|
|
|
- * entity.setEjfl(code.getEjfl());
|
|
|
- */
|
|
|
- entity.setCfcs(code.getCfcs());
|
|
|
- entity.setYxq(code.getYxq());
|
|
|
- entity.setTbr(code.getTbr());
|
|
|
- entity.setLxdh(code.getLxdh());
|
|
|
- entity.setBz(code.getBz());
|
|
|
- entity.setBh(code.getBh());
|
|
|
-
|
|
|
- if (!StringUtils.isEmpty(sldwid)) {
|
|
|
- CodeEntity sldw = new CodeEntity(sldwid);
|
|
|
- entity.setSldw(sldw);
|
|
|
- }
|
|
|
- if (!StringUtils.isEmpty(yjflid)) {
|
|
|
- CodeEntity yjfl = new CodeEntity(yjflid);
|
|
|
- entity.setYjfl(yjfl);
|
|
|
- }
|
|
|
- if (!StringUtils.isEmpty(ejflid)) {
|
|
|
- CodeEntity ejfl = new CodeEntity(ejflid);
|
|
|
- entity.setEjfl(ejfl);
|
|
|
- }
|
|
|
- if (!StringUtils.isEmpty(sbszzyqid)) {
|
|
|
- ZyqEntity zyq = new ZyqEntity();
|
|
|
- zyq.setId(sbszzyqid);
|
|
|
- entity.setSzzyq(zyq);
|
|
|
- }
|
|
|
-
|
|
|
- CodeEntity szd = new CodeEntity(szdid);
|
|
|
- entity.setSzd(szd);
|
|
|
-
|
|
|
- GkEntity szgk = new GkEntity();
|
|
|
- szgk.setId(szgkid);
|
|
|
- entity.setSzgk(szgk);
|
|
|
-
|
|
|
- GqEntity szgq = new GqEntity();
|
|
|
- szgq.setId(szgqid);
|
|
|
- entity.setSzgq(szgq);
|
|
|
-
|
|
|
- GkjyrEntity ssjyr = new GkjyrEntity();
|
|
|
- ssjyr.setId(ssjyrid);
|
|
|
- entity.setSsjyr(ssjyr);
|
|
|
-
|
|
|
- GqEntity gq = gqService.findOne(szgqid);
|
|
|
- entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
|
|
|
- if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
|
|
|
- if (path.indexOf("add") > 0) {
|
|
|
- entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
|
|
|
- } else {
|
|
|
- entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
|
|
|
- }
|
|
|
- }
|
|
|
- sssbService.save(entity);
|
|
|
- } else {
|
|
|
- CodeEntity szd = new CodeEntity(szdid);
|
|
|
- code.setSzd(szd);
|
|
|
+ entity = sssbService.findOne(code.getId());
|
|
|
+ }
|
|
|
+ entity.setSsmc(code.getSsmc());
|
|
|
+ entity.setGgxh(code.getGgxh());
|
|
|
+ entity.setSl(code.getSl());
|
|
|
+ // entity.setSldw(code.getSldw());
|
|
|
+ /*
|
|
|
+ * entity.setYjfl(code.getYjfl()); entity.setEjfl(code.getEjfl());
|
|
|
+ */
|
|
|
+ entity.setCfcs(code.getCfcs());
|
|
|
+ entity.setYxq(code.getYxq());
|
|
|
+ entity.setTbr(code.getTbr());
|
|
|
+ entity.setLxdh(code.getLxdh());
|
|
|
+ entity.setBz(code.getBz());
|
|
|
+ entity.setBh(code.getBh());
|
|
|
+
|
|
|
+ if (!StringUtils.isEmpty(sldwid)) {
|
|
|
+ CodeEntity sldw = new CodeEntity(sldwid);
|
|
|
+ entity.setSldw(sldw);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(yjflid)) {
|
|
|
+ CodeEntity yjfl = new CodeEntity(yjflid);
|
|
|
+ entity.setYjfl(yjfl);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(ejflid)) {
|
|
|
+ CodeEntity ejfl = new CodeEntity(ejflid);
|
|
|
+ entity.setEjfl(ejfl);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(sbszzyqid)) {
|
|
|
+ ZyqEntity zyq = new ZyqEntity();
|
|
|
+ zyq.setId(sbszzyqid);
|
|
|
+ entity.setSzzyq(zyq);
|
|
|
+ }
|
|
|
|
|
|
- GkEntity szgk = new GkEntity();
|
|
|
- szgk.setId(szgkid);
|
|
|
- code.setSzgk(szgk);
|
|
|
+ CodeEntity szd = new CodeEntity(szdid);
|
|
|
+ entity.setSzd(szd);
|
|
|
|
|
|
- GqEntity szgq = new GqEntity();
|
|
|
- szgq.setId(szgqid);
|
|
|
- code.setSzgq(szgq);
|
|
|
+ GkEntity szgk = new GkEntity();
|
|
|
+ szgk.setId(szgkid);
|
|
|
+ entity.setSzgk(szgk);
|
|
|
|
|
|
- GkjyrEntity ssjyr = new GkjyrEntity();
|
|
|
- ssjyr.setId(ssjyrid);
|
|
|
- code.setSsjyr(ssjyr);
|
|
|
+ GqEntity szgq = new GqEntity();
|
|
|
+ szgq.setId(szgqid);
|
|
|
+ entity.setSzgq(szgq);
|
|
|
|
|
|
- GqEntity gq = gqService.findOne(szgqid);
|
|
|
- code.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
|
|
|
+ GkjyrEntity ssjyr = new GkjyrEntity();
|
|
|
+ ssjyr.setId(ssjyrid);
|
|
|
+ entity.setSsjyr(ssjyr);
|
|
|
|
|
|
- if (!StringUtils.isEmpty(sldwid)) {
|
|
|
- CodeEntity sldw = new CodeEntity(sldwid);
|
|
|
- code.setSldw(sldw);
|
|
|
- }
|
|
|
- if (!StringUtils.isEmpty(yjflid)) {
|
|
|
- CodeEntity yjfl = new CodeEntity(yjflid);
|
|
|
- code.setYjfl(yjfl);
|
|
|
- }
|
|
|
- if (!StringUtils.isEmpty(ejflid)) {
|
|
|
- CodeEntity ejfl = new CodeEntity(ejflid);
|
|
|
- code.setEjfl(ejfl);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isEmpty(sbszzyqid)) {
|
|
|
- ZyqEntity zyq = new ZyqEntity();
|
|
|
- zyq.setId(sbszzyqid);
|
|
|
- code.setSzzyq(zyq);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
|
|
|
- if (path.indexOf("add") > 0) {
|
|
|
- code.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
|
|
|
- } else {
|
|
|
- code.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
|
|
|
- }
|
|
|
+ GqEntity gq = gqService.findOne(szgqid);
|
|
|
+ entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
|
|
|
+ if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
|
|
|
+ if (path.indexOf("add") > 0) {
|
|
|
+ entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
|
|
|
+ } else {
|
|
|
+ entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
|
|
|
}
|
|
|
- sssbService.save(code);
|
|
|
}
|
|
|
+ sssbService.save(entity);
|
|
|
// 如果是市级新增或者修改,保存后同步到省级
|
|
|
- try {
|
|
|
- if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
|
|
|
- SssbWebService webService = sssbService.getWebService(null);
|
|
|
- webService.save(code);
|
|
|
- code.setTbzt(Constants.YES);
|
|
|
- sssbService.save(code);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- code.setTbzt(Constants.NO);
|
|
|
- sssbService.save(code);
|
|
|
- }
|
|
|
+ /*
|
|
|
+ * try { if
|
|
|
+ * (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) &&
|
|
|
+ * needWS()) { SssbWebService webService =
|
|
|
+ * sssbService.getWebService(null); webService.save(entity);
|
|
|
+ * code.setTbzt(Constants.YES); sssbService.save(code); } } catch
|
|
|
+ * (Exception e) { code.setTbzt(Constants.NO);
|
|
|
+ * sssbService.save(code); }
|
|
|
+ */
|
|
|
} catch (Exception e) {
|
|
|
wr.setSuccess(false);
|
|
|
wr.setMessage("操作失败!");
|
|
@@ -400,132 +359,136 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
}
|
|
|
return wr;
|
|
|
}
|
|
|
-// @RequestMapping(value = "/save")
|
|
|
-// @RequiresPermissions("sssbxx:add")
|
|
|
-// @ResponseBody
|
|
|
-// public WebJsonResult save(Model model, String path, SssbEntity code, String szdid, String szgkid, String szgqid, String ssjyrid, String yjflid, String ejflid,String sbszzyqid) {
|
|
|
-// // how:如果是新增直接保存,如果更新,先取出数据库中记录,然后更新页面传过来的字段
|
|
|
-// // why:这样的话一些在前台无需显示的字段保证不会丢失,同时一个个字段设置有助于bug排查
|
|
|
-// WebJsonResult wr = success();
|
|
|
-// try {
|
|
|
-// if (!StringUtils.isEmpty(code.getId())) {
|
|
|
-// SssbEntity entity = sssbService.findOne(code.getId());
|
|
|
-// entity.setSsmc(code.getSsmc());
|
|
|
-// entity.setGgxh(code.getGgxh());
|
|
|
-// entity.setSl(code.getSl());
|
|
|
-// entity.setSldw(code.getSldw());
|
|
|
-// /*
|
|
|
-// * entity.setYjfl(code.getYjfl());
|
|
|
-// * entity.setEjfl(code.getEjfl());
|
|
|
-// */
|
|
|
-// entity.setCfcs(code.getCfcs());
|
|
|
-// entity.setYxq(code.getYxq());
|
|
|
-// entity.setTbr(code.getTbr());
|
|
|
-// entity.setLxdh(code.getLxdh());
|
|
|
-// entity.setBz(code.getBz());
|
|
|
-// entity.setBh(code.getBh());
|
|
|
-//
|
|
|
-// if (!StringUtils.isEmpty(yjflid)) {
|
|
|
-// CodeEntity yjfl = new CodeEntity(yjflid);
|
|
|
-// entity.setYjfl(yjfl);
|
|
|
-// }
|
|
|
-// if (!StringUtils.isEmpty(ejflid)) {
|
|
|
-// CodeEntity ejfl = new CodeEntity(ejflid);
|
|
|
-// entity.setEjfl(ejfl);
|
|
|
-// }
|
|
|
-// if (!StringUtils.isEmpty(sbszzyqid)) {
|
|
|
-// ZyqEntity zyq = new ZyqEntity();
|
|
|
-// zyq.setId(sbszzyqid);
|
|
|
-// entity.setSzzyq(zyq);
|
|
|
-// }
|
|
|
-//
|
|
|
-// CodeEntity szd = new CodeEntity(szdid);
|
|
|
-// entity.setSzd(szd);
|
|
|
-//
|
|
|
-// GkEntity szgk = new GkEntity();
|
|
|
-// szgk.setId(szgkid);
|
|
|
-// entity.setSzgk(szgk);
|
|
|
-//
|
|
|
-// GqEntity szgq = new GqEntity();
|
|
|
-// szgq.setId(szgqid);
|
|
|
-// entity.setSzgq(szgq);
|
|
|
-//
|
|
|
-// GkjyrEntity ssjyr = new GkjyrEntity();
|
|
|
-// ssjyr.setId(ssjyrid);
|
|
|
-// entity.setSsjyr(ssjyr);
|
|
|
-//
|
|
|
-// GqEntity gq = gqService.findOne(szgqid);
|
|
|
-// entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
|
|
|
-// if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
|
|
|
-// if (path.indexOf("add") > 0) {
|
|
|
-// entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
|
|
|
-// } else {
|
|
|
-// entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// sssbService.save(entity);
|
|
|
-// } else {
|
|
|
-// CodeEntity szd = new CodeEntity(szdid);
|
|
|
-// code.setSzd(szd);
|
|
|
-//
|
|
|
-// GkEntity szgk = new GkEntity();
|
|
|
-// szgk.setId(szgkid);
|
|
|
-// code.setSzgk(szgk);
|
|
|
-//
|
|
|
-// GqEntity szgq = new GqEntity();
|
|
|
-// szgq.setId(szgqid);
|
|
|
-// code.setSzgq(szgq);
|
|
|
-//
|
|
|
-// GkjyrEntity ssjyr = new GkjyrEntity();
|
|
|
-// ssjyr.setId(ssjyrid);
|
|
|
-// code.setSsjyr(ssjyr);
|
|
|
-//
|
|
|
-// GqEntity gq = gqService.findOne(szgqid);
|
|
|
-// code.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
|
|
|
-//
|
|
|
-// if (!StringUtils.isEmpty(yjflid)) {
|
|
|
-// CodeEntity yjfl = new CodeEntity(yjflid);
|
|
|
-// code.setYjfl(yjfl);
|
|
|
-// }
|
|
|
-// if (!StringUtils.isEmpty(ejflid)) {
|
|
|
-// CodeEntity ejfl = new CodeEntity(ejflid);
|
|
|
-// code.setEjfl(ejfl);
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (!StringUtils.isEmpty(sbszzyqid)) {
|
|
|
-// ZyqEntity zyq = new ZyqEntity();
|
|
|
-// zyq.setId(sbszzyqid);
|
|
|
-// code.setSzzyq(zyq);
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
|
|
|
-// if (path.indexOf("add") > 0) {
|
|
|
-// code.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
|
|
|
-// } else {
|
|
|
-// code.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// sssbService.save(code);
|
|
|
-// }
|
|
|
-// // 如果是市级新增或者修改,保存后同步到省级
|
|
|
-// try {
|
|
|
-// if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
|
|
|
-// SssbWebService webService = sssbService.getWebService(null);
|
|
|
-// webService.save(code);
|
|
|
-// code.setTbzt(Constants.YES);
|
|
|
-// sssbService.save(code);
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// code.setTbzt(Constants.NO);
|
|
|
-// sssbService.save(code);
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// wr.setSuccess(false);
|
|
|
-// wr.setMessage("操作失败!");
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// return wr;
|
|
|
-// }
|
|
|
+
|
|
|
+ // @RequestMapping(value = "/save")
|
|
|
+ // @RequiresPermissions("sssbxx:add")
|
|
|
+ // @ResponseBody
|
|
|
+ // public WebJsonResult save(Model model, String path, SssbEntity code,
|
|
|
+ // String szdid, String szgkid, String szgqid, String ssjyrid, String
|
|
|
+ // yjflid, String ejflid,String sbszzyqid) {
|
|
|
+ // // how:如果是新增直接保存,如果更新,先取出数据库中记录,然后更新页面传过来的字段
|
|
|
+ // // why:这样的话一些在前台无需显示的字段保证不会丢失,同时一个个字段设置有助于bug排查
|
|
|
+ // WebJsonResult wr = success();
|
|
|
+ // try {
|
|
|
+ // if (!StringUtils.isEmpty(code.getId())) {
|
|
|
+ // SssbEntity entity = sssbService.findOne(code.getId());
|
|
|
+ // entity.setSsmc(code.getSsmc());
|
|
|
+ // entity.setGgxh(code.getGgxh());
|
|
|
+ // entity.setSl(code.getSl());
|
|
|
+ // entity.setSldw(code.getSldw());
|
|
|
+ // /*
|
|
|
+ // * entity.setYjfl(code.getYjfl());
|
|
|
+ // * entity.setEjfl(code.getEjfl());
|
|
|
+ // */
|
|
|
+ // entity.setCfcs(code.getCfcs());
|
|
|
+ // entity.setYxq(code.getYxq());
|
|
|
+ // entity.setTbr(code.getTbr());
|
|
|
+ // entity.setLxdh(code.getLxdh());
|
|
|
+ // entity.setBz(code.getBz());
|
|
|
+ // entity.setBh(code.getBh());
|
|
|
+ //
|
|
|
+ // if (!StringUtils.isEmpty(yjflid)) {
|
|
|
+ // CodeEntity yjfl = new CodeEntity(yjflid);
|
|
|
+ // entity.setYjfl(yjfl);
|
|
|
+ // }
|
|
|
+ // if (!StringUtils.isEmpty(ejflid)) {
|
|
|
+ // CodeEntity ejfl = new CodeEntity(ejflid);
|
|
|
+ // entity.setEjfl(ejfl);
|
|
|
+ // }
|
|
|
+ // if (!StringUtils.isEmpty(sbszzyqid)) {
|
|
|
+ // ZyqEntity zyq = new ZyqEntity();
|
|
|
+ // zyq.setId(sbszzyqid);
|
|
|
+ // entity.setSzzyq(zyq);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // CodeEntity szd = new CodeEntity(szdid);
|
|
|
+ // entity.setSzd(szd);
|
|
|
+ //
|
|
|
+ // GkEntity szgk = new GkEntity();
|
|
|
+ // szgk.setId(szgkid);
|
|
|
+ // entity.setSzgk(szgk);
|
|
|
+ //
|
|
|
+ // GqEntity szgq = new GqEntity();
|
|
|
+ // szgq.setId(szgqid);
|
|
|
+ // entity.setSzgq(szgq);
|
|
|
+ //
|
|
|
+ // GkjyrEntity ssjyr = new GkjyrEntity();
|
|
|
+ // ssjyr.setId(ssjyrid);
|
|
|
+ // entity.setSsjyr(ssjyr);
|
|
|
+ //
|
|
|
+ // GqEntity gq = gqService.findOne(szgqid);
|
|
|
+ // entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
|
|
|
+ // if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
|
|
|
+ // if (path.indexOf("add") > 0) {
|
|
|
+ // entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
|
|
|
+ // } else {
|
|
|
+ // entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // sssbService.save(entity);
|
|
|
+ // } else {
|
|
|
+ // CodeEntity szd = new CodeEntity(szdid);
|
|
|
+ // code.setSzd(szd);
|
|
|
+ //
|
|
|
+ // GkEntity szgk = new GkEntity();
|
|
|
+ // szgk.setId(szgkid);
|
|
|
+ // code.setSzgk(szgk);
|
|
|
+ //
|
|
|
+ // GqEntity szgq = new GqEntity();
|
|
|
+ // szgq.setId(szgqid);
|
|
|
+ // code.setSzgq(szgq);
|
|
|
+ //
|
|
|
+ // GkjyrEntity ssjyr = new GkjyrEntity();
|
|
|
+ // ssjyr.setId(ssjyrid);
|
|
|
+ // code.setSsjyr(ssjyr);
|
|
|
+ //
|
|
|
+ // GqEntity gq = gqService.findOne(szgqid);
|
|
|
+ // code.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
|
|
|
+ //
|
|
|
+ // if (!StringUtils.isEmpty(yjflid)) {
|
|
|
+ // CodeEntity yjfl = new CodeEntity(yjflid);
|
|
|
+ // code.setYjfl(yjfl);
|
|
|
+ // }
|
|
|
+ // if (!StringUtils.isEmpty(ejflid)) {
|
|
|
+ // CodeEntity ejfl = new CodeEntity(ejflid);
|
|
|
+ // code.setEjfl(ejfl);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // if (!StringUtils.isEmpty(sbszzyqid)) {
|
|
|
+ // ZyqEntity zyq = new ZyqEntity();
|
|
|
+ // zyq.setId(sbszzyqid);
|
|
|
+ // code.setSzzyq(zyq);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
|
|
|
+ // if (path.indexOf("add") > 0) {
|
|
|
+ // code.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
|
|
|
+ // } else {
|
|
|
+ // code.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // sssbService.save(code);
|
|
|
+ // }
|
|
|
+ // // 如果是市级新增或者修改,保存后同步到省级
|
|
|
+ // try {
|
|
|
+ // if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) &&
|
|
|
+ // needWS()) {
|
|
|
+ // SssbWebService webService = sssbService.getWebService(null);
|
|
|
+ // webService.save(code);
|
|
|
+ // code.setTbzt(Constants.YES);
|
|
|
+ // sssbService.save(code);
|
|
|
+ // }
|
|
|
+ // } catch (Exception e) {
|
|
|
+ // code.setTbzt(Constants.NO);
|
|
|
+ // sssbService.save(code);
|
|
|
+ // }
|
|
|
+ // } catch (Exception e) {
|
|
|
+ // wr.setSuccess(false);
|
|
|
+ // wr.setMessage("操作失败!");
|
|
|
+ // e.printStackTrace();
|
|
|
+ // }
|
|
|
+ // return wr;
|
|
|
+ // }
|
|
|
|
|
|
@RequestMapping(value = "/edit")
|
|
|
@RequiresPermissions("sssbxx:edit")
|
|
@@ -573,10 +536,10 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
vo.setYjfl(entity.getYjfl() != null ? entity.getYjfl().getId() : "");
|
|
|
vo.setEjfl(entity.getEjfl() != null ? entity.getEjfl().getId() : "");
|
|
|
vo.setSldw(entity.getSldw() != null ? entity.getSldw().getId() : "");
|
|
|
- vo.setSzzyq(entity.getSzzyq() !=null ? entity.getSzzyq().getId() : "");
|
|
|
- vo.setSzzyqzw(entity.getSzzyq() !=null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
+ vo.setSzzyq(entity.getSzzyq() != null ? entity.getSzzyq().getId() : "");
|
|
|
+ vo.setSzzyqzw(entity.getSzzyq() != null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
model.addAttribute("record", vo);
|
|
|
- model.addAttribute("tbr",SecUtils.getCurrUser() != null ? SecUtils.getCurrUser().getName():"");
|
|
|
+ model.addAttribute("tbr", SecUtils.getCurrUser() != null ? SecUtils.getCurrUser().getName() : "");
|
|
|
return "gkjygl/gkjyr/sssb/sssbedit";
|
|
|
}
|
|
|
|
|
@@ -604,8 +567,8 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
vo.setYjfl(entity.getYjfl() != null ? entity.getYjfl().getId() : "");
|
|
|
vo.setEjfl(entity.getEjfl() != null ? entity.getEjfl().getId() : "");
|
|
|
vo.setSldw(entity.getSldw() != null ? entity.getSldw().getId() : "");
|
|
|
- vo.setSzzyq(entity.getSzzyq() !=null ? entity.getSzzyq().getId() : "");
|
|
|
- vo.setSzzyqzw(entity.getSzzyq() !=null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
+ vo.setSzzyq(entity.getSzzyq() != null ? entity.getSzzyq().getId() : "");
|
|
|
+ vo.setSzzyqzw(entity.getSzzyq() != null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
if (null != entity.getYxq()) {
|
|
|
vo.setYxqfmt(new SimpleDateFormat("yyyy-MM-dd").format(entity.getYxq()));
|
|
|
}
|
|
@@ -644,13 +607,13 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
*/
|
|
|
|
|
|
model.addAttribute("menuid", menuid);
|
|
|
- model.addAttribute("tbr",SecUtils.getCurrUser() != null ? SecUtils.getCurrUser().getName():"");
|
|
|
- if(SecUtils.getCurrUser() != null){
|
|
|
+ model.addAttribute("tbr", SecUtils.getCurrUser() != null ? SecUtils.getCurrUser().getName() : "");
|
|
|
+ if (SecUtils.getCurrUser() != null) {
|
|
|
List<CodeEntity> list = securityMgr.codeService().findValidCodesByGroupCodeAndCity(Constants.GROUP_CODE_SZD, GlobalData.CITY_CODE);
|
|
|
- model.addAttribute("sz",list.size()==1?list.get(0).getId():"");
|
|
|
- if(list.size()==1){
|
|
|
+ model.addAttribute("sz", list.size() == 1 ? list.get(0).getId() : "");
|
|
|
+ if (list.size() == 1) {
|
|
|
List<GkEntity> gklist = gkService.findBySzd(list.get(0).getId());
|
|
|
- model.addAttribute("gk",gklist.size()==1?gklist.get(0).getId():"");
|
|
|
+ model.addAttribute("gk", gklist.size() == 1 ? gklist.get(0).getId() : "");
|
|
|
}
|
|
|
}
|
|
|
return "gkjygl/gkjyr/sssb/sssbadd";
|
|
@@ -708,14 +671,14 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
return ejfllist;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/selectSldw")
|
|
|
@ResponseBody
|
|
|
public List<CodeEntity> selectSldw(Model model) {
|
|
|
List<CodeEntity> sldwlist = securityMgr.codeService().findValidCodesByGroupCode("SLDW");
|
|
|
return sldwlist;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/exportExcelAll")
|
|
|
public String exportExcelAll(HttpServletResponse response, final String ssmc, final String szgkid, final String jyr, final String szgqid, final String szdid) {
|
|
|
// 查询条件
|
|
@@ -745,8 +708,7 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
} else {
|
|
|
In<String> in = cb.in(root.get("szgq").get("id").as(String.class));
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- List<String> gqlist = (List<String>) Utils.getSession()
|
|
|
- .getAttribute("gqList");
|
|
|
+ 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));
|
|
@@ -754,7 +716,7 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
list.add(in);
|
|
|
}
|
|
|
}
|
|
|
- //状态为0,9,10,11不显示
|
|
|
+ // 状态为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));
|
|
@@ -764,7 +726,7 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
};
|
|
|
List<SssbEntity> list = query.findAll(spec, SssbEntity.class);
|
|
|
List<SssbVo> voList = entityToVo(list);
|
|
|
-
|
|
|
+
|
|
|
response.setContentType("application/binary;charset=iso-8859-1");
|
|
|
try {
|
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
@@ -776,8 +738,8 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
-
|
|
|
- public List<SssbVo> entityToVo(List<SssbEntity> list){
|
|
|
+
|
|
|
+ public List<SssbVo> entityToVo(List<SssbEntity> list) {
|
|
|
List<SssbVo> voList = new ArrayList<SssbVo>();
|
|
|
for (SssbEntity entity : list) {
|
|
|
SssbVo vo = new SssbVo();
|
|
@@ -789,15 +751,15 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
vo.setSsjyrzw(entity.getSsjyr() != null ? entity.getSsjyr().getGkjyr() : "");
|
|
|
vo.setYjflzw(entity.getYjfl() != null ? entity.getYjfl().getText() : "");
|
|
|
vo.setEjflzw(entity.getEjfl() != null ? entity.getEjfl().getText() : "");
|
|
|
- vo.setSldwzw(entity.getSldw() != null ? entity.getSldw().getText() :"");
|
|
|
+ vo.setSldwzw(entity.getSldw() != null ? entity.getSldw().getText() : "");
|
|
|
vo.setSzd(entity.getSzd() != null ? entity.getSzd().getId() : "");
|
|
|
vo.setSzgk(entity.getSzgk() != null ? entity.getSzgk().getId() : "");
|
|
|
vo.setSzgq(entity.getSzgq() != null ? entity.getSzgq().getId() : "");
|
|
|
vo.setSsjyr(entity.getSsjyr() != null ? entity.getSsjyr().getId() : "");
|
|
|
vo.setYjfl(entity.getYjfl() != null ? entity.getYjfl().getId() : "");
|
|
|
vo.setEjfl(entity.getEjfl() != null ? entity.getEjfl().getId() : "");
|
|
|
- vo.setSzzyq(entity.getSzzyq() !=null ? entity.getSzzyq().getId() : "");
|
|
|
- vo.setSzzyqzw(entity.getSzzyq() !=null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
+ vo.setSzzyq(entity.getSzzyq() != null ? entity.getSzzyq().getId() : "");
|
|
|
+ vo.setSzzyqzw(entity.getSzzyq() != null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
if (null != entity.getYxq()) {
|
|
|
vo.setYxqfmt(new SimpleDateFormat("yyyy-MM-dd").format(entity.getYxq()));
|
|
|
}
|
|
@@ -806,91 +768,109 @@ public class SssbCtl extends BaseWebCtl {
|
|
|
}
|
|
|
return voList;
|
|
|
}
|
|
|
-// @RequestMapping(value = "/exportExcelAll")
|
|
|
-// public String exportExcelAll(HttpServletResponse response, final String ssmc, final String szgkid, final String jyr, final String szgqid, final String szdid) {
|
|
|
-// // 查询条件
|
|
|
-// Specification<SssbEntity> spec = new Specification<SssbEntity>() {
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// public Predicate toPredicate(Root<SssbEntity> 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").get("id").as(String.class), "%" + szgkid + "%"));
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(szgqid)) {
|
|
|
-// list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" + szgqid + "%"));
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(jyr)) {
|
|
|
-// list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" + jyr + "%"));
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(ssmc)) {
|
|
|
-// list.add(cb.like(root.get("ssmc").get("ssmc").as(String.class), "%" + ssmc + "%"));
|
|
|
-// }
|
|
|
-// // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
|
|
|
-// if (isJyr()) {
|
|
|
-// list.add(cb.like(root.get("ssjyr").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
|
|
|
-// } else {
|
|
|
-// 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);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //状态为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<SssbEntity> list = query.findAll(spec, SssbEntity.class);
|
|
|
-// List<SssbVo> voList = new ArrayList<SssbVo>();
|
|
|
-// SimpleDateFormat formater = new SimpleDateFormat("yyyyMMdd hh:mm:ss");
|
|
|
-//
|
|
|
-// for (SssbEntity entity : list) {
|
|
|
-// SssbVo vo = new SssbVo();
|
|
|
-// if (null != entity) {
|
|
|
-// BeanUtils.copyProperties(entity, vo);
|
|
|
-// vo.setSzdzw(entity.getSzd() != null ? entity.getSzd().getText() : "");
|
|
|
-// vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
|
|
|
-// vo.setSzgqzw(entity.getSzgq() != null ? entity.getSzgq().getGqmc() : "");
|
|
|
-// vo.setSsjyrzw(entity.getSsjyr() != null ? entity.getSsjyr().getGkjyr() : "");
|
|
|
-// vo.setYjflzw(entity.getYjfl() != null ? entity.getYjfl().getText() : "");
|
|
|
-// vo.setEjflzw(entity.getEjfl() != null ? entity.getEjfl().getText() : "");
|
|
|
-// vo.setSzd(entity.getSzd() != null ? entity.getSzd().getId() : "");
|
|
|
-// vo.setSzgk(entity.getSzgk() != null ? entity.getSzgk().getId() : "");
|
|
|
-// vo.setSzgq(entity.getSzgq() != null ? entity.getSzgq().getId() : "");
|
|
|
-// vo.setSsjyr(entity.getSsjyr() != null ? entity.getSsjyr().getId() : "");
|
|
|
-// vo.setYjfl(entity.getYjfl() != null ? entity.getYjfl().getId() : "");
|
|
|
-// vo.setEjfl(entity.getEjfl() != null ? entity.getEjfl().getId() : "");
|
|
|
-// vo.setSzzyq(entity.getSzzyq() !=null ? entity.getSzzyq().getId() : "");
|
|
|
-// vo.setSzzyqzw(entity.getSzzyq() !=null ? entity.getSzzyq().getZyqmc() : "");
|
|
|
-// if (null != entity.getYxq()) {
|
|
|
-// vo.setYxqfmt(new SimpleDateFormat("yyyy-MM-dd").format(entity.getYxq()));
|
|
|
-// }
|
|
|
-//
|
|
|
-// 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 = { "序号", "所在地", "所在港口", "所在港区", "所在作业区", "港口经营人", "设备(设施)名称 ", "规格型号", "数量", "数量单位", "检验报告(或证书)编号", "有效期", "一级分类", "二级分类", "填表人", "联系电话", "存放场所", "备注" };
|
|
|
-// sssbService.exportExcelAll(voList, titles, outputStream);
|
|
|
-// } catch (IOException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// return null;
|
|
|
-// }
|
|
|
+ // @RequestMapping(value = "/exportExcelAll")
|
|
|
+ // public String exportExcelAll(HttpServletResponse response, final String
|
|
|
+ // ssmc, final String szgkid, final String jyr, final String szgqid, final
|
|
|
+ // String szdid) {
|
|
|
+ // // 查询条件
|
|
|
+ // Specification<SssbEntity> spec = new Specification<SssbEntity>() {
|
|
|
+ //
|
|
|
+ // @Override
|
|
|
+ // public Predicate toPredicate(Root<SssbEntity> 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").get("id").as(String.class), "%" +
|
|
|
+ // szgkid + "%"));
|
|
|
+ // }
|
|
|
+ // if (StringUtils.isNotEmpty(szgqid)) {
|
|
|
+ // list.add(cb.like(root.get("szgq").get("id").as(String.class), "%" +
|
|
|
+ // szgqid + "%"));
|
|
|
+ // }
|
|
|
+ // if (StringUtils.isNotEmpty(jyr)) {
|
|
|
+ // list.add(cb.like(root.get("ssjyr").get("gkjyr").as(String.class), "%" +
|
|
|
+ // jyr + "%"));
|
|
|
+ // }
|
|
|
+ // if (StringUtils.isNotEmpty(ssmc)) {
|
|
|
+ // list.add(cb.like(root.get("ssmc").get("ssmc").as(String.class), "%" +
|
|
|
+ // ssmc + "%"));
|
|
|
+ // }
|
|
|
+ // // 经营人只能查看自己企业下的数据,非经营人只能查看自己所在地的数据
|
|
|
+ // if (isJyr()) {
|
|
|
+ // list.add(cb.like(root.get("ssjyr").get("id").as(String.class), "%" +
|
|
|
+ // getSsjyr().getId() + "%"));
|
|
|
+ // } else {
|
|
|
+ // 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);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // //状态为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<SssbEntity> list = query.findAll(spec, SssbEntity.class);
|
|
|
+ // List<SssbVo> voList = new ArrayList<SssbVo>();
|
|
|
+ // SimpleDateFormat formater = new SimpleDateFormat("yyyyMMdd hh:mm:ss");
|
|
|
+ //
|
|
|
+ // for (SssbEntity entity : list) {
|
|
|
+ // SssbVo vo = new SssbVo();
|
|
|
+ // if (null != entity) {
|
|
|
+ // BeanUtils.copyProperties(entity, vo);
|
|
|
+ // vo.setSzdzw(entity.getSzd() != null ? entity.getSzd().getText() : "");
|
|
|
+ // vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
|
|
|
+ // vo.setSzgqzw(entity.getSzgq() != null ? entity.getSzgq().getGqmc() : "");
|
|
|
+ // vo.setSsjyrzw(entity.getSsjyr() != null ? entity.getSsjyr().getGkjyr() :
|
|
|
+ // "");
|
|
|
+ // vo.setYjflzw(entity.getYjfl() != null ? entity.getYjfl().getText() : "");
|
|
|
+ // vo.setEjflzw(entity.getEjfl() != null ? entity.getEjfl().getText() : "");
|
|
|
+ // vo.setSzd(entity.getSzd() != null ? entity.getSzd().getId() : "");
|
|
|
+ // vo.setSzgk(entity.getSzgk() != null ? entity.getSzgk().getId() : "");
|
|
|
+ // vo.setSzgq(entity.getSzgq() != null ? entity.getSzgq().getId() : "");
|
|
|
+ // vo.setSsjyr(entity.getSsjyr() != null ? entity.getSsjyr().getId() : "");
|
|
|
+ // vo.setYjfl(entity.getYjfl() != null ? entity.getYjfl().getId() : "");
|
|
|
+ // vo.setEjfl(entity.getEjfl() != null ? entity.getEjfl().getId() : "");
|
|
|
+ // vo.setSzzyq(entity.getSzzyq() !=null ? entity.getSzzyq().getId() : "");
|
|
|
+ // vo.setSzzyqzw(entity.getSzzyq() !=null ? entity.getSzzyq().getZyqmc() :
|
|
|
+ // "");
|
|
|
+ // if (null != entity.getYxq()) {
|
|
|
+ // vo.setYxqfmt(new SimpleDateFormat("yyyy-MM-dd").format(entity.getYxq()));
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // 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 = { "序号", "所在地", "所在港口", "所在港区", "所在作业区", "港口经营人",
|
|
|
+ // "设备(设施)名称 ", "规格型号", "数量", "数量单位", "检验报告(或证书)编号", "有效期", "一级分类", "二级分类",
|
|
|
+ // "填表人", "联系电话", "存放场所", "备注" };
|
|
|
+ // sssbService.exportExcelAll(voList, titles, outputStream);
|
|
|
+ // } catch (IOException e) {
|
|
|
+ // e.printStackTrace();
|
|
|
+ // }
|
|
|
+ // return null;
|
|
|
+ // }
|
|
|
}
|