diff --git a/src/main/java/com/glxp/api/service/auth/CustomerService.java b/src/main/java/com/glxp/api/service/auth/CustomerService.java index 07b485c2..7d58d638 100644 --- a/src/main/java/com/glxp/api/service/auth/CustomerService.java +++ b/src/main/java/com/glxp/api/service/auth/CustomerService.java @@ -1,14 +1,13 @@ package com.glxp.api.service.auth; +import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.exception.JsonException; -import com.glxp.api.common.enums.ResultEnum; import org.springframework.stereotype.Service; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; -import javax.naming.Name; import javax.servlet.http.HttpServletRequest; @Service @@ -34,6 +33,17 @@ public class CustomerService { return Integer.parseInt(userId); } + public String getUserIdStr() { + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + + if (attributes == null) { + throw new JsonException(ResultEnum.NOT_NETWORK); + } + HttpServletRequest request = attributes.getRequest(); + String userId = request.getHeader("ADMIN_ID"); + return userId; + } + public String getUserName() { Integer userId = getUserId(); AuthAdmin authAdmin = authAdminService.findById(userId.longValue()); diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java index c6e0319a..4867a06c 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java @@ -4,12 +4,14 @@ import com.github.pagehelper.PageHelper; import com.glxp.api.dao.basic.BasicBusTypePreDao; import com.glxp.api.entity.basic.BasicBusTypePreEntity; import com.glxp.api.req.basic.FilterBusTypeChangeRequest; +import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.basic.IBasicBusTypePreService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.Date; import java.util.List; @Slf4j @@ -19,6 +21,8 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService { @Resource private BasicBusTypePreDao basicBusTypePreDao; + @Resource + private CustomerService customerService; @Override public List filterAll(FilterBusTypeChangeRequest busTypeChangeFilterRequest) { @@ -47,4 +51,14 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService { public boolean insertBusChangeType(BasicBusTypePreEntity basicBusTypePreEntity) { return false; } + + /** + * 设置创建/更新信息 + * + * @param basicBusTypePreEntity + */ + private void setUpdateInfo(BasicBusTypePreEntity basicBusTypePreEntity) { + Date now = new Date(); + + } } diff --git a/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml b/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml index 751597f9..a58a8356 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml @@ -3,6 +3,6 @@ \ No newline at end of file