|
|
@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -45,6 +46,9 @@ import com.yxt.anrui.as.api.asservicesubject.AsServiceSubjectDto; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* Project: yxt-as(售后服务) <br/> |
|
|
|
* File: AsServiceSubjectService.java <br/> |
|
|
@ -83,12 +87,34 @@ public class AsServiceSubjectService extends MybatisBaseService<AsServiceSubject |
|
|
|
public void saveOrUpdateDto(AsServiceSubjectDto dto){ |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
String deptName = ""; |
|
|
|
String deptSid = ""; |
|
|
|
String createOrgSid = ""; |
|
|
|
String orgPath = dto.getOrgPath(); |
|
|
|
String createOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(createOrgSid).getData(); |
|
|
|
dto.setCreateOrgSid(createOrgSid); |
|
|
|
dto.setCreateOrgName(sysOrganizationVo.getName()); |
|
|
|
dto.setUseOrgSid(createOrgSid); |
|
|
|
if (StringUtils.isNotBlank(orgPath)) { |
|
|
|
List<String> split = Arrays.asList(orgPath.split("/")); |
|
|
|
if (split.size() > 1) { |
|
|
|
//获取本级sid获取本级部门信息
|
|
|
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(split.size() - 2)).getData(); |
|
|
|
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData(); |
|
|
|
deptName = sysOrganization.getName() + "/" + sysOrganization1.getName(); |
|
|
|
deptName = sysOrganization1.getName(); |
|
|
|
deptSid = sysOrganization1.getSid(); |
|
|
|
} else { |
|
|
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData(); |
|
|
|
deptName = sysOrganization.getName(); |
|
|
|
deptName = sysOrganization.getName(); |
|
|
|
deptSid = sysOrganization.getSid(); |
|
|
|
} |
|
|
|
dto.setUseOrgSid(deptSid); |
|
|
|
createOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
//创建组织使用组织
|
|
|
|
ResultBean<SysOrganizationVo> organizationResultBean = sysOrganizationFeign.fetchBySid(createOrgSid); |
|
|
|
if (organizationResultBean.getData() != null) { |
|
|
|
dto.setCreateOrgSid(createOrgSid); |
|
|
|
dto.setCreateOrgName(organizationResultBean.getData().getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
this.insertByDto(dto); |
|
|
|
return; |
|
|
|
} |
|
|
|