Commit 8a9706e2 by xing_wang

海南单位特殊判断

parent a7972ea8
...@@ -6,6 +6,7 @@ import com.xzxtshiro.service.SysDictitemService; ...@@ -6,6 +6,7 @@ import com.xzxtshiro.service.SysDictitemService;
import com.xzxtshiro.service.SysRoleService; import com.xzxtshiro.service.SysRoleService;
import com.xzxtshiro.service.SysUserService; import com.xzxtshiro.service.SysUserService;
import com.xzxtshiro.util.Base64PasswordEncrypter; import com.xzxtshiro.util.Base64PasswordEncrypter;
import com.xzxtshiro.util.PropertiesUtils;
import com.xzxtshiro.util.TokenUtil; import com.xzxtshiro.util.TokenUtil;
import com.xzxtshiro.util.ZtreeDataUtil; import com.xzxtshiro.util.ZtreeDataUtil;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
...@@ -157,17 +158,44 @@ public class SysUserController { ...@@ -157,17 +158,44 @@ public class SysUserController {
} }
private static String subUnitCode(String usergrade, String unitcode, String dw) { private static String subUnitCode(String usergrade, String unitcode, String dw) {
if (usergrade.equals("S") || usergrade.equals("T")) { PropertiesUtils propertiesUtil=new PropertiesUtils("resource/db.properties");
dw=unitcode.substring(0, 2); String ssdw=propertiesUtil.getValue("ssdw");
} else if (usergrade.equals("D")) { if (ssdw.indexOf("46") == 0) {
dw=unitcode.substring(0, 4); if (("S".equals(usergrade) || "T".equals(usergrade))) {
} else if (usergrade.equals("X")) { dw=unitcode.substring(0, 2);
dw=unitcode.substring(0, 6); }else {
} else if (usergrade.equals("K")) { if(unitcode.indexOf("4690")==0){//直属县
dw=unitcode.substring(0, 8); if ("D".equals(usergrade)) {
} else if (usergrade.equals("P")) { dw = unitcode.substring(0, 6);//原理地基单位下面去四位,但为了排除无效单位取两位即可
dw=unitcode; }else if ("X".equals(usergrade)){
dw = unitcode.substring(0, 8);
}else if (usergrade.equals("K")) {
dw=unitcode.substring(0, 10);
}
}else {
if (usergrade.equals("D") ) {
dw=unitcode.substring(0, 4);
} else if (usergrade.equals("X")) {
dw=unitcode.substring(0, 6);
} else if (usergrade.equals("K")) {
dw=unitcode.substring(0, 8);
}
}
}
}else {
if (usergrade.equals("S") || usergrade.equals("T")) {
dw=unitcode.substring(0, 2);
} else if (usergrade.equals("D")) {
dw=unitcode.substring(0, 4);
} else if (usergrade.equals("X")) {
dw=unitcode.substring(0, 6);
} else if (usergrade.equals("K")) {
dw=unitcode.substring(0, 8);
} else if (usergrade.equals("P")) {
dw=unitcode;
}
} }
return dw; return dw;
} }
......
...@@ -7,3 +7,4 @@ jdbc.password=XZXT ...@@ -7,3 +7,4 @@ jdbc.password=XZXT
rest.host=http://127.0.0.1 rest.host=http://127.0.0.1
rest.port=9043 rest.port=9043
ssdw=460000000000
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment