|
@@ -10,6 +10,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
+import javax.persistence.criteria.CriteriaBuilder.In;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
@@ -33,6 +34,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.xt.jygl.common.BaseWebCtl;
|
|
|
import com.xt.jygl.common.Constants;
|
|
|
import com.xt.jygl.common.GlobalData;
|
|
|
+import com.xt.jygl.common.Utils;
|
|
|
import com.xt.jygl.ggfwxxgl.jdtx.entity.TxEntity;
|
|
|
import com.xt.jygl.ggfwxxgl.jdtx.service.TxService;
|
|
|
import com.xt.jygl.ggfwxxgl.tzgg.ggxx.entity.GgxxtxEntity;
|
|
@@ -43,6 +45,7 @@ import com.xt.jygl.gkjcxx.xzdwxxgl.xzglryxx.entity.XzglryEntity;
|
|
|
import com.xt.jygl.gkjcxx.xzdwxxgl.xzglryxx.service.XzglryService;
|
|
|
import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
|
|
|
import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.service.GkjyrService;
|
|
|
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.vo.GkjyrVo;
|
|
|
import com.xt.jygl.set.user.client.UserService;
|
|
|
import com.xt.jygl.set.user.client.UserWebService;
|
|
|
import com.xtframe.core.anon.auth.RequiresPermissions;
|
|
@@ -85,7 +88,7 @@ public class UserCtl extends BaseWebCtl {
|
|
|
@RequiresPermissions("user:main")
|
|
|
public String main(SimplePageRequest page, Model model, final HttpServletRequest request, final String menuid, final String username, final String uname, final String sfjyr) throws JsonProcessingException {
|
|
|
// 查詢條件
|
|
|
- final Map<String, Object> cacheSCmap = CacheSearchCondition.cacheSCmap(request,"user");
|
|
|
+ final Map<String, Object> cacheSCmap = CacheSearchCondition.cacheSCmap(request, "user");
|
|
|
Specification<UserEntity> spec = new Specification<UserEntity>() {
|
|
|
|
|
|
@Override
|
|
@@ -93,24 +96,28 @@ public class UserCtl extends BaseWebCtl {
|
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
|
if (StringUtils.isNotEmpty(username)) {
|
|
|
list.add(cb.like(root.get("name").as(String.class), "%" + username + "%"));
|
|
|
- }else if (isGET(request)) {
|
|
|
- CacheSearchCondition.predicateList(list, cacheSCmap, root, cb, null,"name");
|
|
|
+ } else if (isGET(request)) {
|
|
|
+ CacheSearchCondition.predicateList(list, cacheSCmap, root, cb, null, "name");
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(uname)) {
|
|
|
list.add(cb.like(root.get("uname").as(String.class), "%" + uname + "%"));
|
|
|
- }else if (isGET(request)) {
|
|
|
- CacheSearchCondition.predicateList(list, cacheSCmap, root, cb, null,"uname");
|
|
|
+ } else if (isGET(request)) {
|
|
|
+ CacheSearchCondition.predicateList(list, cacheSCmap, root, cb, null, "uname");
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(sfjyr)) {
|
|
|
list.add(cb.equal(root.get("sfjyr").get("id").as(String.class), sfjyr));
|
|
|
- }else if (isGET(request)) {
|
|
|
- CacheSearchCondition.predicateList(list, cacheSCmap, root, cb, "id","sfjyr");
|
|
|
+ } else if (isGET(request)) {
|
|
|
+ CacheSearchCondition.predicateList(list, cacheSCmap, root, cb, "id", "sfjyr");
|
|
|
}
|
|
|
+ if (isJyr()) {
|
|
|
+ list.add(cb.like(root.get("ssjyr").get("id").as(String.class), "%" + getSsjyr().getId() + "%"));
|
|
|
+ }
|
|
|
+
|
|
|
list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
|
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
if (page.getPage() < 1) {
|
|
|
Object userpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "userpage");
|
|
|
if (StringUtils.isEmpty(userpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(userpage))) {
|
|
@@ -128,13 +135,13 @@ public class UserCtl extends BaseWebCtl {
|
|
|
userEntity.setSsglbmzw(userEntity.getSsglbm() != null ? userEntity.getSsglbm().getGkglbmqc() : "");
|
|
|
userList.add(userEntity);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (isPOST(request)) {
|
|
|
cacheSCmap.put("userpage", page.getPage());
|
|
|
CacheSearchCondition.putCacheSCmap(request.getParameterMap(), cacheSCmap);
|
|
|
}
|
|
|
model.addAttribute("list", userList);
|
|
|
- model.addAttribute("username", CacheSearchCondition.cacheSCmapVal(cacheSCmap, "username"));
|
|
|
+ model.addAttribute("username", CacheSearchCondition.cacheSCmapVal(cacheSCmap, "username"));
|
|
|
model.addAttribute("uname", CacheSearchCondition.cacheSCmapVal(cacheSCmap, "uname"));
|
|
|
model.addAttribute("sfjyr", CacheSearchCondition.cacheSCmapVal(cacheSCmap, "sfjyr"));
|
|
|
model.addAttribute("menuid", menuid);
|
|
@@ -295,6 +302,12 @@ public class UserCtl extends BaseWebCtl {
|
|
|
model.addAttribute("rolelist", JSONArray.fromObject(rolelist, config).toString());
|
|
|
model.addAttribute("roles", JSONArray.fromObject(roles, config).toString());
|
|
|
model.addAttribute("record", userEntity);
|
|
|
+ GkjyrVo gkjyr = null;
|
|
|
+ if (isJyr()) {
|
|
|
+ gkjyr = new GkjyrVo();
|
|
|
+ gkjyr = getSsjyr();
|
|
|
+ }
|
|
|
+ model.addAttribute("gkjyr", gkjyr);
|
|
|
return "set/user/useredit";
|
|
|
}
|
|
|
|
|
@@ -311,10 +324,10 @@ public class UserCtl extends BaseWebCtl {
|
|
|
List<RoleEntity> roles = this.securityMgr.roleService().findByUserId(userEntity.getId());
|
|
|
String rolezw = "";
|
|
|
for (RoleEntity r : roles) {
|
|
|
- rolezw += r.getName()+",";
|
|
|
+ rolezw += r.getName() + ",";
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(rolezw)){
|
|
|
- rolezw = rolezw.substring(0,rolezw.length()-1);
|
|
|
+ if (!StringUtils.isEmpty(rolezw)) {
|
|
|
+ rolezw = rolezw.substring(0, rolezw.length() - 1);
|
|
|
}
|
|
|
userEntity.setRolezw(rolezw);
|
|
|
userEntity.setSfjyrzw(userEntity.getSfjyr() != null ? userEntity.getSfjyr().getText() : "");
|
|
@@ -336,6 +349,14 @@ public class UserCtl extends BaseWebCtl {
|
|
|
public String add(Model model) {
|
|
|
List<RoleEntity> rolelist = securityMgr.roleService().findAll();
|
|
|
model.addAttribute("rolelist", JSONArray.fromObject(rolelist, config).toString());
|
|
|
+ GkjyrVo gkjyr = null;
|
|
|
+ if (isJyr()) {
|
|
|
+ gkjyr = new GkjyrVo();
|
|
|
+ gkjyr = getSsjyr();
|
|
|
+ model.addAttribute("szd", gkjyr.getSzd());
|
|
|
+ }
|
|
|
+
|
|
|
+ model.addAttribute("gkjyr", gkjyr);
|
|
|
return "set/user/useradd";
|
|
|
}
|
|
|
|
|
@@ -553,7 +574,7 @@ public class UserCtl extends BaseWebCtl {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/reset")
|
|
|
@ResponseBody
|
|
|
public WebJsonResult reset(String id) {
|