Commit bf1bf8d2 authored by wanglong's avatar wanglong

修改问题

parent 94662d07
...@@ -40,6 +40,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -40,6 +40,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import java.util.*; import java.util.*;
import static com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant.ORG_CODE_USER;
import static org.typroject.tyboot.component.cache.Redis.redisTemplate; import static org.typroject.tyboot.component.cache.Redis.redisTemplate;
@Service @Service
...@@ -123,7 +124,7 @@ public class OrgServiceImpl { ...@@ -123,7 +124,7 @@ public class OrgServiceImpl {
* @return * @return
*/ */
final static int codeSum = 12; final static int codeSum = 12;
final static int codeUserSum = 12; final static int codeUserSum = 6;
public OrgUsr saveOrgUsr(JSONObject jsonObject,String bizOrgType,String sequenceNbr){ public OrgUsr saveOrgUsr(JSONObject jsonObject,String bizOrgType,String sequenceNbr){
ReginParams reginParams = getReginParams(); ReginParams reginParams = getReginParams();
OrgUsr orgUsr = new OrgUsr(); OrgUsr orgUsr = new OrgUsr();
...@@ -177,14 +178,17 @@ public class OrgServiceImpl { ...@@ -177,14 +178,17 @@ public class OrgServiceImpl {
OrgUsr parent = orgUsrServiceImpl.getById(orgUsr.getParentId()); OrgUsr parent = orgUsrServiceImpl.getById(orgUsr.getParentId());
if (parent != null && ObjectUtils.isEmpty(orgUsr.getBizOrgCode())) { if (parent != null && ObjectUtils.isEmpty(orgUsr.getBizOrgCode())) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + OrgUsrServiceImpl.getOrgCodeStr()); orgUsr.setBizOrgCode(parent.getBizOrgCode() + OrgUsrServiceImpl.getOrgCodeStr());
} else if (jsonObject.get("type").equals("WELDER") && parent.getBizOrgCode().length()< XJConstant.ORG_CODE) {//添加部门 }
if (!ValidationUtil.isEmpty(jsonObject.get("typeUser"))){
if (jsonObject.get("typeUser").equals("add") || (jsonObject.get("typeUser").equals("edit") && parent.getBizOrgCode().length()< XJConstant.ORG_CODE)) {//添加部门
orgUsr.setBizOrgCode(parent.getBizOrgCode() + OrgUsrServiceImpl.getOrgCodeStr()); orgUsr.setBizOrgCode(parent.getBizOrgCode() + OrgUsrServiceImpl.getOrgCodeStr());
} else if (jsonObject.get("type").equals("WELDER") && parent.getBizOrgCode().length()== XJConstant.ORG_CODE) {//修改部门 } else if (jsonObject.get("typeUser").equals("edit") && parent.getBizOrgCode().length()== XJConstant.ORG_CODE) {//修改部门
orgUsr.setBizOrgCode(parent.getBizOrgCode().substring(0,codeSum)+OrgUsrServiceImpl.getOrgCodeStr()); orgUsr.setBizOrgCode(parent.getBizOrgCode().substring(0,codeSum)+OrgUsrServiceImpl.getOrgCodeStr());
} else if (ValidationUtil.isEmpty(jsonObject.get("type"))&&parent.getBizOrgCode().length()== XJConstant.ORG_CODE_USER) {//部门负责人修改 } else if (jsonObject.get("typeUser").equals("addUser")&&parent.getBizOrgCode().length()== ORG_CODE_USER || parent.getBizOrgCode().length()== XJConstant.ORG_CODE) {//部门负责人修改
orgUsr.setBizOrgCode(parent.getBizOrgCode().substring(0,codeUserSum)+OrgUsrServiceImpl.getOrgCodeStr()); orgUsr.setBizOrgCode(parent.getBizOrgCode().substring(0,codeUserSum)+OrgUsrServiceImpl.getOrgCodeStr());
} }
}
} else { } else {
orgUsr.setBizOrgCode(OrgUsrServiceImpl.getOrgCodeStr()); orgUsr.setBizOrgCode(OrgUsrServiceImpl.getOrgCodeStr());
} }
......
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