Skip to content

Commit

Permalink
权重管理
Browse files Browse the repository at this point in the history
  • Loading branch information
wjinliang committed Mar 26, 2018
1 parent 34d37c6 commit f8e99cf
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public Object treeNodes(ScoreIndex scoreIndex) {
treeNode.setId(nodeInfo.getId());
treeNode.setpId(nodeInfo.getParentId());
treeNode.setName(nodeInfo.getName());
treeNode.setS(nodeInfo.getScore().toString());
nodes.add(treeNode);
}
return nodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ public Result getPaperOptions() {
Map<String, Object> map = new HashMap<String, Object>();
map.put("name", s.getTitle());
map.put("id", s.getId());
map.put("score", s.getScore());
maps.add(map);
}
return ResponseUtil.success(maps);
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/com/topie/zhongkexie/core/dto/IndexDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class IndexDto {

private String title;

private BigDecimal weight;

private BigDecimal score;

private List<ItemDto> ids;
Expand Down Expand Up @@ -47,7 +49,15 @@ public void setTitle(String title) {
this.title = title;
}

public BigDecimal getScore() {
public BigDecimal getWeight() {
return weight;
}

public void setWeight(BigDecimal weight) {
this.weight = weight;
}

public BigDecimal getScore() {
return score;
}

Expand Down
12 changes: 11 additions & 1 deletion src/main/java/com/topie/zhongkexie/core/dto/ItemDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class ItemDto {

private Integer itemType;

private BigDecimal weight;

private BigDecimal score;

private List<OptionDto> items;
Expand All @@ -37,7 +39,15 @@ public List<OptionDto> getItems() {
return items;
}

public void setItems(List<OptionDto> items) {
public BigDecimal getWeight() {
return weight;
}

public void setWeight(BigDecimal weight) {
this.weight = weight;
}

public void setItems(List<OptionDto> items) {
this.items = items;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public class ScoreIndex extends Sortable {
*/
private String name;

/**
* 指标权重
*/
private BigDecimal weight;

/**
* 指标分值
*/
Expand Down Expand Up @@ -108,6 +113,20 @@ public void setName(String name) {
}

/**
* 指标权重
*/
public BigDecimal getWeight() {
return weight;
}

/**
* 指标权重
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}

/**
* 获取指标分值
*
* @return score - 指标分值
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package com.topie.zhongkexie.database.core.model;

import com.topie.zhongkexie.common.handler.Sortable;

import javax.persistence.*;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.topie.zhongkexie.common.handler.Sortable;

@Table(name = "d_score_item")
public class ScoreItem extends Sortable {

Expand Down Expand Up @@ -33,15 +38,20 @@ public class ScoreItem extends Sortable {
@Column(name = "option_logic")
private String optionLogic;

/**
* 题目分值
*/
@Column(name = "responsible_department")
private String responsibleDepartment;

@Column(name = "related_field")
private String relatedField;

/**
* 题目权重
*/
private BigDecimal weight;

/**
* 题目分值
*/
private BigDecimal score;

private Integer sort;
Expand Down Expand Up @@ -123,8 +133,24 @@ public String getTitle() {
public void setTitle(String title) {
this.title = title;
}

/**
* 获取题目权重
* @return
*/
public BigDecimal getWeight() {
return weight;
}

/**
* 题目权重
*
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}

/**
* 获取题目分值
*
* @return score - 题目分值
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package com.topie.zhongkexie.database.core.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.topie.zhongkexie.common.handler.Sortable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.topie.zhongkexie.common.handler.Sortable;

@Table(name = "d_score_paper")
public class ScorePaper extends Sortable {
Expand Down Expand Up @@ -54,6 +61,11 @@ public class ScorePaper extends Sortable {
* 状态
*/
private Short status;

/**
* 总分值
*/
private BigDecimal score;

/**
* 审批状态
Expand Down Expand Up @@ -232,4 +244,14 @@ public String getContentJson() {
public void setContentJson(String contentJson) {
this.contentJson = contentJson;
}

public BigDecimal getScore() {
return score;
}

public void setScore(BigDecimal score) {
this.score = score;
}


}
6 changes: 3 additions & 3 deletions src/main/resources/config/properties/profile.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ redis.host=127.0.0.1
redis.port=6379
redis.timeout=3000
redis.password=
###################\u4E0A\u4F20#################################
###################\u4e0a\u4f20#################################
upload.folder=upload
temp.folder=/tmp/
freemarker.template=/template
###################\u9A8C\u8BC1#################################
###################\u9a8c\u8bc1#################################
security.token.front=zhongkexie_token
security.token.header=X-Auth-Token
security.token.secret=zhonghexie!@#$
Expand All @@ -31,5 +31,5 @@ executor.maxPoolSize=100
executor.queueCapacity=100
executor.keep_alive_seconds=60
###################flyway#################################
flyway.init=true
flyway.init=false

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE `d_score_paper`
ADD COLUMN `score` decimal(8,4) NULL AFTER `approve_status`;
ALTER TABLE `d_score_index`
ADD COLUMN `weight` decimal(8,4) NULL ;
ALTER TABLE `d_score_item`
ADD COLUMN `weight` decimal(8,4) NULL ;
2 changes: 1 addition & 1 deletion src/main/resources/generator/generatorConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<javaClientGenerator targetPackage="com.topie.zhongkexie.database.core.dao"
targetProject="${targetBasedir}/src/main/java" type="XMLMAPPER"/>

<table tableName="d_score_paper_import_conf" domainObjectName="ScorePaperImportConf">
<table tableName="d_dict" domainObjectName="Dict">
<generatedKey column="id" sqlStatement="Mysql" identity="true"/>
</table>
</context>
Expand Down

0 comments on commit f8e99cf

Please sign in to comment.