|
|
@@ -3,21 +3,22 @@ package com.tuoheng.admin.service.impl; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.tuoheng.admin.config.CommonConfig; |
|
|
|
import com.tuoheng.admin.entity.Structure; |
|
|
|
import com.tuoheng.admin.entity.User; |
|
|
|
import com.tuoheng.admin.mapper.RoadInformationMapper; |
|
|
|
import com.tuoheng.admin.mapper.SectionMapper; |
|
|
|
import com.tuoheng.admin.mapper.StructureMapper; |
|
|
|
import com.tuoheng.admin.mapper.UserMapper; |
|
|
|
import com.tuoheng.admin.query.StructureQuery; |
|
|
|
import com.tuoheng.admin.service.IStructureService; |
|
|
|
import com.tuoheng.admin.vo.StructureInfoVo; |
|
|
|
import com.tuoheng.common.core.common.BaseServiceImpl; |
|
|
|
import com.tuoheng.common.core.enums.ServiceExceptionEnum; |
|
|
|
import com.tuoheng.common.core.exception.ServiceException; |
|
|
|
import com.tuoheng.common.core.utils.CommonUtils; |
|
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
|
import com.tuoheng.common.core.utils.StringUtils; |
|
|
|
import com.tuoheng.common.core.utils.*; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@@ -42,6 +43,9 @@ public class StructureServiceImpl extends BaseServiceImpl<StructureMapper, Struc |
|
|
|
@Autowired |
|
|
|
private RoadInformationMapper roadInformationMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public JsonResult queryPage(StructureQuery query) { |
|
|
@@ -89,11 +93,29 @@ public class StructureServiceImpl extends BaseServiceImpl<StructureMapper, Struc |
|
|
|
|
|
|
|
@Override |
|
|
|
public JsonResult editInfo(Structure entity) { |
|
|
|
// User user = (User) ThreadLocalUtil.get(); |
|
|
|
// if (StringUtils.isNull(user)) { |
|
|
|
// return JsonResult.error("获取不到用户信息"); |
|
|
|
// } |
|
|
|
//获取登录信息 |
|
|
|
// String username = SecurityUserUtils.username(); |
|
|
|
//校验 |
|
|
|
if(StringUtils.isEmpty(entity.getRoadId()) && StringUtils.isEmpty(entity.getSectionId())){ |
|
|
|
return JsonResult.error("公路和路段为空"); |
|
|
|
} |
|
|
|
//查询用户信息 |
|
|
|
if(StringUtils.isEmpty(entity.getId())){ |
|
|
|
//新增 |
|
|
|
entity.setCreateTime(DateUtils.now()); |
|
|
|
entity.setCreateUser("ca"); |
|
|
|
}else { |
|
|
|
//更新 |
|
|
|
entity.setUpdateTime(DateUtils.now()); |
|
|
|
entity.setUpdateUser("ca"); |
|
|
|
} |
|
|
|
super.edit(entity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
return JsonResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|