Commit 8a9706e2 by xing_wang

海南单位特殊判断

parent a7972ea8
......@@ -6,6 +6,7 @@ import com.xzxtshiro.service.SysDictitemService;
import com.xzxtshiro.service.SysRoleService;
import com.xzxtshiro.service.SysUserService;
import com.xzxtshiro.util.Base64PasswordEncrypter;
import com.xzxtshiro.util.PropertiesUtils;
import com.xzxtshiro.util.TokenUtil;
import com.xzxtshiro.util.ZtreeDataUtil;
import net.sf.json.JSONArray;
......@@ -157,6 +158,31 @@ public class SysUserController {
}
private static String subUnitCode(String usergrade, String unitcode, String dw) {
PropertiesUtils propertiesUtil=new PropertiesUtils("resource/db.properties");
String ssdw=propertiesUtil.getValue("ssdw");
if (ssdw.indexOf("46") == 0) {
if (("S".equals(usergrade) || "T".equals(usergrade))) {
dw=unitcode.substring(0, 2);
}else {
if(unitcode.indexOf("4690")==0){//直属县
if ("D".equals(usergrade)) {
dw = unitcode.substring(0, 6);//原理地基单位下面去四位,但为了排除无效单位取两位即可
}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")) {
......@@ -168,6 +194,8 @@ public class SysUserController {
} else if (usergrade.equals("P")) {
dw=unitcode;
}
}
return dw;
}
......
......@@ -7,3 +7,4 @@ jdbc.password=XZXT
rest.host=http://127.0.0.1
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