Antiloveg 8 yıl önce
ebeveyn
işleme
2128651f48

+ 10 - 0
src/main/java/com/goafanti/admin/controller/AdminStarApiController.java

@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.enums.StarType;
 import com.goafanti.common.model.Star;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.star.service.StarService;
@@ -102,6 +103,15 @@ public class AdminStarApiController extends BaseApiController {
 				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "科技明星ID"));
 				return res;
 			}
+			if (null == s.getStar()){
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "star"));
+				return res;
+			}
+			
+			if (!StarType.STAR.getCode().equals(s.getStar())){
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "star"));
+				return res;
+			}
 		}
 		starService.save(star, hot);
 		return res;

+ 53 - 0
src/main/java/com/goafanti/common/enums/StarType.java

@@ -0,0 +1,53 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum StarType {
+	UNSTAR(0, "科技明星页面不展示"), STAR(1, "科技明星页面展示"), OTHER(2, "其他");
+
+	private StarType(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, StarType> status = new HashMap<Integer, StarType>();
+
+	static {
+		for (StarType value : StarType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static StarType getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static StarType getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 1 - 1
src/main/java/com/goafanti/common/mapper/TechProjectLogMapper.xml

@@ -121,7 +121,7 @@
 		tpl.pid,
 		tpl.state ,
 		tpl.comment,
-		tpl.record_time,
+		tpl.record_time as recordTime,
 		a.name AS operator,
 		ad.name AS principal
 	FROM

+ 90 - 90
src/main/java/com/goafanti/common/model/TechProjectLog.java

@@ -9,101 +9,101 @@ import com.fasterxml.jackson.annotation.JsonFormat.Shape;
 import com.goafanti.common.constant.AFTConstants;
 
 public class TechProjectLog {
-    private String id;
-
-    private String pid;
-
-    /**
-    * 状态变更录入时间
-    */
-    private Date recordTime;
-
-    /**
-    * 状态
-    */
-    private Integer state;
-
-    /**
-    * 负责人
-    */
-    private String principal;
-
-    /**
-    * 操作人
-    */
-    private String operator;
-
-    /**
-    * 备注
-    */
-    private String comment;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getPid() {
-        return pid;
-    }
-
-    public void setPid(String pid) {
-        this.pid = pid;
-    }
-
-    public Date getRecordTime() {
-        return recordTime;
-    }
-
-    public void setRecordTime(Date recordTime) {
-        this.recordTime = recordTime;
-    }
-    
-    @JsonFormat(shape = Shape.STRING)
-    public Integer getState() {
-        return state;
-    }
-
-    public void setState(Integer state) {
-        this.state = state;
-    }
-
-    public String getPrincipal() {
-        return principal;
-    }
-
-    public void setPrincipal(String principal) {
-        this.principal = principal;
-    }
-
-    public String getOperator() {
-        return operator;
-    }
-
-    public void setOperator(String operator) {
-        this.operator = operator;
-    }
-
-    public String getComment() {
-        return comment;
-    }
-
-    public void setComment(String comment) {
-        this.comment = comment;
-    }
-    
-    public String getRecordTimeFormattedDate(){
+	private String	id;
+
+	private String	pid;
+
+	/**
+	 * 状态变更录入时间
+	 */
+	private Date	recordTime;
+
+	/**
+	 * 状态
+	 */
+	private Integer	state;
+
+	/**
+	 * 负责人
+	 */
+	private String	principal;
+
+	/**
+	 * 操作人
+	 */
+	private String	operator;
+
+	/**
+	 * 备注
+	 */
+	private String	comment;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getPid() {
+		return pid;
+	}
+
+	public void setPid(String pid) {
+		this.pid = pid;
+	}
+
+	public Date getRecordTime() {
+		return recordTime;
+	}
+
+	public void setRecordTime(Date recordTime) {
+		this.recordTime = recordTime;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getState() {
+		return state;
+	}
+
+	public void setState(Integer state) {
+		this.state = state;
+	}
+
+	public String getPrincipal() {
+		return principal;
+	}
+
+	public void setPrincipal(String principal) {
+		this.principal = principal;
+	}
+
+	public String getOperator() {
+		return operator;
+	}
+
+	public void setOperator(String operator) {
+		this.operator = operator;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+
+	public String getRecordTimeFormattedDate() {
 		if (this.recordTime == null) {
 			return null;
 		} else {
 			return DateFormatUtils.format(this.getRecordTime(), AFTConstants.YYYYMMDDHHMMSS);
 		}
 	}
-	
-	public void setRecordTimeFormattedDate(String createTimeFormattedDate){
-		
+
+	public void setRecordTimeFormattedDate(String createTimeFormattedDate) {
+
 	}
 }

+ 1 - 1
src/main/java/com/goafanti/patent/service/impl/PatentInfoServiceImpl.java

@@ -385,7 +385,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
 			}
 			if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.ACCEPT) {
 				p.setPatentApplicationDate(recordTime);
-			} else if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.AUTHORIZE) {
+			} else if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.LICENSE) {
 				p.setAuthorizedDate(recordTime);
 			} else if (PatentInfoStatus.getStatus(log.getState()) == PatentInfoStatus.REVIEWNOTICE) {
 				p.setRecordTime(recordTime);