|
|
@ -28,6 +28,9 @@ package com.yxt.anrui.as.biz.asservicesubject; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
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 org.apache.commons.lang3.StringUtils; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -39,6 +42,7 @@ import com.yxt.anrui.as.api.asservicesubject.AsServiceSubjectVo; |
|
|
|
import com.yxt.anrui.as.api.asservicesubject.AsServiceSubjectDetailsVo; |
|
|
|
import com.yxt.anrui.as.api.asservicesubject.AsServiceSubjectDto; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
/** |
|
|
@ -56,16 +60,20 @@ import org.springframework.stereotype.Service; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class AsServiceSubjectService extends MybatisBaseService<AsServiceSubjectMapper, AsServiceSubject> { |
|
|
|
private QueryWrapper<AsServiceSubject> createQueryWrapper(AsServiceSubjectQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
|
QueryWrapper<AsServiceSubject> qw = new QueryWrapper<>(); |
|
|
|
return qw; |
|
|
|
} |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
|
@Autowired |
|
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
|
|
|
|
|
public PagerVo<AsServiceSubjectVo> listPageVo(PagerQuery<AsServiceSubjectQuery> pq) { |
|
|
|
AsServiceSubjectQuery query = pq.getParams(); |
|
|
|
QueryWrapper<AsServiceSubject> qw = createQueryWrapper(query); |
|
|
|
QueryWrapper<AsServiceSubject> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(query.getSubjectName())){ |
|
|
|
qw.like("subjectName",query.getSubjectName()); |
|
|
|
} |
|
|
|
String createOrgSid = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()).getData(); |
|
|
|
qw.eq("createOrgSid",createOrgSid); |
|
|
|
IPage<AsServiceSubject> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<AsServiceSubjectVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<AsServiceSubjectVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
@ -75,6 +83,11 @@ public class AsServiceSubjectService extends MybatisBaseService<AsServiceSubject |
|
|
|
public void saveOrUpdateDto(AsServiceSubjectDto dto){ |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
String orgPath = dto.getOrgPath(); |
|
|
|
String createOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(createOrgSid).getData(); |
|
|
|
dto.setCreateOrgSid(createOrgSid); |
|
|
|
dto.setCreateOrgName(sysOrganizationVo.getName()); |
|
|
|
this.insertByDto(dto); |
|
|
|
return; |
|
|
|
} |
|
|
|