Commit 4de59f48 by lijingjing

菜单显示对应的科室的样品编码;

parent 6c290ab6
package com.patzn.cloud.service.lims.common;
import java.util.Collection;
import java.util.Collections;
import java.util.function.Consumer;
/**
* 集合工具类
*
* @author meazty
* @since 2023/4/18 16:41
**/
public class CollectKit {
public static <T> void forEach(Collection<T> elements, Consumer<T> action) {
if (null == elements || elements.isEmpty()) {
elements = Collections.emptyList();
}
for (T element : elements) {
action.accept(element);
}
}
}
......@@ -70,7 +70,19 @@ public class EntrustSampleController extends ServiceController {
})
@PostMapping("/pageVO")
public RestResult<Page<EntrustSampleVO>> getPageVO(EntrustSampleVO entrustSample) {
return success(entrustSampleService.pageVO(getPage(), entrustSample));
return success(entrustSampleService.pageVO(getPage(), entrustSample, getAccount()));
}
@ApiOperation("获取委托下样品列表")
@ApiImplicitParams({
@ApiImplicitParam(name = RestConstants.PAGE_PAGE, value = "请求数据的页码", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_ROWS, value = "每页条数", required = true, paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = RestConstants.PAGE_SIDX, value = "排序字段", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = RestConstants.PAGE_SORD, value = "排序方式", paramType = "query", dataTypeClass = String.class),
})
@PostMapping("/page_of_entrust")
public RestResult<Page<EntrustSampleVO>> pageOfEntrust(EntrustSampleVO entrustSample) {
return success(entrustSampleService.pageOfEntrust(getPage(), entrustSample, getAccount()));
}
@ApiOperation("制备样品分页列表")
......@@ -97,7 +109,7 @@ public class EntrustSampleController extends ServiceController {
@PostMapping("/page_make_his")
public RestResult<Page<EntrustSampleVO>> getPageMake(EntrustSampleVO entrustSample) {
entrustSample.setNotStatus(EntrustSampleStatusEnum.DRAFT);
return success(entrustSampleService.pageVO(getPage(), entrustSample));
return success(entrustSampleService.pageVO(getPage(), entrustSample, getAccount()));
}
......@@ -113,7 +125,7 @@ public class EntrustSampleController extends ServiceController {
entrustSample.setStatus(EntrustSampleStatusEnum.REPORT_MAKE);
// 只显示试样
entrustSample.setType(0);
return success(entrustSampleService.pageVOForMake(getPage(), entrustSample));
return success(entrustSampleService.pageVOForMake(getPage(), entrustSample, getAccount()));
}
@ApiOperation("报告编制样品历史分页列表")
......@@ -146,7 +158,7 @@ public class EntrustSampleController extends ServiceController {
@PostMapping("/page_report_check")
public RestResult<Page<EntrustSample>> getPageReportCheck(EntrustSample entrustSample) {
entrustSample.setStatus(EntrustSampleStatusEnum.REPORT_CHECK);
return success(entrustSampleService.page(getPage(), entrustSample));
return success(entrustSampleService.pageOfReportCheck(getPage(), entrustSample,getAccount()));
}
@ApiOperation("报告签发样品分页列表")
......@@ -160,7 +172,7 @@ public class EntrustSampleController extends ServiceController {
public RestResult<Page<EntrustSample>> getPageReportIssue(EntrustSample entrustSample) {
entrustSample.setStatus(EntrustSampleStatusEnum.REPORT_ISSUE);
entrustSample.setType(0);
return success(entrustSampleService.page(getPage(), entrustSample));
return success(entrustSampleService.pageOfReportIssue(getPage(), entrustSample, getAccount()));
}
@ApiOperation("报告批准样品分页列表")
......@@ -188,7 +200,7 @@ public class EntrustSampleController extends ServiceController {
public RestResult<Page<EntrustSample>> getPageReportSend(EntrustSample entrustSample) {
entrustSample.setStatus(EntrustSampleStatusEnum.REPORT_SEND);
entrustSample.setType(0);
return success(entrustSampleService.page(getPage(), entrustSample));
return success(entrustSampleService.pageOfReportSend(getPage(), entrustSample, getAccount()));
}
@ApiOperation("质检审核-样品分页列表")
......@@ -392,7 +404,7 @@ public class EntrustSampleController extends ServiceController {
public RestResult<Page<EntrustSample>> getPageSampleMake(EntrustSample entrustSample) {
entrustSample.setStatus(EntrustSampleStatusEnum.END);
entrustSample.setJudgeStatus(0);
return success(entrustSampleService.page(getPage(), entrustSample));
return success(entrustSampleService.pageOfQualityJudge(getPage(), entrustSample,getAccount()));
}
......
......@@ -28,6 +28,14 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
Page<EntrustSample> page(Page<EntrustSample> page, EntrustSample entrustSample);
Page<EntrustSample> pageOfReportCheck(Page<EntrustSample> page, EntrustSample entrustSample,Account account);
Page<EntrustSample> pageOfReportIssue(Page<EntrustSample> page, EntrustSample entrustSample,Account account);
Page<EntrustSample> pageOfReportSend(Page<EntrustSample> page, EntrustSample entrustSample,Account account);
Page<EntrustSample> pageOfQualityJudge(Page<EntrustSample> page, EntrustSample entrustSample, Account account);
Page<EntrustSample> pageByWrapper(Page<EntrustSample> page, Wrapper wrapper);
boolean removeByIds(List<Long> ids);
......@@ -54,9 +62,11 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
Page<EntrustSampleVO> pageBySampleLeftHis(Page<EntrustSampleVO> page, EntrustSampleVO sampleVO);
Page<EntrustSampleVO> pageVO(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample);
Page<EntrustSampleVO> pageVO(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample,Account account);
Page<EntrustSampleVO> pageOfEntrust(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample, Account account);
Page<EntrustSampleVO> pageVOForMake(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample);
Page<EntrustSampleVO> pageVOForMake(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample,Account account);
boolean submitToAcceptanceResultInput(Long[] ids, Account account);
......
package com.patzn.cloud.service.lims.hmhj.service;
import com.patzn.cloud.commons.controller.Account;
import com.patzn.cloud.service.base.entity.SysOrg;
import com.patzn.cloud.service.base.entity.SysUser;
import com.patzn.cloud.service.lims.base.entity.LmsUserGroup;
import java.util.List;
/**
* The interface User info service.
*
* @author Meazty
*/
public interface IUserInfoService {
/**
* Gets cur group names.
*
* @return the cur group names
*/
String getCurGroupNames();
/**
* Gets period.
*
* @param sysOrg the sys org
* @return the period
*/
String getPeriod(SysOrg sysOrg);
/**
* Gets user period.
*
* @param userId the user id
* @return the user period
*/
String getUserPeriod(Long userId);
/**
* Gets sys org name.
*
* @param sysOrg the sys org
* @return the sys org name
*/
String getSysOrgName(SysOrg sysOrg);
/**
* Gets user period.
*
* @param account the account
* @return the user period
*/
String getUserPeriod(Account account);
/**
* Gets org name by user period.
*
* @param account the account
* @param periods the periods
* @return the org name by user period
*/
String getOrgNameByUserPeriod(Account account, String... periods);
/**
* Gets user org id.
*
* @param account the account
* @return the user org id
*/
Long getUserOrgId(Account account);
/**
* Gets cur user.
*
* @return the cur user
*/
SysUser getCurUser();
/**
* Gets user by id.
*
* @param userId the user id
* @return the user by id
*/
SysUser getUserById(Long userId);
/**
* Gets user org.
*
* @param account the account
* @return the user org
*/
SysOrg getUserOrg(Account account);
/**
* Gets cur group name list.
*
* @return the cur group name list
*/
List<String> getCurGroupNameList();
/**
* Gets group user ids.
*
* @param userId the user id
* @return the group user ids
*/
List<Long> getGroupUserIds(Long userId);
/**
* Gets users by org.
*
* @param orgId the org id
* @return the users by org
*/
List<SysUser> getUsersByOrg(Long orgId);
/**
* Gets group name list.
*
* @param userId the user id
* @return the group name list
*/
List<String> getGroupNameList(Long userId);
/**
* Gets user org names.
*
* @param account the account
* @return the user org names
*/
List<String> getUserOrgNames(Account account);
/**
* Gets group list.
*
* @param userId the user id
* @return the group list
*/
List<LmsUserGroup> getGroupList(Long userId);
/**
* Gets user org list.
*
* @param account the account
* @return the user org list
*/
List<SysOrg> getUserOrgList(Account account);
/**
* Gets user ids by group name.
*
* @param groupName the group name
* @return the user ids by group name
*/
List<Long> getUserIdsByGroupName(String groupName);
/**
* Gets users by role name.
*
* @param roleName the role name
* @return the users by role name
*/
List<SysUser> getUsersByRoleName(String roleName);
/**
* Is group leader boolean.
*
* @param entrustId the entrust id
* @param account the account
* @return the boolean
*/
boolean isGroupLeader(Long entrustId, Account account);
}
......@@ -24,6 +24,7 @@ import com.patzn.cloud.service.hmhj.enums.*;
import com.patzn.cloud.service.hmhj.model.WmsRespResult;
import com.patzn.cloud.service.hmhj.vo.*;
import com.patzn.cloud.service.lims.common.BeanUtils;
import com.patzn.cloud.service.lims.common.CollectKit;
import com.patzn.cloud.service.lims.common.StringHandleUtils;
import com.patzn.cloud.service.lims.config.ServiceProperties;
import com.patzn.cloud.service.lims.hmhj.common.HSSFWorkbookUtil;
......@@ -102,6 +103,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Resource
private ServiceProperties serviceProperties;
@Resource
private IUserInfoService userInfoService;
@Override
public Page<EntrustSample> page(Page<EntrustSample> page, EntrustSample entrustSample) {
Wrapper wrapper = new EntityWrapper<>(entrustSample);
......@@ -109,69 +113,79 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
return this.page(page, wrapper);
}
/**
* 质量室填充code
*
* @param list
*/
private void fillQualityCode(List<? extends EntrustSample> list) {
CollectKit.forEach(list, d -> {
d.setCode(d.getFirstCode());
});
}
/**
* 化验室填充code
*
* @param list
*/
private void fillAssayCode(List<? extends EntrustSample> list) {
CollectKit.forEach(list, d -> {
d.setCode(com.patzn.cloud.commons.toolkit.StringHandleUtils.nvl(d.getThirdCode(), d.getFirstCode()));
});
}
@Override
public Page<EntrustSample> pageByWrapper(Page<EntrustSample> page, Wrapper wrapper) {
public Page<EntrustSample> pageOfReportCheck(Page<EntrustSample> page, EntrustSample entrustSample, Account account) {
page = this.page(page, entrustSample);
fillQualityCode(page.getRecords());
return page;
}
return this.page(page, wrapper);
@Override
public Page<EntrustSample> pageOfReportIssue(Page<EntrustSample> page, EntrustSample entrustSample, Account account) {
page = this.page(page, entrustSample);
fillAssayCode(page.getRecords());
return page;
}
@Override
public Page<EntrustSampleVO> pageVO(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample) {
public Page<EntrustSample> pageOfReportSend(Page<EntrustSample> page, EntrustSample entrustSample, Account account) {
page = this.page(page, entrustSample);
fillAssayCode(page.getRecords());
return page;
}
return page.setRecords(baseMapper.selectVOList(page, entrustSample));
@Override
public Page<EntrustSample> pageOfQualityJudge(Page<EntrustSample> page, EntrustSample entrustSample, Account account) {
page = this.page(page, entrustSample);
fillQualityCode(page.getRecords());
return page;
}
@Override
public Page<EntrustSampleVO> pageVOForMake(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample) {
// List<EntrustSampleVO> sampleVOList = baseMapper.selectVOList(page, entrustSample);
//
// if (CollectionUtils.isEmpty(sampleVOList)) return page;
//
// List<Long> sampleIdsList = sampleVOList.stream().map(s -> {
// return s.getId();
// }).collect(Collectors.toList());
// List<EntrustSampleItem> itemList = entrustSampleItemService.list(Condition.create().setSqlSelect("id", "entrust_sample_id", "name").isNotNull("name").in("entrust_sample_id", sampleIdsList));
// Map<Long, List<String>> itemMap = new HashMap<>();
// Map<Long, Set<String>> itemSetMap = new HashMap<>();
// for (EntrustSampleItem item : itemList) {
// if (itemMap.containsKey(item.getEntrustSampleId())) {
// List<String> list = itemMap.get(item.getEntrustSampleId());
// list.add(item.getName());
// itemMap.put(item.getEntrustSampleId(), list);
//
//
// Set<String> set = itemSetMap.get(item.getEntrustSampleId());
// set.add(item.getName());
// itemSetMap.put(item.getEntrustSampleId(), set);
// } else {
// List<String> list = new ArrayList<>();
// list.add(item.getName());
// itemMap.put(item.getEntrustSampleId(), list);
//
// Set<String> set = new HashSet<>();
// set.add(item.getName());
// itemSetMap.put(item.getEntrustSampleId(), set);
// }
// }
// for (EntrustSampleVO vo : sampleVOList) {
//
// List<String> nameList = itemMap.get(vo.getId());
// if (CollectionUtils.isEmpty(nameList)) {
// vo.setItemRepeat(false);
// } else {
// String itemNames = StringHandleUtils.join(nameList);
// vo.setItemNames(itemNames);
// if (nameList.size() != itemSetMap.get(vo.getId()).size()) {
// vo.setItemRepeat(true);
// } else {
// vo.setItemRepeat(false);
// }
// }
// }
public Page<EntrustSample> pageByWrapper(Page<EntrustSample> page, Wrapper wrapper) {
return this.page(page, wrapper);
}
@Override
public Page<EntrustSampleVO> pageVO(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample, Account account) {
return page.setRecords(baseMapper.selectVOList(page, entrustSample));
}
@Override
public Page<EntrustSampleVO> pageOfEntrust(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample, Account account) {
List<EntrustSampleVO> list = baseMapper.selectVOList(page, entrustSample);
fillQualityCode(list);
return page.setRecords(list);
}
@Override
public Page<EntrustSampleVO> pageVOForMake(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample, Account account) {
List<EntrustSampleVO> records = baseMapper.selectVOList(page, entrustSample);
fillAssayCode(records);
return page.setRecords(records);
}
@Transactional(rollbackFor = Exception.class)
@Override
......@@ -1876,7 +1890,11 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Override
public Page<EntrustSampleVO> pageVOForMakeHis(Page<EntrustSampleVO> page, EntrustSampleVO entrustSample) {
return page.setRecords(baseMapper.selectVOList(page, entrustSample));
List<EntrustSampleVO> records = baseMapper.selectVOList(page, entrustSample);
CollectKit.forEach(records, d -> {
d.setCode(com.patzn.cloud.commons.toolkit.StringHandleUtils.nvl(d.getThirdCode(), d.getFirstCode()));
});
return page.setRecords(records);
}
@Override
......
......@@ -35,10 +35,10 @@ import com.patzn.poibox.xwpf.XWPFTemplate;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
......@@ -57,66 +57,45 @@ import java.util.stream.Collectors;
@Service
public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> implements IEntrustService {
@Autowired
@Resource
private ICodeRuleService codeRuleService;
@Autowired
@Resource
private IEntrustSampleItemService entrustSampleItemService;
@Autowired
@Resource
private IEntrustSampleService entrustSampleService;
@Autowired
@Resource
private IEntrustReportService entrustReportService;
@Autowired
@Resource
private IEntrustSampleBackupService entrustSampleBackupService;
@Autowired
@Resource
private IEntrustSamplePrepareService entrustSamplePrepareService;
@Autowired
@Resource
private IEntrustRecordService entrustRecordService;
@Autowired
@Resource
private IUserInspectionCodeService userInspectionCodeService;
@Autowired
@Resource
private ILmsMsgService lmsMsgService;
@Autowired
@Resource
private SysOrgClient sysOrgClient;
@Autowired
private UserInfoServiceImpl userInfoService;
@Autowired
@Resource
private IUserInfoService userInfoService;
@Resource
private Executor executor1;
@Autowired
@Resource
private SysUserClient sysUserClient;
@Autowired
@Resource
private LmsChemicalCategoryClient lmsChemicalCategoryClient;
@Autowired
@Resource
private IEntrustAnnexService entrustAnnexService;
@Autowired
@Resource
private OssClient ossClient;
@Autowired
@Resource
private IMaterialService materialService;
@Autowired
@Resource
private IContractSamplingService contractSamplingService;
@Autowired
@Resource
private IOriginalRecordService originalRecordService;
@Autowired
@Resource
private IEntrustReportRelSampleService entrustReportRelSampleService;
......@@ -886,16 +865,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 只查询正常样品,不查询标样
List<EntrustSampleDTO> sampleList = listSampleDTOByType(id, 0);
if (CollectionUtils.isNotEmpty(sampleList)) {
List<Long> sampleIdList = sampleList.stream().map(s -> {
return s.getId();
}).collect(Collectors.toList());
List<Long> sampleIdList = sampleList.stream().map(EntrustSampleDTO::getId).collect(Collectors.toList());
List<EntrustSampleItem> experimentList = entrustSampleItemService.list(Condition.create().in("entrust_sample_id", sampleIdList));
Map<Long, Set<String>> itemSetMap = new HashMap<>();
Map<Long, List<EntrustSampleItem>> itemEntitySetMap = new HashMap<>();
for (EntrustSampleItem experiment : experimentList) {
if (!itemSetMap.containsKey(experiment.getEntrustSampleId())) {
Set<String> set = new TreeSet<>();
set.add(experiment.getName());
itemSetMap.put(experiment.getEntrustSampleId(), set);
......@@ -905,7 +880,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
itemSetMap.put(experiment.getEntrustSampleId(), set);
}
if (!itemEntitySetMap.containsKey(experiment.getEntrustSampleId())) {
List<EntrustSampleItem> list = new ArrayList<>();
list.add(experiment);
......
......@@ -5,7 +5,6 @@ import com.patzn.cloud.commons.api.RestAssert;
import com.patzn.cloud.commons.controller.Account;
import com.patzn.cloud.commons.controller.LoginHelper;
import com.patzn.cloud.feign.base.client.SysOrgClient;
import com.patzn.cloud.feign.base.client.SysRoleClient;
import com.patzn.cloud.feign.base.client.SysUserClient;
import com.patzn.cloud.feign.lims.base.client.LmsUserGroupClient;
import com.patzn.cloud.service.base.entity.SysOrg;
......@@ -14,19 +13,22 @@ import com.patzn.cloud.service.hmhj.entity.Entrust;
import com.patzn.cloud.service.lims.base.entity.LmsUserGroup;
import com.patzn.cloud.service.lims.base.vo.GroupUserVO;
import com.patzn.cloud.service.lims.common.consts.Symbol;
import com.patzn.cloud.service.lims.common.service.ILmsMsgService;
import com.patzn.cloud.service.lims.hmhj.common.consts.HmConst;
import com.patzn.cloud.service.lims.hmhj.service.IEntrustService;
import com.patzn.cloud.service.lims.hmhj.service.IUserInfoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author Meazty
*/
@Service
public class UserInfoServiceImpl {
public class UserInfoServiceImpl implements IUserInfoService {
private static final List<LmsUserGroup> OTHER_GROUP_LIST = new ArrayList<>();
private static final List<String> OTHER_GROUP_NAME_LIST = new ArrayList<>();
......@@ -36,24 +38,16 @@ public class UserInfoServiceImpl {
OTHER_GROUP_NAME_LIST.add(OTHER_GROUP_LIST.get(0).getName());
}
@Autowired
private IEntrustService entrustService;
@Autowired
private LmsUserGroupClient lmsUserGroupClient;
@Autowired
@Resource
private SysOrgClient sysOrgClient;
@Autowired
@Resource
private SysUserClient sysUserClient;
@Resource
private IEntrustService entrustService;
@Resource
private LmsUserGroupClient lmsUserGroupClient;
@Autowired
private SysRoleClient sysRoleClient;
@Autowired
private ILmsMsgService lmsMsgService;
@Override
public List<LmsUserGroup> getGroupList(Long userId) {
if (null == userId) {
return OTHER_GROUP_LIST;
......@@ -62,6 +56,7 @@ public class UserInfoServiceImpl {
return lmsUserGroupClient.getByUserId(userId).getData();
}
@Override
public List<String> getGroupNameList(Long userId) {
List<LmsUserGroup> userGroups = getGroupList(userId);
if (CollectionUtils.isEmpty(userGroups)) {
......@@ -70,10 +65,12 @@ public class UserInfoServiceImpl {
return getGroupList(userId).stream().map(t -> t.getName()).filter(t -> StringUtils.isNotBlank(t)).collect(Collectors.toList());
}
@Override
public List<String> getCurGroupNameList() {
return getGroupNameList(LoginHelper.getAccount().getUserId());
}
@Override
public String getCurGroupNames() {
List<String> curGroupNameList = getCurGroupNameList();
if (CollectionUtils.isEmpty(curGroupNameList)) {
......@@ -82,6 +79,7 @@ public class UserInfoServiceImpl {
return StringUtils.join(curGroupNameList, "-");
}
@Override
public List<Long> getGroupUserIds(Long userId) {
// 为空默认获取当前用户所有组
Account account = LoginHelper.getAccount();
......@@ -100,6 +98,7 @@ public class UserInfoServiceImpl {
return Stream.of(userIdStr.split(Symbol.COMMA)).map(Long::valueOf).distinct().collect(Collectors.toList());
}
@Override
public List<Long> getUserIdsByGroupName(String groupName) {
if (StringUtils.isBlank(groupName)) {
return null;
......@@ -113,6 +112,7 @@ public class UserInfoServiceImpl {
return Stream.of(userIdStr.split(Symbol.COMMA)).map(Long::valueOf).distinct().collect(Collectors.toList());
}
@Override
public boolean isGroupLeader(Long entrustId, Account account) {
if (null == entrustId) {
return false;
......@@ -128,39 +128,47 @@ public class UserInfoServiceImpl {
return userGroups.stream().anyMatch(t -> entrust.getTestSide().equals(t.getName()));
}
@Override
public List<SysOrg> getUserOrgList(Account account) {
return sysOrgClient.getListByUserId(account.getUserId()).getData();
}
@Override
public SysOrg getUserOrg(Account account) {
List<SysOrg> orgList = sysOrgClient.getListByUserId(account.getUserId()).getData();
return CollectionUtils.isNotEmpty(orgList) ? orgList.get(0) : null;
}
@Override
public Long getUserOrgId(Account account) {
SysOrg sysOrg = getUserOrg(account);
return null == sysOrg ? null : sysOrg.getId();
}
@Override
public List<SysUser> getUsersByOrg(Long orgId) {
RestAssert.fail(null == orgId, "组织ID为空");
return sysUserClient.getListByOrgId(orgId, "").getData();
}
@Override
public List<SysUser> getUsersByRoleName(String roleName) {
RestAssert.fail(StringUtils.isBlank(roleName), "角色为空");
return sysUserClient.getListByRoleName(roleName).serviceData();
}
@Override
public SysUser getUserById(Long userId) {
return sysUserClient.get(userId).serviceData();
}
@Override
public SysUser getCurUser() {
return getUserById(LoginHelper.getAccount().getUserId());
}
@Override
public String getPeriod(SysOrg sysOrg) {
if (null == sysOrg) {
return null;
......@@ -179,6 +187,7 @@ public class UserInfoServiceImpl {
return null;
}
@Override
public String getSysOrgName(SysOrg sysOrg) {
if (null == sysOrg) {
return "";
......@@ -189,6 +198,7 @@ public class UserInfoServiceImpl {
return "";
}
@Override
public List<String> getUserOrgNames(Account account) {
List<SysOrg> orgList = sysOrgClient.getListRecursiveByUserId(account.getUserId()).getData();
if (CollectionUtils.isEmpty(orgList)) {
......@@ -205,6 +215,7 @@ public class UserInfoServiceImpl {
return new ArrayList<>(nameSet);
}
@Override
public String getUserPeriod(Long userId) {
if (null == userId) {
return null;
......@@ -212,6 +223,7 @@ public class UserInfoServiceImpl {
return getUserPeriod(new Account().setUserId(userId));
}
@Override
public String getUserPeriod(Account account) {
List<SysOrg> orgList = sysOrgClient.getListByUserId(account.getUserId()).getData();
if (CollectionUtils.isEmpty(orgList)) {
......@@ -226,6 +238,7 @@ public class UserInfoServiceImpl {
return null;
}
@Override
public String getOrgNameByUserPeriod(Account account, String... periods) {
List<String> userOrgNameList = getUserOrgNames(account);
if (CollectionUtils.isEmpty(userOrgNameList)) {
......
......@@ -54,7 +54,13 @@
</if>
<if test="null != vo.code">
AND s.code LIKE CONCAT('%',#{vo.code},'%')
AND (
s.code LIKE CONCAT('%',#{vo.code},'%')
or
s.first_code like CONCAT('%',#{vo.code},'%')
or
s.third_code like CONCAT('%',#{vo.code},'%')
)
</if>
<if test="null != vo.name">
......
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