|
@@ -268,23 +268,23 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
}
|
|
}
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
if (StringUtils.isNotEmpty(sfyx)) {
|
|
if (StringUtils.isNotEmpty(sfyx)) {
|
|
- if ("1".equals(sfyx)){
|
|
|
|
|
|
+ if ("1".equals(sfyx)) {
|
|
list.add(cb.greaterThan(root.get("yxqz").as(Date.class), now));
|
|
list.add(cb.greaterThan(root.get("yxqz").as(Date.class), now));
|
|
list.add(cb.equal(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID));
|
|
list.add(cb.equal(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID));
|
|
- } else if ("2".equals(sfyx)){
|
|
|
|
- Predicate p1 =cb.lessThan(root.get("yxqz").as(Date.class), now);
|
|
|
|
- Predicate p2 = cb.notEqual(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID);
|
|
|
|
- list.add(cb.and(cb.or(p1,p2)));
|
|
|
|
|
|
+ } else if ("2".equals(sfyx)) {
|
|
|
|
+ Predicate p1 = cb.lessThan(root.get("yxqz").as(Date.class), now);
|
|
|
|
+ Predicate p2 = cb.notEqual(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID);
|
|
|
|
+ list.add(cb.and(cb.or(p1, p2)));
|
|
}
|
|
}
|
|
} else if (isGET(request)) {
|
|
} else if (isGET(request)) {
|
|
String v = (String) CacheSearchCondition.cacheSCmapVal(cacheSCmap, "sfyx");
|
|
String v = (String) CacheSearchCondition.cacheSCmapVal(cacheSCmap, "sfyx");
|
|
- if ("1".equals(v)){
|
|
|
|
|
|
+ if ("1".equals(v)) {
|
|
list.add(cb.greaterThan(root.get("yxqz").as(Date.class), now));
|
|
list.add(cb.greaterThan(root.get("yxqz").as(Date.class), now));
|
|
list.add(cb.equal(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID));
|
|
list.add(cb.equal(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID));
|
|
- } else if ("2".equals(v)){
|
|
|
|
- Predicate p1 =cb.lessThan(root.get("yxqz").as(Date.class), now);
|
|
|
|
- Predicate p2 = cb.notEqual(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID);
|
|
|
|
- list.add(cb.and(cb.or(p1,p2)));
|
|
|
|
|
|
+ } else if ("2".equals(v)) {
|
|
|
|
+ Predicate p1 = cb.lessThan(root.get("yxqz").as(Date.class), now);
|
|
|
|
+ Predicate p2 = cb.notEqual(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID);
|
|
|
|
+ list.add(cb.and(cb.or(p1, p2)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (yxq1 != null) {
|
|
if (yxq1 != null) {
|
|
@@ -360,24 +360,18 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- /*String user1 = (String) Utils.getSession().getAttribute("user");
|
|
|
|
- String user2 = SecUtils.getCurrUser().getId();
|
|
|
|
- if (user2 != null) {
|
|
|
|
- if (!user2.equals(user1)) {
|
|
|
|
- SearchCondition.xkzpage = 1;
|
|
|
|
- SearchCondition.xkzgkjyr = "";
|
|
|
|
- SearchCondition.xkzszdid = "";
|
|
|
|
- SearchCondition.xkzszgqid = "";
|
|
|
|
- SearchCondition.xkzszgkid = "";
|
|
|
|
- SearchCondition.xkzgkjyxkzh = "";
|
|
|
|
- SearchCondition.sfyx = "";
|
|
|
|
- SearchCondition.yxq1 = null;
|
|
|
|
- SearchCondition.yxq2 = null;
|
|
|
|
- SearchCondition.xkzsfdq = "";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- Utils.getSession().setAttribute("user", user2);*/
|
|
|
|
|
|
+ /*
|
|
|
|
+ * String user1 = (String) Utils.getSession().getAttribute("user");
|
|
|
|
+ * String user2 = SecUtils.getCurrUser().getId(); if (user2 != null) {
|
|
|
|
+ * if (!user2.equals(user1)) { SearchCondition.xkzpage = 1;
|
|
|
|
+ * SearchCondition.xkzgkjyr = ""; SearchCondition.xkzszdid = "";
|
|
|
|
+ * SearchCondition.xkzszgqid = ""; SearchCondition.xkzszgkid = "";
|
|
|
|
+ * SearchCondition.xkzgkjyxkzh = ""; SearchCondition.sfyx = "";
|
|
|
|
+ * SearchCondition.yxq1 = null; SearchCondition.yxq2 = null;
|
|
|
|
+ * SearchCondition.xkzsfdq = ""; }
|
|
|
|
+ *
|
|
|
|
+ * } Utils.getSession().setAttribute("user", user2);
|
|
|
|
+ */
|
|
|
|
|
|
if (page.getPage() < 1) {
|
|
if (page.getPage() < 1) {
|
|
page.setPage(SearchCondition.xkzpage);
|
|
page.setPage(SearchCondition.xkzpage);
|
|
@@ -391,14 +385,14 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
if (entity != null && entity.getRecordStatus() != 9) {
|
|
if (entity != null && entity.getRecordStatus() != 9) {
|
|
BeanUtils.copyProperties(entity, vo);
|
|
BeanUtils.copyProperties(entity, vo);
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
-
|
|
|
|
|
|
+
|
|
long day = (entity.getYxqz().getTime() - date.getTime()) / (24 * 60 * 60 * 1000);
|
|
long day = (entity.getYxqz().getTime() - date.getTime()) / (24 * 60 * 60 * 1000);
|
|
if (day < 30 || day == 30) {
|
|
if (day < 30 || day == 30) {
|
|
vo.setSfred("1");
|
|
vo.setSfred("1");
|
|
} else {
|
|
} else {
|
|
vo.setSfred("2");
|
|
vo.setSfred("2");
|
|
}
|
|
}
|
|
- if (String.valueOf(BaseEntity.RECORD_STATE_VALID).equals(entity.getSfyx()) && entity.getYxqz().getTime()-date.getTime()>=0){
|
|
|
|
|
|
+ if (String.valueOf(BaseEntity.RECORD_STATE_VALID).equals(entity.getSfyx()) && entity.getYxqz().getTime() - date.getTime() >= 0) {
|
|
vo.setSfyx("1");
|
|
vo.setSfyx("1");
|
|
} else {
|
|
} else {
|
|
vo.setSfyx("2");
|
|
vo.setSfyx("2");
|
|
@@ -431,10 +425,10 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
}
|
|
}
|
|
|
|
|
|
if (isPOST(request)) {
|
|
if (isPOST(request)) {
|
|
- SearchCondition.xkzpage=page.getPage();
|
|
|
|
- //cacheSCmap.put("xkzpage", page.getPage());
|
|
|
|
|
|
+ SearchCondition.xkzpage = page.getPage();
|
|
|
|
+ // cacheSCmap.put("xkzpage", page.getPage());
|
|
CacheSearchCondition.putCacheSCmap(request.getParameterMap(), cacheSCmap);
|
|
CacheSearchCondition.putCacheSCmap(request.getParameterMap(), cacheSCmap);
|
|
- //System.out.println(JSONObject.fromObject(cacheSCmap));
|
|
|
|
|
|
+ // System.out.println(JSONObject.fromObject(cacheSCmap));
|
|
}
|
|
}
|
|
|
|
|
|
model.addAttribute("list", voList);
|
|
model.addAttribute("list", voList);
|
|
@@ -627,16 +621,22 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
wr.setSuccess(false);
|
|
wr.setSuccess(false);
|
|
if (gkjyr.getRecordStatus() == 5) {
|
|
if (gkjyr.getRecordStatus() == 5) {
|
|
wr.setMessage("该经营人正在许可申请中,不可操作");
|
|
wr.setMessage("该经营人正在许可申请中,不可操作");
|
|
|
|
+ return wr;
|
|
} else if (gkjyr.getRecordStatus() == 6) {
|
|
} else if (gkjyr.getRecordStatus() == 6) {
|
|
wr.setMessage("该经营人正在许可延续中,不可操作");
|
|
wr.setMessage("该经营人正在许可延续中,不可操作");
|
|
|
|
+ return wr;
|
|
} else if (gkjyr.getRecordStatus() == 7 || gkjyr.getRecordStatus() == 11) {
|
|
} else if (gkjyr.getRecordStatus() == 7 || gkjyr.getRecordStatus() == 11) {
|
|
wr.setMessage("该经营人正在许可注销中,不可操作");
|
|
wr.setMessage("该经营人正在许可注销中,不可操作");
|
|
|
|
+ return wr;
|
|
} else if (gkjyr.getRecordStatus() == 8 || gkjyr.getRecordStatus() == 10) {
|
|
} else if (gkjyr.getRecordStatus() == 8 || gkjyr.getRecordStatus() == 10) {
|
|
wr.setMessage("该经营人正在许可变更中,不可操作");
|
|
wr.setMessage("该经营人正在许可变更中,不可操作");
|
|
|
|
+ return wr;
|
|
} else if (gkjyr.getRecordStatus() == 9) {
|
|
} else if (gkjyr.getRecordStatus() == 9) {
|
|
wr.setMessage("该经营人已删除,不可操作");
|
|
wr.setMessage("该经营人已删除,不可操作");
|
|
|
|
+ return wr;
|
|
} else {
|
|
} else {
|
|
wr.setMessage("操作失败");
|
|
wr.setMessage("操作失败");
|
|
|
|
+ return wr;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
List<XkzxxEntity> xkzlist = xkzxxService.findByJyrid(gkjyr.getId(), Constants.XKZ_SX);
|
|
List<XkzxxEntity> xkzlist = xkzxxService.findByJyrid(gkjyr.getId(), Constants.XKZ_SX);
|
|
@@ -644,40 +644,77 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
xkzxx = xkzlist.get(0);
|
|
xkzxx = xkzlist.get(0);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ((xkzlist == null || xkzlist.size() < 1)) {
|
|
|
|
+
|
|
|
|
+ List<LhsqEntity> lhsqlist = lhsqService.findByJyrid(gkjyr.getId());
|
|
|
|
+ if (lhsqlist != null && lhsqlist.size() > 0) {
|
|
|
|
+ for (LhsqEntity lhsq : lhsqlist) {
|
|
|
|
+ if ("0".equals(lhsq.getFlowstatus())) {
|
|
|
|
+ wr.setSuccess(false);
|
|
|
|
+ wr.setMessage("该经营人正在理货申请中,请勿再申请");
|
|
|
|
+ return wr;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<LhyxEntity> lhyxlist = lhyxService.findByJyrid(gkjyr.getId());
|
|
|
|
+ if (lhyxlist != null && lhyxlist.size() > 0) {
|
|
|
|
+ for (LhyxEntity lhyx : lhyxlist) {
|
|
|
|
+ if ("0".equals(lhyx.getFlowstatus())) {
|
|
|
|
+ wr.setSuccess(false);
|
|
|
|
+ wr.setMessage("该经营人正在理货延续中,请勿再申请");
|
|
|
|
+ return wr;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<LhbgEntity> lhbglist = lhbgService.findByJyrid(gkjyr.getId());
|
|
|
|
+ if (lhbglist != null && lhbglist.size() > 0) {
|
|
|
|
+ for (LhbgEntity lhbg : lhbglist) {
|
|
|
|
+ if ("0".equals(lhbg.getFlowstatus())) {
|
|
|
|
+ wr.setSuccess(false);
|
|
|
|
+ wr.setMessage("该经营人正在理货变更中,请勿再申请");
|
|
|
|
+ return wr;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ wr.setSuccess(false);
|
|
|
|
+ wr.setMessage("请经营人填写许可证信息后再操作");
|
|
|
|
+ return wr;
|
|
|
|
+ }
|
|
if (StringUtils.isEmpty(xkzxx.getStype())) {
|
|
if (StringUtils.isEmpty(xkzxx.getStype())) {
|
|
|
|
+
|
|
if ("1".equals(flag)) {// 申请
|
|
if ("1".equals(flag)) {// 申请
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
wr.setSuccess(false);
|
|
wr.setSuccess(false);
|
|
wr.setMessage("该经营人已经申请过许可证,请勿再申请");
|
|
wr.setMessage("该经营人已经申请过许可证,请勿再申请");
|
|
|
|
+ return wr;
|
|
}
|
|
}
|
|
} else if ("2".equals(flag)) {
|
|
} else if ("2".equals(flag)) {
|
|
xkzlist = xkzxxService.findByJyrid(gkjyr.getId(), Constants.XKZ_WSX);
|
|
xkzlist = xkzxxService.findByJyrid(gkjyr.getId(), Constants.XKZ_WSX);
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
wr.setSuccess(false);
|
|
wr.setSuccess(false);
|
|
wr.setMessage("该经营人已经延续过许可证,请勿再申请");
|
|
wr.setMessage("该经营人已经延续过许可证,请勿再申请");
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (xkzlist == null || xkzlist.size() < 1) {
|
|
|
|
- wr.setSuccess(false);
|
|
|
|
- wr.setMessage("请经营人填写许可证信息后再操作");
|
|
|
|
|
|
+ return wr;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else if("1".equals(xkzxx.getStype())){
|
|
|
|
|
|
+
|
|
|
|
+ } else if ("1".equals(xkzxx.getStype())) {
|
|
|
|
+
|
|
if ("1".equals(flag)) {// 申请
|
|
if ("1".equals(flag)) {// 申请
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
wr.setSuccess(false);
|
|
wr.setSuccess(false);
|
|
wr.setMessage("该经营人已经申请过理货许可证,请勿再申请");
|
|
wr.setMessage("该经营人已经申请过理货许可证,请勿再申请");
|
|
|
|
+ return wr;
|
|
}
|
|
}
|
|
} else if ("2".equals(flag)) {
|
|
} else if ("2".equals(flag)) {
|
|
xkzlist = xkzxxService.findByJyrid(gkjyr.getId(), Constants.XKZ_WSX);
|
|
xkzlist = xkzxxService.findByJyrid(gkjyr.getId(), Constants.XKZ_WSX);
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
if (xkzlist != null && xkzlist.size() > 0) {
|
|
wr.setSuccess(false);
|
|
wr.setSuccess(false);
|
|
wr.setMessage("该经营人已经延续过理货许可证,请勿再申请");
|
|
wr.setMessage("该经营人已经延续过理货许可证,请勿再申请");
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (xkzlist == null || xkzlist.size() < 1) {
|
|
|
|
- wr.setSuccess(false);
|
|
|
|
- wr.setMessage("请经营人填写理货许可证信息后再操作");
|
|
|
|
|
|
+ return wr;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1028,23 +1065,23 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
if (StringUtils.isNotEmpty(gkjyxkzh)) {
|
|
if (StringUtils.isNotEmpty(gkjyxkzh)) {
|
|
list.add(cb.like(root.get("gkjyxkzh").as(String.class), "%" + 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 (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"));
|
|
|
|
+ // // }
|
|
|
|
+ // }
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
if (StringUtils.isNotEmpty(sfyx)) {
|
|
if (StringUtils.isNotEmpty(sfyx)) {
|
|
- if ("1".equals(sfyx)){
|
|
|
|
|
|
+ if ("1".equals(sfyx)) {
|
|
list.add(cb.greaterThan(root.get("yxqz").as(Date.class), now));
|
|
list.add(cb.greaterThan(root.get("yxqz").as(Date.class), now));
|
|
list.add(cb.equal(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID));
|
|
list.add(cb.equal(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID));
|
|
- } else if ("2".equals(sfyx)){
|
|
|
|
- Predicate p1 =cb.lessThan(root.get("yxqz").as(Date.class), now);
|
|
|
|
- Predicate p2 = cb.notEqual(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID);
|
|
|
|
- list.add(cb.and(cb.or(p1,p2)));
|
|
|
|
|
|
+ } else if ("2".equals(sfyx)) {
|
|
|
|
+ Predicate p1 = cb.lessThan(root.get("yxqz").as(Date.class), now);
|
|
|
|
+ Predicate p2 = cb.notEqual(root.get("sfyx").as(String.class), BaseEntity.RECORD_STATE_VALID);
|
|
|
|
+ list.add(cb.and(cb.or(p1, p2)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (yxq1 != null) {
|
|
if (yxq1 != null) {
|
|
@@ -1135,13 +1172,13 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
@RequestMapping(value = "/editxkz")
|
|
@RequestMapping(value = "/editxkz")
|
|
public String editxkz(Model model, String id, String status, String menuid) {
|
|
public String editxkz(Model model, String id, String status, String menuid) {
|
|
model.addAttribute("menuid", menuid);
|
|
model.addAttribute("menuid", menuid);
|
|
- String path="";
|
|
|
|
- if("11".equals(status)){
|
|
|
|
- path="/xkzsq/main";
|
|
|
|
- }else if("12".equals(status)){
|
|
|
|
- path="/xkzbg/main";
|
|
|
|
- }else if("13".equals(status)){
|
|
|
|
- path="/xkzyx/main";
|
|
|
|
|
|
+ String path = "";
|
|
|
|
+ if ("11".equals(status)) {
|
|
|
|
+ path = "/xkzsq/main";
|
|
|
|
+ } else if ("12".equals(status)) {
|
|
|
|
+ path = "/xkzbg/main";
|
|
|
|
+ } else if ("13".equals(status)) {
|
|
|
|
+ path = "/xkzyx/main";
|
|
}
|
|
}
|
|
|
|
|
|
XkzxxEntity xkzxx = xkzxxService.findByOpid(id, status);
|
|
XkzxxEntity xkzxx = xkzxxService.findByOpid(id, status);
|
|
@@ -1328,13 +1365,13 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
@RequestMapping(value = "/editLhxkz")
|
|
@RequestMapping(value = "/editLhxkz")
|
|
public String editLhxkz(Model model, String id, String status, String menuid) {
|
|
public String editLhxkz(Model model, String id, String status, String menuid) {
|
|
model.addAttribute("menuid", menuid);
|
|
model.addAttribute("menuid", menuid);
|
|
- String path="";
|
|
|
|
- if("111".equals(status)){
|
|
|
|
- path="/lhsq/main";
|
|
|
|
- }else if("122".equals(status)){
|
|
|
|
- path="/lhbg/main";
|
|
|
|
- }else if("133".equals(status)){
|
|
|
|
- path="/lhyx/main";
|
|
|
|
|
|
+ String path = "";
|
|
|
|
+ if ("111".equals(status)) {
|
|
|
|
+ path = "/lhsq/main";
|
|
|
|
+ } else if ("122".equals(status)) {
|
|
|
|
+ path = "/lhbg/main";
|
|
|
|
+ } else if ("133".equals(status)) {
|
|
|
|
+ path = "/lhyx/main";
|
|
}
|
|
}
|
|
model.addAttribute("path", path);
|
|
model.addAttribute("path", path);
|
|
XkzxxEntity xkzxx = xkzxxService.findByOpid(id, status);
|
|
XkzxxEntity xkzxx = xkzxxService.findByOpid(id, status);
|
|
@@ -2039,7 +2076,7 @@ public class XkzxxCtl extends BaseWebCtl {
|
|
} else if ("13".equals(xkzxx.getSfyx())) {
|
|
} else if ("13".equals(xkzxx.getSfyx())) {
|
|
xkzxx.setSfyx(Constants.XKZ_WSX);
|
|
xkzxx.setSfyx(Constants.XKZ_WSX);
|
|
xkzxx = xkzxxService.save(xkzxx);
|
|
xkzxx = xkzxxService.save(xkzxx);
|
|
-
|
|
|
|
|
|
+
|
|
GkjyrEntity jyr = gkjyrService.findOne(xkzxx.getGkjyr());
|
|
GkjyrEntity jyr = gkjyrService.findOne(xkzxx.getGkjyr());
|
|
if (jyr != null) {
|
|
if (jyr != null) {
|
|
jyr.setRecordStatus(BaseEntity.RECORD_STATE_VALID);
|
|
jyr.setRecordStatus(BaseEntity.RECORD_STATE_VALID);
|