|
@@ -7,6 +7,7 @@ import java.util.Map;
|
|
|
import com.ruoyi.common.core.exception.CustomException;
|
|
|
import com.ruoyi.common.core.utils.DateUtils;
|
|
|
import com.ruoyi.common.core.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.core.utils.StringUtils;
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
import com.ruoyi.system.api.RemoteDeptJlService;
|
|
|
import com.ruoyi.system.api.RemoteRoleService;
|
|
@@ -50,21 +51,29 @@ public class ZnylKhzhServiceImpl implements IZnylKhzhService
|
|
|
public ZnylKhzh selectZnylKhzhById(Long id)
|
|
|
{
|
|
|
ZnylKhzh khzh = znylKhzhMapper.selectZnylKhzhById(id);
|
|
|
- StringBuffer codeList = new StringBuffer();
|
|
|
- SysDeptJl sysDeptJl = remoteDeptJlService.selectSysDeptJlByCode(khzh.getRegioncode());
|
|
|
- String level = String.valueOf(sysDeptJl.getLevel());
|
|
|
- if (level.equals("1")) {
|
|
|
- codeList.append(khzh.getRegioncode());
|
|
|
- } else if (level.equals("2")) {
|
|
|
- SysDeptJl deptJl = remoteDeptJlService.selectSysDeptJlById(sysDeptJl.getParentId());
|
|
|
- codeList.append(deptJl.getCode() + "," +khzh.getRegioncode());
|
|
|
- } else if (level.equals("3")) {
|
|
|
- SysDeptJl deptJlLevel2 = remoteDeptJlService.selectSysDeptJlById(sysDeptJl.getParentId());
|
|
|
- SysDeptJl deptJlLevel1 = remoteDeptJlService.selectSysDeptJlById(deptJlLevel2.getParentId());
|
|
|
- codeList.append(deptJlLevel1.getCode() + "," +deptJlLevel2.getCode() + "," + khzh.getRegioncode());
|
|
|
+ if (null != khzh) {
|
|
|
+ if (StringUtils.isNotNull(khzh.getRegioncode())) {
|
|
|
+ StringBuffer codeList = new StringBuffer();
|
|
|
+ SysDeptJl sysDeptJl = remoteDeptJlService.selectSysDeptJlByCode(khzh.getRegioncode());
|
|
|
+ String level = String.valueOf(sysDeptJl.getLevel());
|
|
|
+ if (level.equals("1")) {
|
|
|
+ codeList.append(khzh.getRegioncode());
|
|
|
+ } else if (level.equals("2")) {
|
|
|
+ SysDeptJl deptJl = remoteDeptJlService.selectSysDeptJlById(sysDeptJl.getParentId());
|
|
|
+ codeList.append(deptJl.getCode() + "," + khzh.getRegioncode());
|
|
|
+ } else if (level.equals("3")) {
|
|
|
+ SysDeptJl deptJlLevel2 = remoteDeptJlService.selectSysDeptJlById(sysDeptJl.getParentId());
|
|
|
+ SysDeptJl deptJlLevel1 = remoteDeptJlService.selectSysDeptJlById(deptJlLevel2.getParentId());
|
|
|
+ codeList.append(deptJlLevel1.getCode() + "," + deptJlLevel2.getCode() + "," + khzh.getRegioncode());
|
|
|
+ }
|
|
|
+ khzh.setRegioncodes(codeList.toString());
|
|
|
+ return khzh;
|
|
|
+ } else {
|
|
|
+ return khzh;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new CustomException("客户信息有误!");
|
|
|
}
|
|
|
- khzh.setRegioncodes(codeList.toString());
|
|
|
- return khzh;
|
|
|
}
|
|
|
|
|
|
@Override
|