领料出库库存变化记录
This commit is contained in:
parent
e16bcc5123
commit
5867c5bc16
|
|
@ -199,6 +199,14 @@
|
|||
<artifactId>httpmime</artifactId>
|
||||
<version>4.5.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-api-system</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-common-security</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -7,14 +7,21 @@ import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
|||
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
|
||||
import com.bonus.common.biz.service.AsyncStoreLogService;
|
||||
import com.bonus.common.biz.utils.HttpResult;
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.utils.ServletUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.RemoteUserService;
|
||||
import com.bonus.system.api.model.LoginUser;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
@ -47,6 +54,9 @@ public class StoreLogAspect {
|
|||
@Resource
|
||||
private AsyncStoreLogService asyncStoreLogService;
|
||||
|
||||
@Resource
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 处理完请求后执行
|
||||
*
|
||||
|
|
@ -69,6 +79,12 @@ public class StoreLogAspect {
|
|||
bmStorageLog.setStatus(200L);
|
||||
// 请求的地址
|
||||
bmStorageLog.setMethod(StringUtils.substring(Objects.requireNonNull(ServletUtils.getRequest()).getRequestURI(), 0, 255));
|
||||
String username = SecurityUtils.getUsername();
|
||||
R<LoginUser> userInfo = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
||||
if (ObjectUtils.isNotEmpty(userInfo))
|
||||
{
|
||||
bmStorageLog.setCreator(userInfo.getData().getSysUser().getNickName());
|
||||
}
|
||||
if (e != null) {
|
||||
bmStorageLog.setStatus(500L);
|
||||
bmStorageLog.setJsonResult(StringUtils.substring(e.getMessage(), 0, 2000));
|
||||
|
|
@ -78,7 +94,6 @@ public class StoreLogAspect {
|
|||
String methodName = joinPoint.getSignature().getName();
|
||||
bmStorageLog.setModelTitle(className + "." + methodName + "()");
|
||||
// 设置请求方式
|
||||
bmStorageLog.setMethod(ServletUtils.getRequest().getMethod());
|
||||
bmStorageLog.setModelTitle(storeLog.title());
|
||||
|
||||
if (StringUtils.isNotNull(jsonResult)) {
|
||||
|
|
|
|||
|
|
@ -100,7 +100,6 @@ public class BmStorageLogServiceImpl implements IBmStorageLogService {
|
|||
@Override
|
||||
public int batchInsert(List<BmStorageLog> records) {
|
||||
log.info("batch insert log {}", records);
|
||||
records.forEach(bmStorageLog -> bmStorageLog.setCreator(SecurityUtils.getUserId().toString()));
|
||||
return bmStorageLogMapper.batchInsert(records);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue