Commit 3b3d4410 authored by luzhuang's avatar luzhuang

curuser

parent caf252ae
......@@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
......
......@@ -57,5 +57,5 @@ public interface BFileService {
* @param file
*/
public void uploadLicense(MultipartFile file) throws IOException;
public List<String> reConversionPPT(String businessId, String type);
}
......@@ -2,15 +2,22 @@ package org.rcisoft.core.aop;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.reflect.MethodSignature;
import org.rcisoft.common.controller.ValidatedController;
import org.rcisoft.core.entity.IdEntity;
import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.util.IdGen;
import org.rcisoft.core.util.UserUtil;
import org.rcisoft.core.validate.ValidatedResult;
import org.rcisoft.sys.user.bean.CurUser;
import org.springframework.validation.BindingResult;
import javax.rmi.CORBA.Util;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -25,26 +32,33 @@ public class CurUserAspect {
* @param joinPoint
*/
@Before("execution(* org.rcisoft..*.controller.*.*(..))")
public void beforeInsert(JoinPoint joinPoint){
Object model = joinPoint.getArgs()[0];
public void beforeInsert(JoinPoint joinPoint) {
if (joinPoint.getArgs().length < 2)
return;
String model = (String) joinPoint.getArgs()[0];
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
// if(joinPoint.getArgs().length < 2)
// return;
Map<String,Object> map = new HashMap();
map.put("userid","");
// UserUtil.local.set(map);
if((model instanceof CurUser)){
CurUser curUser = (CurUser) model;
}
UserUtil.setUserInfo(model);
}
// @Around("execution(* org.rcisoft..*.controller.*.*(..))")
// public Object beforeInsert(ProceedingJoinPoint joinPoint) throws Throwable{
// try {
// /*验证 长度必须大于1*/
// if(joinPoint.getArgs().length < 2)
// return joinPoint.proceed();
// /*CurUser 必须写在第一个参数里*/
// Object model = joinPoint.getArgs()[0];
// if(!(model instanceof CurUser))
// return joinPoint.proceed();
// CurUser cu = (CurUser) model;
//
// return joinPoint.proceed();
// } catch (Throwable var5) {
// throw var5;
// }
// }
}
package org.rcisoft.core.util;
import org.rcisoft.base.BizCommonCheckException;
import org.rcisoft.base.UserInfo;
import org.rcisoft.business.bchapter.entity.BChapter;
import org.rcisoft.common.util.feignDto.UserInfoDTO;
import org.rcisoft.core.entity.IdEntity;
import java.util.Date;
import java.util.Map;
/**
* Created by lcy on 17/11/28.
*/
public class UserUtil {
protected static ThreadLocal<Map> local = new ThreadLocal<>();
protected static ThreadLocal<UserInfo> local = new ThreadLocal<>();
public static void setUserInfo(String uid){
UserInfo userInfo = new UserInfo();
local.remove();
userInfo.setUid(uid);
local.set(userInfo);
}
public static UserInfo getLocal() {
return local.get();
}
/**
* 用户id
......@@ -23,9 +39,17 @@ public class UserUtil {
public static void setCurrentPersistOperation(IdEntity model) {
model.setCreateBy(getLocal().getUid());
model.setCreateDate(new Date());
model.setUpdateBy(getLocal().getUid());
model.setUpdateDate(new Date());
model.setCommonBusinessId();
model.setNotDeleted();
model.setStart();
}
public static void setCurrentMergeOperation(IdEntity model) {
model.setUpdateBy(getLocal().getUid());
model.setUpdateDate(new Date());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment