albertshaw 8 years ago
parent
commit
135284657c

+ 10 - 0
pom.xml

@@ -377,11 +377,21 @@
 					<compilerArgument>-Xlint:all</compilerArgument>
 					<compilerArgument>-Xlint:all</compilerArgument>
 					<showWarnings>true</showWarnings>
 					<showWarnings>true</showWarnings>
 					<showDeprecation>true</showDeprecation>
 					<showDeprecation>true</showDeprecation>
+					<skip>true</skip>
 				</configuration>
 				</configuration>
 			</plugin>
 			</plugin>
+			<plugin>    
+			    <groupId>org.apache.maven.plugins</groupId>    
+			    <artifactId>maven-surefire-plugin</artifactId>    
+			    <version>2.5</version>    
+			    <configuration>    
+			        <skip>true</skip>    
+			    </configuration>    
+			</plugin> 
 			<plugin>  
 			<plugin>  
                 <groupId>org.apache.maven.plugins</groupId>  
                 <groupId>org.apache.maven.plugins</groupId>  
                 <artifactId>maven-war-plugin</artifactId>  
                 <artifactId>maven-war-plugin</artifactId>  
+                <version>3.1.0</version>  
                 <configuration>  
                 <configuration>  
                     <warName>${profiles.activation}</warName>  
                     <warName>${profiles.activation}</warName>  
                     <!-- 激活spring profile -->  
                     <!-- 激活spring profile -->  

+ 12 - 0
schema/2017-06-09.sql

