Просмотр исходного кода

修改类目匹配企业商机出错问题

liusw 7 лет назад
Родитель
Сommit
7119dbea42

+ 2 - 1
src/main/java/com/uas/ps/inquiry/dao/KindConcernDao.java

@@ -31,5 +31,6 @@ public interface KindConcernDao extends JpaRepository<KindConcern, Long>, JpaSpe
      * @param nameCn 类目名称
      * @return
      */
-    Set<Long> findByNameCn(String nameCn);
+    @Query("select k.enUU from KindConcern k where k.nameCn = :nameCn")
+    Set<Long> findByNameCn(@Param("nameCn") String nameCn);
 }

+ 0 - 215
src/main/java/com/uas/ps/inquiry/model/kind/Kind.java

@@ -1,215 +0,0 @@
-package com.uas.ps.inquiry.model.kind;
-
-import com.uas.ps.inquiry.entity.Constant;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import java.io.Serializable;
-
-/**
- * 产品类目
- * 
- * @author suntg
- * @version  2016年3月10日下午3:08:40 suntg 创建
- * @version 2018年6月13日 17:14:52 询价服务简要信息,用于查看
- */
-@Entity
-@Table(name = "product$kind")
-public class Kind implements Serializable {
-
-	/**
-	 * 序列号
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID号
-	 */
-	@Id
-	@Column(name = "ki_id")
-	@GeneratedValue
-	private Long id;
-
-	/**
-	 * 父级类目的id号
-	 */
-	@Column(name = "ki_parentid")
-	private Long parentid;
-
-	/**
-	 * 是否为叶子类目 1是 0否
-	 */
-	@Column(name = "ki_isleaf")
-	private Short isLeaf;
-
-	/**
-	 * 在父级类目中的排序序号
-	 */
-	@Column(name = "ki_detno")
-	private Short detno;
-
-	/**
-	 * 类目的名称
-	 */
-	@Column(name = "ki_name")
-	private String nameCn;
-
-	/**
-	 * 类目的英文名称
-	 */
-	@Column(name = "ki_name_en")
-	private String nameEn;
-
-	/**
-	 * 类目包含的器件总数,包括其所有子类目下的
-	 */
-	@Column(name = "ki_count")
-	private Long count;
-
-	/**
-	 * 类目的层级,从1开始,1、2、3、4
-	 */
-	@Column(name = "ki_level")
-	private Short level;
-
-	/**
-	 * 器件编号前缀
-	 */
-	@Column(name = "ki_cmpprefix")
-	private String componentPrefix;
-
-	/**
-	 * 当前器件编号后缀游标
-	 */
-	@Column(name = "ki_cmpsuffix")
-	private Long componentsuffix;
-
-	/**
-	 * 类目的点击次数
-	 */
-	@Column(name = "ki_visit_count")
-	private Long visitCount;
-
-	/**
-	 * 类目的搜索次数
-	 */
-	@Column(name = "ki_search_count")
-	private Long searchCount;
-
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getParentid() {
-		return parentid;
-	}
-
-	public void setParentid(Long parentid) {
-		this.parentid = parentid;
-	}
-
-	public Short getIsLeaf() {
-		return isLeaf;
-	}
-
-	public void setIsLeaf(Short isLeaf) {
-		this.isLeaf = isLeaf;
-	}
-
-	public boolean isLeaf() {
-		return this.isLeaf == null ? false : getIsLeaf() == Constant.YES;
-	}
-
-	public Short getDetno() {
-		return detno;
-	}
-
-	public void setDetno(Short detno) {
-		this.detno = detno;
-	}
-
-	public String getNameCn() {
-		return nameCn;
-	}
-
-	public void setNameCn(String nameCn) {
-		this.nameCn = nameCn;
-	}
-
-	public String getNameEn() {
-		return nameEn;
-	}
-
-	public void setNameEn(String nameEn) {
-		this.nameEn = nameEn;
-	}
-
-	public Long getCount() {
-		return count;
-	}
-
-	public void setCount(Long count) {
-		this.count = count;
-	}
-
-	public void addCount() {
-		this.count = this.count + 1;
-	}
-
-	public void addCount(Long count) {
-		this.count = this.count + count;
-	}
-
-	public void decreaseCount() {
-		this.count = this.count - 1;
-	}
-
-	public Short getLevel() {
-		return level;
-	}
-
-	public void setLevel(Short level) {
-		this.level = level;
-	}
-
-	public String getComponentPrefix() {
-		return componentPrefix;
-	}
-
-	public void setComponentPrefix(String componentPrefix) {
-		this.componentPrefix = componentPrefix;
-	}
-
-	public Long getComponentsuffix() {
-		return componentsuffix;
-	}
-
-	public void setComponentsuffix(Long componentsuffix) {
-		this.componentsuffix = componentsuffix;
-	}
-
-	public Long getVisitCount() {
-		return visitCount;
-	}
-
-	public void setVisitCount(Long visitCount) {
-		this.visitCount = visitCount;
-	}
-
-	public Long getSearchCount() {
-		return searchCount;
-	}
-
-	public void setSearchCount(Long searchCount) {
-		this.searchCount = searchCount;
-	}
-
-}

+ 1 - 2
src/main/java/com/uas/ps/inquiry/model/kind/KindConcern.java

@@ -19,8 +19,7 @@ import java.util.Date;
  * @version 2018年6月13日 15:50:23
  */
 @Entity
-@Table(name = "product$kind_concern", indexes = {
-        @Index(name = "unique_kindconcern_enuu_name", columnList = "kc_enuu, kc_name", unique = true)})
+@Table(name = "product$kind_concern")
 public class KindConcern implements Serializable {
 
     /**