平均分配分值

master
pd 4 years ago
parent 6eb88e4187
commit b8e8868747
  1. 25
      src/main/java/com/yipin/liuwanr/helper/UserUtil.java
  2. 2
      src/main/java/com/yipin/liuwanr/mapper/Project_ManagementMapper.java

@ -7,28 +7,39 @@ public class UserUtil {
/**
* 平均分配分值
*
* @param number 判分点数量
* @return
*/
public static List<Integer> averageValue(Integer number) {
Integer score=100/number;
Integer lastScore=score+100%number;
List<Integer> list=new ArrayList<Integer>();
for (int i = 0; i < number-1; i++) {
Integer score = 100 / number;
List<Integer> list = new ArrayList<Integer>();
if (100 % number == 0) {
for (int i = 0; i < number; i++) {
list.add(score);
}
list.add(lastScore);
} else {
int n = 0;
for (int i = 0; i < number; i++) {
list.add(score);
}
for (int i = 100 % number; i > 0; i--) {
n = score + 1;
list.set(i, n);
}
}
return list;
}
/**
* 将string类型转成list集合
*
* @param str
* @return
*/
public static List<Integer> strToInteger(String str){
public static List<Integer> strToInteger(String str) {
String[] strs = str.split(",");
List<Integer> list=new ArrayList<Integer>();
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < strs.length; i++) {
list.add(Integer.parseInt(strs[i]));
}

@ -131,7 +131,7 @@ public interface Project_ManagementMapper {
* @return
*/
@Select({ "<script>",
"select judgmentPointsId,judgmentPointsName from hr_judgment_points where isdel=0 and systemId=#{systemId}",
"select judgmentPointsId,judgmentPointsName from hr_judgment_points where isdel=0 and systemId=#{systemId} and isopen=0",
" <if test='judgmentPointsName!=null'> and judgmentPointsName like concat('%','${judgmentPointsName}','%')</if>",
"</script>" })
List<Judgment_Points> queryAllJudgmentPoints(Judgment_Points points);

Loading…
Cancel
Save