@@ -0,0 +1,12 @@
+CREATE TABLE `value_evaluation` (
+  `id` BIGINT(18) NOT NULL,
+  `uid` VARCHAR(36) NULL COMMENT '用户id',
+  `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `name` VARCHAR(128) NULL COMMENT '技术名称',
+  `value` BIGINT(18) NULL COMMENT '评估值',
+  `step` INT(2) NULL COMMENT '当前步骤',
+  `log` JSON NULL COMMENT '步骤记录',
+  PRIMARY KEY (`id`));
+
+ALTER TABLE `aft_dev`.`value_evaluation` 
+ADD INDEX `uid_index` (`uid` ASC);

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java

@@ -346,11 +346,11 @@ public class AdminCopyrightApiController extends CertifyApiController {
 					res.getError()
 					res.getError()
 							.add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式错误",
 							.add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式错误",
 									CopyrightFields.getFieldDesc(fe.getField()), AFTConstants.YYYYMMDDHHMMSS)
 									CopyrightFields.getFieldDesc(fe.getField()), AFTConstants.YYYYMMDDHHMMSS)
-											.buildField(fe.getField()));
+											.field(fe.getField()));
 				} else {
 				} else {
 					res.getError()
 					res.getError()
 							.add(buildErrorByMsg(fe.getDefaultMessage(), CopyrightFields.getFieldDesc(fe.getField()))
 							.add(buildErrorByMsg(fe.getDefaultMessage(), CopyrightFields.getFieldDesc(fe.getField()))
-									.buildField(fe.getField()));
+									.field(fe.getField()));
 				}
 				}
 			}
 			}
 			return true;
 			return true;

+ 2 - 2
src/main/java/com/goafanti/common/bo/Error.java

@@ -78,12 +78,12 @@ public class Error implements Serializable {
 		this.message = message;
 		this.message = message;
 	}
 	}
 
 
-	public Error buildField(String field) {
+	public Error field(String field) {
 		this.field = field;
 		this.field = field;
 		return this;
 		return this;
 	}
 	}
 
 
-	public Error buildMessage(String message) {
+	public Error message(String message) {
 		this.message = message;
 		this.message = message;
 		return this;
 		return this;
 	}
 	}

+ 6 - 0
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -80,4 +80,10 @@ public class ErrorConstants {
 
 
 	public static final String	RECORD_REJECT					= "RECORD_REJECT";
 	public static final String	RECORD_REJECT					= "RECORD_REJECT";
 
 
+	public static final String	EVALUATE_ID						= "EVALUATE_ID";
+
+	public static final String	EVALUATE_STEP					= "EVALUATE_STEP";
+
+	public static final String	EVALUATE_PARAM					= "EVALUATE_PARAM";
+
 }
 }

+ 20 - 2
src/main/java/com/goafanti/common/controller/BaseApiController.java

@@ -114,8 +114,8 @@ public class BaseApiController extends BaseController {
 	protected void downloadFile(HttpServletResponse res, String fileName, String filePath) {
 	protected void downloadFile(HttpServletResponse res, String fileName, String filePath) {
 		FileUtils.downloadFile(res, fileName, uploadPrivatePath + filePath);
 		FileUtils.downloadFile(res, fileName, uploadPrivatePath + filePath);
 	}
 	}
-	
-	protected void downloadUnPrivateFile(HttpServletResponse res, String fileName, String filePath){
+
+	protected void downloadUnPrivateFile(HttpServletResponse res, String fileName, String filePath) {
 		FileUtils.downloadFile(res, fileName, uploadPath + filePath);
 		FileUtils.downloadFile(res, fileName, uploadPath + filePath);
 	}
 	}
 
 
@@ -194,4 +194,22 @@ public class BaseApiController extends BaseController {
 		}
 		}
 		return fileName;
 		return fileName;
 	}
 	}
+
+	protected Integer handlePageNo(String pageNo) {
+		try {
+			Integer n = Integer.valueOf(pageNo);
+			return n < 1 ? 1 : n;
+		} catch (Exception e) {
+			return 1;
+		}
+	}
+
+	protected Integer handlePageSize(String pageSize) {
+		try {
+			Integer s = Integer.valueOf(pageSize);
+			return s < 5 ? 5 : s > 100 ? 100 : s;
+		} catch (Exception e) {
+			return 10;
+		}
+	}
 }
 }

+ 12 - 0
src/main/java/com/goafanti/common/controller/BaseController.java

@@ -81,6 +81,18 @@ public class BaseController {
 		return new Error(MessageFormat.format(msg, params));
 		return new Error(MessageFormat.format(msg, params));
 	}
 	}
 
 
+	protected String getErrorMessage(String key) {
+		Object msg = errorResource.getProperty(key);
+		if (msg == null) {
+			return key;
+		}
+		return (String) msg;
+	}
+
+	protected String getErrorMessage(String key, Object... obj) {
+		return MessageFormat.format(getErrorMessage(key), obj);
+	}
+
 	@InitBinder
 	@InitBinder
 	public void initBinder(WebDataBinder binder) {
 	public void initBinder(WebDataBinder binder) {
 		DateFormat dateFormat = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		DateFormat dateFormat = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);

+ 21 - 0
src/main/java/com/goafanti/common/dao/ValueEvaluationMapper.java

@@ -0,0 +1,21 @@
+package com.goafanti.common.dao;
+
+import java.util.Map;
+
+import com.goafanti.common.model.ValueEvaluation;
+
+public interface ValueEvaluationMapper {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(ValueEvaluation record);
+
+    int insertSelective(ValueEvaluation record);
+
+    ValueEvaluation selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(ValueEvaluation record);
+
+    int updateByPrimaryKey(ValueEvaluation record);
+
+	ValueEvaluation selectByPrimaryKeyAndUser(Map<String, Object> params);
+}

+ 11 - 4
src/main/java/com/goafanti/common/error/SystemExceptionResolver.java

@@ -9,25 +9,25 @@ import org.springframework.core.io.support.ResourcePropertySource;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
 import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
 
 
-import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Error;
+import com.goafanti.common.bo.Result;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.filter.ShiroFilterUtils;
 import com.goafanti.core.shiro.filter.ShiroFilterUtils;
 
 
 public class SystemExceptionResolver extends SimpleMappingExceptionResolver {
 public class SystemExceptionResolver extends SimpleMappingExceptionResolver {
 	@Resource(name = "errorResource")
 	@Resource(name = "errorResource")
-	private ResourcePropertySource errorResource;
+	private ResourcePropertySource	errorResource;
 
 
 	@Autowired
 	@Autowired
-	private ShiroFilterUtils shiroFilterUtils;
+	private ShiroFilterUtils		shiroFilterUtils;
 
 
 	@Override
 	@Override
 	protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
 	protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
 			Exception ex) {
 			Exception ex) {
 		// Expose ModelAndView for chosen error view.
 		// Expose ModelAndView for chosen error view.
 		String viewName = determineViewName(ex, request);
 		String viewName = determineViewName(ex, request);
-		LoggerUtils.fmtError(getClass(), ex, "系统异常。");
+
 		ex = handleErrorMessage(ex);
 		ex = handleErrorMessage(ex);
 
 
 		if (viewName != null) {
 		if (viewName != null) {
@@ -55,8 +55,15 @@ public class SystemExceptionResolver extends SimpleMappingExceptionResolver {
 		if (ex instanceof BusinessException) {
 		if (ex instanceof BusinessException) {
 			BusinessException bex = (BusinessException) ex;
 			BusinessException bex = (BusinessException) ex;
 			error = new Error(bex.getCode(), bex.getField(), (String) errorResource.getProperty(bex.getCode()));
 			error = new Error(bex.getCode(), bex.getField(), (String) errorResource.getProperty(bex.getCode()));
+		} else if (ex instanceof IllegalArgumentException) {
+			Object message = errorResource.getProperty(ex.getMessage());
+			if (message == null) {
+				message = errorResource.getProperty(ex.getClass().getName());
+			}
+			error = new Error((String) message);
 		} else {
 		} else {
 			error = new Error((String) errorResource.getProperty(ex.getClass().getName()));
 			error = new Error((String) errorResource.getProperty(ex.getClass().getName()));
+			LoggerUtils.fmtError(getClass(), ex, "系统异常。");
 		}
 		}
 		if (StringUtils.isEmpty(error.getMessage())) {
 		if (StringUtils.isEmpty(error.getMessage())) {
 			error.setMessage("系统异常,请联系管理员。");
 			error.setMessage("系统异常,请联系管理员。");

+ 156 - 0
src/main/java/com/goafanti/common/mapper/ValueEvaluationMapper.xml

@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.ValueEvaluationMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.ValueEvaluation">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="uid" jdbcType="VARCHAR" property="uid" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="value" jdbcType="BIGINT" property="value" />
+    <result column="step" jdbcType="INTEGER" property="step" />
+    <result column="log" jdbcType="CHAR" property="log" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, uid, create_time, name, value, step, log
+  </sql>
+  <sql id="Column_List">
+    id, uid, create_time, name, value, step
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from value_evaluation
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <select id="selectByPrimaryKeyAndUser" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from value_evaluation
+    where id = #{id,jdbcType=BIGINT} and uid = #{uid,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from value_evaluation
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.ValueEvaluation">
+    insert into value_evaluation (id, uid, create_time, 
+      name, value, step, log
+      )
+    values (#{id,jdbcType=BIGINT}, #{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{name,jdbcType=VARCHAR}, #{value,jdbcType=BIGINT}, #{step,jdbcType=INTEGER}, #{log,jdbcType=CHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.ValueEvaluation">
+    insert into value_evaluation
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="uid != null">
+        uid,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="name != null">
+        name,
+      </if>
+      <if test="value != null">
+        value,
+      </if>
+      <if test="step != null">
+        step,
+      </if>
+      <if test="log != null">
+        log,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="uid != null">
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="value != null">
+        #{value,jdbcType=BIGINT},
+      </if>
+      <if test="step != null">
+        #{step,jdbcType=INTEGER},
+      </if>
+      <if test="log != null">
+        #{log,jdbcType=CHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ValueEvaluation">
+    update value_evaluation
+    <set>
+      <if test="uid != null">
+        uid = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="name != null">
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="value != null">
+        value = #{value,jdbcType=BIGINT},
+      </if>
+      <if test="step != null">
+        step = #{step,jdbcType=INTEGER},
+      </if>
+      <if test="log != null">
+        log = #{log,jdbcType=CHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ValueEvaluation">
+    update value_evaluation
+    set uid = #{uid,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      name = #{name,jdbcType=VARCHAR},
+      value = #{value,jdbcType=BIGINT},
+      step = #{step,jdbcType=INTEGER},
+      log = #{log,jdbcType=CHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  
+  <select id="findUserListByPage" resultMap="BaseResultMap">
+  	select 
+    <include refid="Column_List" />
+    from value_evaluation
+    where 
+    uid = #{uid,jdbcType=VARCHAR}
+    <if test="name != null">
+      and name = #{name,jdbcType=VARCHAR},
+    </if>
+    order by id desc 
+    <if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findUserListCount" resultType="java.lang.Integer">
+  	select 
+    count(*)
+    from value_evaluation
+    where 
+    uid = #{uid,jdbcType=VARCHAR}
+    <if test="name != null">
+      and name = #{name,jdbcType=VARCHAR},
+    </if>
+    <if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+</mapper>

+ 98 - 0
src/main/java/com/goafanti/common/model/ValueEvaluation.java

@@ -0,0 +1,98 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+
+public class ValueEvaluation {
+
+	@JsonFormat(shape = Shape.STRING)
+	private Long	id;
+
+	/**
+	 * 用户id
+	 */
+	private String	uid;
+
+	/**
+	 * 创建时间
+	 */
+	private Date	createTime;
+
+	/**
+	 * 技术名称
+	 */
+	private String	name;
+
+	/**
+	 * 评估值
+	 */
+	private Long	value;
+
+	/**
+	 * 当前步骤
+	 */
+	private Integer	step;
+
+	/**
+	 * 步骤记录
+	 */
+	private String	log;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Long getValue() {
+		return value;
+	}
+
+	public void setValue(Long value) {
+		this.value = value;
+	}
+
+	public Integer getStep() {
+		return step;
+	}
+
+	public void setStep(Integer step) {
+		this.step = step;
+	}
+
+	public String getLog() {
+		return log;
+	}
+
+	public void setLog(String log) {
+		this.log = log;
+	}
+}

+ 2 - 2
src/main/java/com/goafanti/copyright/controller/CopyrightApiController.java

@@ -253,11 +253,11 @@ public class CopyrightApiController extends CertifyApiController {
 					res.getError()
 					res.getError()
 							.add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式错误",
 							.add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式错误",
 									CopyrightFields.getFieldDesc(fe.getField()), AFTConstants.YYYYMMDDHHMMSS)
 									CopyrightFields.getFieldDesc(fe.getField()), AFTConstants.YYYYMMDDHHMMSS)
-											.buildField(fe.getField()));
+											.field(fe.getField()));
 				} else {
 				} else {
 					res.getError()
 					res.getError()
 							.add(buildErrorByMsg(fe.getDefaultMessage(), CopyrightFields.getFieldDesc(fe.getField()))
 							.add(buildErrorByMsg(fe.getDefaultMessage(), CopyrightFields.getFieldDesc(fe.getField()))
-									.buildField(fe.getField()));
+									.field(fe.getField()));
 				}
 				}
 			}
 			}
 			return true;
 			return true;

+ 112 - 0
src/main/java/com/goafanti/core/mybatis/JDBCIdGenerator.java

@@ -0,0 +1,112 @@
+package com.goafanti.core.mybatis;
+
+import java.text.MessageFormat;
+import java.util.Calendar;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.Assert;
+
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.common.utils.StringUtils;
+
+/**
+ * 
+ * @author xiaolong
+ *
+ */
+public class JDBCIdGenerator {
+
+	private static final long	JDBC_EPOCH;
+
+	private static final long	SEQUENCE_BITS				= 12L;
+
+	private static final long	WORKER_ID_BITS				= 10L;
+
+	private static final long	SEQUENCE_MASK				= (1 << SEQUENCE_BITS) - 1;
+
+	private static final long	WORKER_ID_LEFT_SHIFT_BITS	= SEQUENCE_BITS;
+
+	private static final long	TIMESTAMP_LEFT_SHIFT_BITS	= WORKER_ID_LEFT_SHIFT_BITS + WORKER_ID_BITS;
+
+	private static final long	WORKER_ID_MAX_VALUE			= 1L << WORKER_ID_BITS;
+
+	private static final Logger	logger						= LoggerFactory.getLogger(JDBCIdGenerator.class);
+
+	private static long			workerId;
+
+	static {
+		Calendar calendar = Calendar.getInstance();
+		calendar.set(2016, Calendar.NOVEMBER, 1);
+		calendar.set(Calendar.HOUR_OF_DAY, 0);
+		calendar.set(Calendar.MINUTE, 0);
+		calendar.set(Calendar.SECOND, 0);
+		calendar.set(Calendar.MILLISECOND, 0);
+		JDBC_EPOCH = calendar.getTimeInMillis();
+		initWorkerId();
+	}
+
+	private long	sequence;
+
+	private long	lastTime;
+
+	static void initWorkerId() {
+		String workerId = System.getProperty("jdbc.worker.id");
+		if (StringUtils.isNoneBlank(workerId)) {
+			setWorkerId(Long.valueOf(workerId));
+			return;
+		}
+		workerId = System.getenv("JDBC_WORKER_ID");
+		if (StringUtils.isNoneBlank(workerId)) {
+			setWorkerId(Long.valueOf(workerId));
+			return;
+		}
+		setWorkerId(0l);
+	}
+
+	/**
+	 * 设置工作进程Id.
+	 *
+	 * @param workerId
+	 *            工作进程Id
+	 */
+	public static void setWorkerId(final Long workerId) {
+		LoggerUtils.debug(logger, "工作进程ID:[%s]", workerId);
+		Assert.isTrue(workerId > 0L && workerId < WORKER_ID_MAX_VALUE, "工作进程ID不能为空,且小于1024");
+		JDBCIdGenerator.workerId = workerId;
+	}
+
+	/**
+	 * 生成Id.
+	 *
+	 * @return 返回@{@link Long}类型的Id
+	 */
+	public synchronized Long generateId() {
+		long time = System.currentTimeMillis();
+		Assert.isTrue(lastTime <= time,
+				MessageFormat.format(
+						"Clock is moving backwards, last time is {0} milliseconds, current time is {1} milliseconds",
+						lastTime, time));
+		if (lastTime == time) {
+			if (0L == (sequence = ++sequence & SEQUENCE_MASK)) {
+				time = waitUntilNextTime(time);
+			}
+		} else {
+			sequence = 0;
+		}
+		lastTime = time;
+		Long res = ((time - JDBC_EPOCH) << TIMESTAMP_LEFT_SHIFT_BITS) | (workerId << WORKER_ID_LEFT_SHIFT_BITS)
+				| sequence;
+		LoggerUtils.debug(logger, "生成JDBCID:[%s] -- [%s] -- [%s] -- [%s]", lastTime, workerId, sequence, res);
+		return res;
+	}
+
+	private long waitUntilNextTime(final long lastTime) {
+		long time = System.currentTimeMillis();
+		while (time <= lastTime) {
+			time = System.currentTimeMillis();
+		}
+		return time;
+	}
+
+}

+ 88 - 0
src/main/java/com/goafanti/evaluation/bo/Step1.java

@@ -0,0 +1,88 @@
+package com.goafanti.evaluation.bo;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+public class Step1 {
+
+	@NotNull
+	@Size(max = 128)
+	private String	name;
+
+	@NotNull
+	private Integer	industry;
+
+	@NotNull
+	@Size(max = 36)
+	private String	subIndustry;
+
+	@NotNull
+	private Integer	transferType;
+
+	@NotNull
+	private Integer	timeLeft;
+
+	@NotNull
+	private Integer	transferArea;
+
+	@NotNull
+	@Size(max = 36)
+	private String	currencyType;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getIndustry() {
+		return industry;
+	}
+
+	public void setIndustry(Integer industry) {
+		this.industry = industry;
+	}
+
+	public String getSubIndustry() {
+		return subIndustry;
+	}
+
+	public void setSubIndustry(String subIndustry) {
+		this.subIndustry = subIndustry;
+	}
+
+	public Integer getTransferType() {
+		return transferType;
+	}
+
+	public void setTransferType(Integer transferType) {
+		this.transferType = transferType;
+	}
+
+	public Integer getTimeLeft() {
+		return timeLeft;
+	}
+
+	public void setTimeLeft(Integer timeLeft) {
+		this.timeLeft = timeLeft;
+	}
+
+	public Integer getTransferArea() {
+		return transferArea;
+	}
+
+	public void setTransferArea(Integer transferArea) {
+		this.transferArea = transferArea;
+	}
+
+	public String getCurrencyType() {
+		return currencyType;
+	}
+
+	public void setCurrencyType(String currencyType) {
+		this.currencyType = currencyType;
+	}
+
+}

+ 82 - 0
src/main/java/com/goafanti/evaluation/controller/EvaluationController.java

@@ -0,0 +1,82 @@
+package com.goafanti.evaluation.controller;
+
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.Assert;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.model.ValueEvaluation;
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.evaluation.bo.Step1;
+import com.goafanti.evaluation.service.ValueEvaluationService;
+
+@RestController
+@RequestMapping(value = "/api/user/evaluate")
+public class EvaluationController extends BaseApiController {
+
+	private static final Logger	logger	= LoggerFactory.getLogger(EvaluationController.class);
+
+	@Autowired
+	ValueEvaluationService		valueEvaluationService;
+
+	@RequestMapping(value = "/create", method = RequestMethod.POST)
+	public Result create() {
+		ValueEvaluation ve = new ValueEvaluation();
+		ve.setUid(TokenManager.getUserId());
+		ve.setStep(1);
+		ve.setLog("{}");
+		valueEvaluationService.insert(ve);
+		return new Result(ve.getId());
+	}
+
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	public Result list(String pageNo, String pageSize) {
+		return new Result().data(valueEvaluationService.list(handlePageNo(pageNo), handlePageSize(pageSize)));
+	}
+
+	@RequestMapping(value = "/info", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+	public String info(String id) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		return valueEvaluationService.getMyEvaluationSteps(Long.valueOf(id));
+	}
+
+	@RequestMapping(value = "/step1", method = RequestMethod.POST)
+	public Result update(String id, @Valid Step1 data, BindingResult bindingResult) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		ValueEvaluation ve = valueEvaluationService.getEvaluation(Long.valueOf(id));
+		Assert.notNull(ve, ErrorConstants.EVALUATE_ID);
+		ve.setName(data.getName());
+		JSONObject jo = JSON.parseObject(ve.getLog());
+		jo.put("1", data);
+		ve.setLog(jo.toJSONString());
+		res.data(valueEvaluationService.update(ve));
+		return res;
+	}
+
+	private boolean handleBindingError(Result res, BindingResult bindingResult) {
+		if (bindingResult.hasErrors()) {
+			LoggerUtils.debug(logger, "参数错误:[%s], [%s], [%s]", bindingResult.getFieldError().getDefaultMessage(),
+					bindingResult.getFieldError().getField(), bindingResult.getFieldError().getRejectedValue());
+			res.getError().add(buildError(ErrorConstants.EVALUATE_PARAM));
+			return true;
+		}
+		return false;
+	}
+}

+ 54 - 0
src/main/java/com/goafanti/evaluation/service/ValueEvaluationService.java

@@ -0,0 +1,54 @@
+package com.goafanti.evaluation.service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.goafanti.common.dao.ValueEvaluationMapper;
+import com.goafanti.common.model.ValueEvaluation;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+
+@Service
+@Transactional
+public class ValueEvaluationService extends BaseMybatisDao<ValueEvaluationMapper> {
+	@Autowired
+	ValueEvaluationMapper	valueEvaluationMapper;
+
+	@Autowired
+	JDBCIdGenerator			idGenerator;
+
+	public int insert(ValueEvaluation ve) {
+		ve.setId(idGenerator.generateId());
+		return valueEvaluationMapper.insertSelective(ve);
+	}
+
+	public int update(ValueEvaluation ve) {
+		return valueEvaluationMapper.updateByPrimaryKeySelective(ve);
+	}
+
+	public ValueEvaluation getEvaluation(Long id) {
+		return valueEvaluationMapper.selectByPrimaryKey(id);
+	}
+
+	public String getMyEvaluationSteps(Long id) {
+		Map<String, Object> params = new HashMap<>();
+		params.put("uid", TokenManager.getUserId());
+		params.put("id", id);
+		ValueEvaluation ve = valueEvaluationMapper.selectByPrimaryKeyAndUser(params);
+		return ve == null ? null : ve.getLog();
+	}
+
+	@SuppressWarnings("unchecked")
+	public Pagination<ValueEvaluation> list(Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<>();
+		params.put("uid", TokenManager.getUserId());
+		return (Pagination<ValueEvaluation>) findPage("findUserListByPage", "findUserListCount", params, pageNo,
+				pageSize);
+	}
+}

+ 24 - 0
src/main/resources/applicationContext-test.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+	 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
+	 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
+
+	<context:property-placeholder
+		location="classpath:props/config_local.properties" />
+
+	<!-- Resources -->
+	<bean id="errorResource"
+		class="org.springframework.core.io.support.ResourcePropertySource">
+		<constructor-arg value="errors" />
+		<constructor-arg value="classpath:props/error.properties" />
+	</bean>
+
+	<import resource="classpath:spring/spring-mybatis.xml" />
+	<import resource="classpath:spring/spring-shiro.xml" />
+	<import resource="classpath:spring/spring-mvc.xml" />
+	<import resource="classpath:spring/spring-task.xml" />
+
+</beans>

+ 39 - 32
src/main/resources/props/error.properties

@@ -1,55 +1,62 @@
-org.apache.shiro.authc.UnknownAccountException=\u8d26\u53f7\u6216\u5bc6\u7801\u4e0d\u5339\u914d\u3002
-org.apache.shiro.authc.IncorrectCredentialsException=\u8d26\u53f7\u6216\u5bc6\u7801\u4e0d\u5339\u914d\u3002
-org.apache.shiro.authc.LockedAccountException=\u8be5\u8d26\u53f7\u5df2\u51bb\u7ed3\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u3002
-org.apache.shiro.authc.DisabledAccountException=\u8be5\u8d26\u53f7\u5df2\u51bb\u7ed3\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u3002
-org.apache.shiro.authc.ExcessiveAttemptsException=\u5c1d\u8bd5\u6b21\u6570\u8fc7\u591a\uff0c\u8d26\u53f7\u6682\u65f6\u88ab\u9501\u5b9a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002
-org.apache.shiro.session.ExpiredSessionException=\u767b\u5f55\u4fe1\u606f\u5df2\u8fc7\u671f\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\u3002
-org.springframework.dao.DataIntegrityViolationException=\u670d\u52a1\u5668\u6253\u4e86\u4e2a\u76f9\u513f\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u6216\u7a0d\u540e\u518d\u8bd5\u3002
-org.springframework.jdbc.BadSqlGrammarException=\u6570\u636e\u5f02\u5e38\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u6216\u7a0d\u540e\u518d\u8bd5\u3002
-java.text.ParseException=\u53c2\u6570\u683c\u5f0f\u9519\u8bef\uff0c\u8bf7\u6838\u5bf9\u8f93\u5165\u6570\u636e\u540e\u518d\u8bd5\u3002
+org.apache.shiro.authc.UnknownAccountException=\u8D26\u53F7\u6216\u5BC6\u7801\u4E0D\u5339\u914D\u3002
+org.apache.shiro.authc.IncorrectCredentialsException=\u8D26\u53F7\u6216\u5BC6\u7801\u4E0D\u5339\u914D\u3002
+org.apache.shiro.authc.LockedAccountException=\u8BE5\u8D26\u53F7\u5DF2\u51BB\u7ED3\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002
+org.apache.shiro.authc.DisabledAccountException=\u8BE5\u8D26\u53F7\u5DF2\u51BB\u7ED3\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002
+org.apache.shiro.authc.ExcessiveAttemptsException=\u5C1D\u8BD5\u6B21\u6570\u8FC7\u591A\uFF0C\u8D26\u53F7\u6682\u65F6\u88AB\u9501\u5B9A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002
+org.apache.shiro.session.ExpiredSessionException=\u767B\u5F55\u4FE1\u606F\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002
+org.springframework.dao.DataIntegrityViolationException=\u670D\u52A1\u5668\u6253\u4E86\u4E2A\u76F9\u513F\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u518D\u8BD5\u3002
+org.springframework.jdbc.BadSqlGrammarException=\u6570\u636E\u5F02\u5E38\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u518D\u8BD5\u3002
+java.text.ParseException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
+java.lang.IllegalArgumentException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
+com.alibaba.fastjson.JSONException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
 
 
-NON_LOGIN=\u7528\u6237\u672a\u767b\u5f55\u3002
 
 
-VCODE_ERROR=\u9a8c\u8bc1\u7801\u8f93\u5165\u9519\u8bef\uff01
+NON_LOGIN=\u7528\u6237\u672A\u767B\u5F55\u3002
 
 
-NO_AUTH_ERROR=\u672a\u6388\u6743\u6216\u6388\u6743\u8fc7\u671f\u3002
+VCODE_ERROR=\u9A8C\u8BC1\u7801\u8F93\u5165\u9519\u8BEF\uFF01
 
 
-PARAM_ERROR={0}\u53c2\u6570\u9519\u8bef
+NO_AUTH_ERROR=\u672A\u6388\u6743\u6216\u6388\u6743\u8FC7\u671F\u3002
 
 
-PARAM_INTEGER_ERROR={0}\u53c2\u6570\u5fc5\u987b\u4e3a\u6570\u5b57\u3002
+PARAM_ERROR={0}\u53C2\u6570\u9519\u8BEF
 
 
-PARAM_EMPTY_ERROR={0}\u5fc5\u987b\u6307\u5b9a\u3002
+PARAM_INTEGER_ERROR={0}\u53C2\u6570\u5FC5\u987B\u4E3A\u6570\u5B57\u3002
 
 
-PARAM_SIZE_ERROR={0}\u53c2\u6570\u957f\u5ea6\u4e0d\u6b63\u786e\uff0c\u5fc5\u987b\u5728{min}\u548c{max}\u4e4b\u95f4\u3002
+PARAM_EMPTY_ERROR={0}\u5FC5\u987B\u6307\u5B9A\u3002
 
 
-PARAM_PATTERN_ERROR={0}\u53c2\u6570\u683c\u5f0f\u987b\u6b63\u786e\u6307\u5b9a{1}\u3002
+PARAM_SIZE_ERROR={0}\u53C2\u6570\u957F\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u5728{min}\u548C{max}\u4E4B\u95F4\u3002
 
 
-EMAIL_SIZE_ERROR=\u90ae\u7bb1\u5730\u5740\u957f\u5ea6\u9519\u8bef\uff01
+PARAM_PATTERN_ERROR={0}\u53C2\u6570\u683C\u5F0F\u987B\u6B63\u786E\u6307\u5B9A{1}\u3002
 
 
-EMAIL_PATTERN_ERROR=\u90ae\u7bb1\u5730\u5740\u683c\u5f0f\u9519\u8bef\uff01
+EMAIL_SIZE_ERROR=\u90AE\u7BB1\u5730\u5740\u957F\u5EA6\u9519\u8BEF\uFF01
 
 
-MOBILE_SIZE_ERROR=\u624b\u673a\u53f7\u957f\u5ea6\u9519\u8bef\uff01
+EMAIL_PATTERN_ERROR=\u90AE\u7BB1\u5730\u5740\u683C\u5F0F\u9519\u8BEF\uFF01
 
 
-MOBILE_PATTERN_ERROR=\u624b\u673a\u53f7\u683c\u5f0f\u9519\u8bef\uff01
+MOBILE_SIZE_ERROR=\u624B\u673A\u53F7\u957F\u5EA6\u9519\u8BEF\uFF01
 
 
-DUNPLICATE_KAY_ERROR={0}\u5df2\u88ab\u4ed6\u4eba\u6ce8\u518c\uff01
+MOBILE_PATTERN_ERROR=\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF\uFF01
 
 
-DATA_EMPTY_ERROR=\u5f53\u524d{0}\u6ca1\u6709\u6570\u636e\u3002
+DUNPLICATE_KAY_ERROR={0}\u5DF2\u88AB\u4ED6\u4EBA\u6CE8\u518C\uFF01
 
 
-PWD_NOT_MATCH_ERROR=\u539f\u5bc6\u7801\u8f93\u5165\u4e0d\u5339\u914d\u3002
+DATA_EMPTY_ERROR=\u5F53\u524D{0}\u6CA1\u6709\u6570\u636E\u3002
 
 
-NON_CERTIFIED=\u672a\u901a\u8fc7\u5b9e\u540d\u8ba4\u8bc1\uff0c\u65e0\u6cd5\u64cd\u4f5c\uff01
+PWD_NOT_MATCH_ERROR=\u539F\u5BC6\u7801\u8F93\u5165\u4E0D\u5339\u914D\u3002
 
 
-RECORD_CALLBACK=\u5f53\u524d\u8bb0\u5f55\u5df2\u9000\u5355\uff0c\u65e0\u6cd5\u4fee\u6539\uff01
+NON_CERTIFIED=\u672A\u901A\u8FC7\u5B9E\u540D\u8BA4\u8BC1\uFF0C\u65E0\u6CD5\u64CD\u4F5C\uFF01
 
 
-RECORD_SETTLEMENT=\u5f53\u524d\u8bb0\u5f55\u5df2\u7ed3\u6b3e\uff0c\u65e0\u6cd5\u4fee\u6539\uff01
+RECORD_CALLBACK=\u5F53\u524D\u8BB0\u5F55\u5DF2\u9000\u5355\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF01
 
 
-RECORD_REJECT=\u5f53\u524d\u7533\u8bf7\u672a\u901a\u8fc7\uff0c\u65e0\u6cd5\u4fee\u6539\uff0c\u8bf7\u91cd\u65b0\u7533\u8bf7\uff01
+RECORD_SETTLEMENT=\u5F53\u524D\u8BB0\u5F55\u5DF2\u7ED3\u6B3E\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF01
 
 
-CONTRACT_PATENT_CREATED=\u5f53\u524d\u5408\u540c\u4e13\u5229\u7533\u8bf7\u5df2\u521b\u5efa,\u65e0\u6cd5\u91cd\u590d\u521b\u5efa\uff01
+RECORD_REJECT=\u5F53\u524D\u7533\u8BF7\u672A\u901A\u8FC7\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF0C\u8BF7\u91CD\u65B0\u7533\u8BF7\uFF01
 
 
-CONTRACT_COPYRIGHT_CREATED=\u5f53\u524d\u5408\u540c\u8f6f\u8457\u7533\u8bf7\u5df2\u521b\u5efa,\u65e0\u6cd5\u91cd\u590d\u521b\u5efa\uff01
+CONTRACT_PATENT_CREATED=\u5F53\u524D\u5408\u540C\u4E13\u5229\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
 
 
-CONTRACT_TECHPROJECT_CREATED=\u5f53\u524d\u5408\u540c\u79d1\u6280\u9879\u76ee\u7533\u8bf7\u5df2\u521b\u5efa,\u65e0\u6cd5\u91cd\u590d\u521b\u5efa\uff01
+CONTRACT_COPYRIGHT_CREATED=\u5F53\u524D\u5408\u540C\u8F6F\u8457\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
 
 
-CONTRACT_COGNIZANCE_CREATED=\u5f53\u524d\u5408\u540c\u9ad8\u4f01\u8ba4\u5b9a\u7533\u8bf7\u5df2\u521b\u5efa,\u65e0\u6cd5\u91cd\u590d\u521b\u5efa\uff01
+CONTRACT_TECHPROJECT_CREATED=\u5F53\u524D\u5408\u540C\u79D1\u6280\u9879\u76EE\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
+
+CONTRACT_COGNIZANCE_CREATED=\u5F53\u524D\u5408\u540C\u9AD8\u4F01\u8BA4\u5B9A\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
+
+EVALUATE_ID=\u8BC4\u4F30\u62A5\u544A\u627E\u4E0D\u5230\uFF01
+EVALUATE_STEP=\u9519\u8BEF\u7684\u8BC4\u4F30\u6B65\u9AA4\uFF01
+EVALUATE_PARAM=\u8BC4\u4F30\u53C2\u6570\u9519\u8BEF\uFF01

+ 19 - 16
src/main/resources/spring/spring-mybatis.xml

@@ -19,6 +19,8 @@
     	<property name="resultSetLogEnabled" value="true" />
     	<property name="resultSetLogEnabled" value="true" />
 	</bean>
 	</bean>
 	
 	
+	<bean id="idGenerator" class="com.goafanti.core.mybatis.JDBCIdGenerator"></bean>
+	
 	<bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
 	<bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
 		<property name="url" value="${jdbc.url}" /> 
 		<property name="url" value="${jdbc.url}" /> 
 		<property name="username" value="${jdbc.username}" /> 
 		<property name="username" value="${jdbc.username}" /> 
@@ -67,28 +69,29 @@
 	 <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
 	 <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
 	     <property name="dataSource" ref="dataSource" />
 	     <property name="dataSource" ref="dataSource" />
 	 </bean>
 	 </bean>
+	 
 	<tx:advice id="txAdvice" transaction-manager="transactionManager">
 	<tx:advice id="txAdvice" transaction-manager="transactionManager">
 		<tx:attributes>
 		<tx:attributes>
-			<tx:method name="publish*" />
-			<tx:method name="save*" />
-			<tx:method name="push*" />
-			<tx:method name="add*" />
-			<tx:method name="update*" />
-			<tx:method name="insert*" />
-			<tx:method name="create*" />
-			<tx:method name="batch*" />
-			<tx:method name="del*" />
-			<tx:method name="load*" />
-			<tx:method name="init*" />
-			<tx:method name="bind*" />
-			<tx:method name="*"  read-only="true"/>
+			<tx:method name="publish*"  rollback-for="Exception" />
+			<tx:method name="save*" rollback-for="Exception" />
+			<tx:method name="push*" rollback-for="Exception" />
+			<tx:method name="add*" rollback-for="Exception" />
+			<tx:method name="update*" rollback-for="Exception" />
+			<tx:method name="insert*" rollback-for="Exception" />
+			<tx:method name="create*" rollback-for="Exception" />
+			<tx:method name="batch*" rollback-for="Exception" />
+			<tx:method name="del*" rollback-for="Exception" />
+			<tx:method name="init*" rollback-for="Exception" />
+			<tx:method name="bind*" rollback-for="Exception" />
+			<tx:method name="*"  read-only="true" />
 		</tx:attributes>
 		</tx:attributes>
 	</tx:advice>
 	</tx:advice>
- 	<cache:annotation-driven />
  	
  	
 	<aop:config proxy-target-class="true">
 	<aop:config proxy-target-class="true">
-		<aop:pointcut id="myPointcut"
-			expression="execution(public * com.goafanti.*.service.impl.*.*(..))" />
+		<aop:pointcut id="myPointcut" expression="execution(* com.goafanti.*.service..*.*(..))" />
 		<aop:advisor advice-ref="txAdvice" pointcut-ref="myPointcut" />
 		<aop:advisor advice-ref="txAdvice" pointcut-ref="myPointcut" />
 	</aop:config>
 	</aop:config>
+	
+ 	<cache:annotation-driven />
+	
 </beans>
 </beans>

+ 1 - 2
src/main/webapp/WEB-INF/html/test.html

@@ -99,7 +99,7 @@
         if (loading) {
         if (loading) {
           return;
           return;
         }
         }
-        var url = '/' + $('#context').val() + '/' + $('#path').val();
+        var url = '/' + $('#context').val() + $('#path').val();
         var data = $.trim($('#data').val());
         var data = $.trim($('#data').val());
         data = data ? JSON.parse($('#data').val()) : {};
         data = data ? JSON.parse($('#data').val()) : {};
         loading = true;
         loading = true;
@@ -111,7 +111,6 @@
           $('#result').val(JSON.stringify(res));
           $('#result').val(JSON.stringify(res));
         }).always(function () {
         }).always(function () {
           loading = false;
           loading = false;
-          alert('done');
         });
         });
       })
       })
     })(jQuery);
     })(jQuery);

+ 31 - 0
src/test/java/com/goafanti/test/TestValueEvaluation.java

@@ -0,0 +1,31 @@
+package com.goafanti.test;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.goafanti.common.model.ValueEvaluation;
+import com.goafanti.evaluation.service.ValueEvaluationService;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = "classpath:applicationContext-test.xml")
+@Transactional
+public class TestValueEvaluation extends AbstractJUnit4SpringContextTests {
+	@Autowired
+	ValueEvaluationService valueEvaluationService;
+
+	@Test
+	public void testValueInsert() {
+		ValueEvaluation ve = new ValueEvaluation();
+		ve.setName("fff");
+		ve.setStep(1);
+		ve.setUid("fsdf");
+		ve.setLog("{\"transferType\":1}");
+		Assert.assertTrue("插入用户失败", valueEvaluationService.insert(ve) != 0);
+	}
+}