Browse Source

修改公路管理登录信息接口

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
3408510275
1 changed files with 14 additions and 8 deletions
  1. +14
    -8
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/SectionServiceImpl.java

+ 14
- 8
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/SectionServiceImpl.java View File

@@ -16,6 +16,7 @@ import com.tuoheng.admin.query.SectionQuery;
import com.tuoheng.admin.service.ISectionService;
import com.tuoheng.admin.service.section.query.QuerySectionListByDeptIdService;
import com.tuoheng.admin.service.section.query.QuerySectionListByRoadIdService;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.vo.SectionInfoVo;
import com.tuoheng.common.core.common.BaseServiceImpl;
import com.tuoheng.common.core.enums.ServiceExceptionEnum;
@@ -58,11 +59,13 @@ public class SectionServiceImpl extends BaseServiceImpl<SectionMapper, Section>
if(null==query.getLimit() && null == query.getPage()){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//获取当前登录用户信息
String tenantId = CurrentUserUtil.getTenantId();
//获取分页数据
IPage<Section> page = new Page<>(query.getPage(),query.getLimit());
IPage<Section> pageData = sectionMapper.selectPage(page, Wrappers.<Section>lambdaQuery()
.eq(Section::getMark, 1)
.eq(Section::getTenantId, 0)
.eq(Section::getTenantId, tenantId)
.orderByDesc(Section::getCreateTime));
List<Section> records = pageData.getRecords();
List<Section> list = new ArrayList<>();
@@ -87,9 +90,14 @@ public class SectionServiceImpl extends BaseServiceImpl<SectionMapper, Section>

@Override
public JsonResult getListInfo(SectionQuery query) {
//获取当前登录人信息
String tenantId = CurrentUserUtil.getTenantId();
if(StringUtils.isEmpty(tenantId)){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
List<Section> sectionList = sectionMapper.selectList(new LambdaQueryWrapper<Section>()
.eq(Section::getMark, 1)
.eq(Section::getTenantId, 0)
.eq(Section::getTenantId, tenantId)
.orderByDesc(Section::getCreateTime));
List<Section> list = new ArrayList<>();
for (Section section : sectionList) {
@@ -123,18 +131,16 @@ public class SectionServiceImpl extends BaseServiceImpl<SectionMapper, Section>

@Override
public JsonResult editInfo(Section entity) {
// User user = (User) ThreadLocalUtil.get();
// if (StringUtils.isNull(user)) {
// return JsonResult.error("获取不到用户信息");
// }
//超级管理员可以进行新增和编辑,普通用户不能进行此操作,部门管理员可以进行修改经纬度
String userId = CurrentUserUtil.getUserId();
if(StringUtils.isEmpty(entity.getId())){
//新增
entity.setCreateTime(DateUtils.now());
entity.setCreateUser("ca");
entity.setCreateUser(userId);
}else {
//更新
entity.setUpdateTime(DateUtils.now());
entity.setUpdateUser("ca");
entity.setUpdateUser(userId);
}
super.edit(entity);


Loading…
Cancel
Save