|
@@ -8,6 +8,7 @@ import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
import com.rongwei.safecommon.utils.CXCommonUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
@@ -27,8 +28,9 @@ import java.util.Objects;
|
|
|
public class ApsConflictLogServiceImpl extends ServiceImpl<ApsConflictLogDao, ApsConflictLogDo> implements ApsConflictLogService {
|
|
|
|
|
|
private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
|
|
|
+ @Autowired
|
|
|
+ private HttpServletRequest httpServletRequest;
|
|
|
|
|
|
- @Async("customThreadPool")
|
|
|
public void recordLog(String processequid, String aboutid,
|
|
|
String conflictname, int conflictstate, SysUserVo sysUserVo) {
|
|
|
if (sysUserVo == null) {
|
|
@@ -39,13 +41,14 @@ public class ApsConflictLogServiceImpl extends ServiceImpl<ApsConflictLogDao, Ap
|
|
|
apsConflictLogDo.setConflictstate(conflictstate == 1 ? "增加" : "删除");
|
|
|
apsConflictLogDo.setProcessequid(processequid);
|
|
|
apsConflictLogDo.setConflictname(conflictname);
|
|
|
-
|
|
|
- HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
|
|
|
- apsConflictLogDo.setOperation(request.getRequestURI());
|
|
|
+ apsConflictLogDo.setOperation(httpServletRequest.getRequestURI());
|
|
|
apsConflictLogDo.setCreatedate(new Date());
|
|
|
apsConflictLogDo.setCreateuserid(sysUserVo.getId());
|
|
|
apsConflictLogDo.setCreateusername(sysUserVo.getName());
|
|
|
+ asyncSave(apsConflictLogDo);
|
|
|
+ }
|
|
|
+ @Async("customThreadPool")
|
|
|
+ public void asyncSave(ApsConflictLogDo apsConflictLogDo){
|
|
|
this.save(apsConflictLogDo);
|
|
|
}
|
|
|
-
|
|
|
}
|