|
|
@@ -156,30 +156,27 @@ public class ContribBillFormPlugin extends AbstractFormPlugin implements Plugin,
|
|
|
DynamicObject scoreItemRank = ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(ContributionConstant.NCKD_SCOREITEMRANK));
|
|
|
DynamicObject person = ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(ContributionConstant.NCKD_PERSON, rowIndex));
|
|
|
BigDecimal oriScore = ConvertUtil.toBigDecimal(this.getModel().getValue(ContributionConstant.NCKD_ORISCORE, rowIndex));
|
|
|
- if (date != null && scoreItem != null && scoreItemSub != null) {
|
|
|
- String scoreItemNumber = scoreItem.getString(FormConstant.NUMBER_KEY);
|
|
|
- if (ScoreItemEnum.RESEARCH_SCORE.getCode().equalsIgnoreCase(scoreItemNumber)) {
|
|
|
- if (person != null && oriScore != null && oriScore.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- //科研与创新需要需要匹配积分规则
|
|
|
- QFilter filter = new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEM), QCP.equals, scoreItem.getLong(FormConstant.ID_KEY))
|
|
|
- .and(new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEMSUB), QCP.equals, scoreItemSub.getLong(FormConstant.ID_KEY)))
|
|
|
- .and(new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEMRANK), QCP.equals, scoreItemRank.getLong(FormConstant.ID_KEY)));
|
|
|
- Map<String, BigDecimal> scoreConf = ContributionHelper.getScoreConf(filter);
|
|
|
- String key = scoreItem.getLong(FormConstant.ID_KEY) + "-" + scoreItemSub.getLong(FormConstant.ID_KEY) + "-" + scoreItemRank.getLong(FormConstant.ID_KEY);
|
|
|
- BigDecimal validScore = oriScore;
|
|
|
- if (!scoreConf.isEmpty() && scoreConf.containsKey(key)) {
|
|
|
- BigDecimal maxScore = scoreConf.get(key);
|
|
|
- if (maxScore != null) {
|
|
|
- validScore = oriScore.compareTo(maxScore) > 0 ? maxScore : oriScore;
|
|
|
- }
|
|
|
+ if (date != null && scoreItem != null && scoreItemSub != null && scoreItemRank != null) {
|
|
|
+ if (person != null && oriScore != null && oriScore.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ //科研与创新需要需要匹配积分规则
|
|
|
+ QFilter filter = new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEM), QCP.equals, scoreItem.getLong(FormConstant.ID_KEY))
|
|
|
+ .and(new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEMSUB), QCP.equals, scoreItemSub.getLong(FormConstant.ID_KEY)))
|
|
|
+ .and(new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEMRANK), QCP.equals, scoreItemRank.getLong(FormConstant.ID_KEY)));
|
|
|
+ Map<String, BigDecimal> scoreConf = ContributionHelper.getScoreConfByPersonMaxScore(filter);
|
|
|
+ String key = scoreItem.getLong(FormConstant.ID_KEY) + "-" + scoreItemSub.getLong(FormConstant.ID_KEY) + "-" + scoreItemRank.getLong(FormConstant.ID_KEY);
|
|
|
+ BigDecimal validScore = oriScore;
|
|
|
+ if (!scoreConf.isEmpty() && scoreConf.containsKey(key) && scoreConf.get(key) != null && scoreConf.get(key).compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ BigDecimal maxScore = scoreConf.get(key);
|
|
|
+ if (maxScore != null) {
|
|
|
+ validScore = oriScore.compareTo(maxScore) > 0 ? maxScore : oriScore;
|
|
|
}
|
|
|
- this.getModel().setValue(ContributionConstant.NCKD_SCORE, validScore, rowIndex);
|
|
|
- this.getView().updateView(ContributionConstant.NCKD_SCORE, rowIndex);
|
|
|
}
|
|
|
- } else {
|
|
|
- this.getModel().setValue(ContributionConstant.NCKD_SCORE, oriScore, rowIndex);
|
|
|
+ this.getModel().setValue(ContributionConstant.NCKD_SCORE, validScore, rowIndex);
|
|
|
this.getView().updateView(ContributionConstant.NCKD_SCORE, rowIndex);
|
|
|
}
|
|
|
+ }else{
|
|
|
+ this.getModel().setValue(ContributionConstant.NCKD_SCORE, oriScore, rowIndex);
|
|
|
+ this.getView().updateView(ContributionConstant.NCKD_SCORE, rowIndex);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -231,40 +228,38 @@ public class ContribBillFormPlugin extends AbstractFormPlugin implements Plugin,
|
|
|
DynamicObject scoreItemRank = ConvertUtil.toDynamicObjectOrNull(this.getModel().getValue(ContributionConstant.NCKD_SCOREITEMRANK));
|
|
|
|
|
|
|
|
|
- if (date != null && scoreItem != null && scoreItemSub != null) {
|
|
|
+ if (date != null && scoreItem != null && scoreItemSub != null && scoreItemRank != null) {
|
|
|
|
|
|
DynamicObjectCollection entryEntity = this.getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
|
|
|
- String scoreItemNumber = scoreItem.getString(FormConstant.NUMBER_KEY);
|
|
|
- if(ScoreItemEnum.RESEARCH_SCORE.getCode().equalsIgnoreCase(scoreItemNumber)){
|
|
|
- if(scoreItemRank != null) {
|
|
|
- //科研与创新需要需要匹配积分规则
|
|
|
- QFilter filter = new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEM), QCP.equals, scoreItem.getLong(FormConstant.ID_KEY))
|
|
|
- .and(new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEMSUB), QCP.equals, scoreItemSub.getLong(FormConstant.ID_KEY)))
|
|
|
- .and(new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEMRANK), QCP.equals, scoreItemRank.getLong(FormConstant.ID_KEY)));
|
|
|
- Map<String, BigDecimal> scoreConf = ContributionHelper.getScoreConf(filter);
|
|
|
- String key = scoreItem.getLong(FormConstant.ID_KEY)+"-"+scoreItemSub.getLong(FormConstant.ID_KEY)+"-"+scoreItemRank.getLong(FormConstant.ID_KEY);
|
|
|
- for (int i = 0; i < entryEntity.size(); i++) {
|
|
|
- DynamicObject entry = entryEntity.get(i);
|
|
|
- BigDecimal oriScore = entry.getBigDecimal(ContributionConstant.NCKD_ORISCORE);
|
|
|
- BigDecimal validScore = oriScore;
|
|
|
- if(!scoreConf.isEmpty() && scoreConf.containsKey(key)){
|
|
|
- BigDecimal maxScore = scoreConf.get(key);
|
|
|
- if (maxScore != null && oriScore != null) {
|
|
|
- validScore = oriScore.compareTo(maxScore) > 0 ? maxScore : oriScore;
|
|
|
- } else {
|
|
|
- // 根据业务需求处理 null 值情况
|
|
|
- validScore = oriScore != null ? oriScore : BigDecimal.ZERO;
|
|
|
- }
|
|
|
- }
|
|
|
- this.getModel().setValue(ContributionConstant.NCKD_SCORE, validScore, i);
|
|
|
+
|
|
|
+ //科研与创新需要需要匹配积分规则
|
|
|
+ QFilter filter = new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEM), QCP.equals, scoreItem.getLong(FormConstant.ID_KEY))
|
|
|
+ .and(new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEMSUB), QCP.equals, scoreItemSub.getLong(FormConstant.ID_KEY)))
|
|
|
+ .and(new QFilter(String.join(".", FormConstant.NCKD_ENTRYENTITY, ContributionConstant.NCKD_SCOREITEMRANK), QCP.equals, scoreItemRank.getLong(FormConstant.ID_KEY)));
|
|
|
+ Map<String, BigDecimal> scoreConf = ContributionHelper.getScoreConfByPersonMaxScore(filter);
|
|
|
+ String key = scoreItem.getLong(FormConstant.ID_KEY)+"-"+scoreItemSub.getLong(FormConstant.ID_KEY)+"-"+scoreItemRank.getLong(FormConstant.ID_KEY);
|
|
|
+ for (int i = 0; i < entryEntity.size(); i++) {
|
|
|
+ DynamicObject entry = entryEntity.get(i);
|
|
|
+ BigDecimal oriScore = entry.getBigDecimal(ContributionConstant.NCKD_ORISCORE);
|
|
|
+ BigDecimal validScore = oriScore;
|
|
|
+ if(!scoreConf.isEmpty() && scoreConf.containsKey(key) && scoreConf.get(key) != null && scoreConf.get(key).compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ BigDecimal maxScore = scoreConf.get(key);
|
|
|
+ if (maxScore != null && oriScore != null) {
|
|
|
+ validScore = oriScore.compareTo(maxScore) > 0 ? maxScore : oriScore;
|
|
|
+ } else {
|
|
|
+ // 根据业务需求处理 null 值情况
|
|
|
+ validScore = oriScore != null ? oriScore : BigDecimal.ZERO;
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
- for (int i = 0; i < entryEntity.size(); i++) {
|
|
|
- DynamicObject entry = entryEntity.get(i);
|
|
|
- BigDecimal oriScore = entry.getBigDecimal(ContributionConstant.NCKD_ORISCORE);
|
|
|
- this.getModel().setValue(ContributionConstant.NCKD_SCORE, oriScore, i);
|
|
|
- }
|
|
|
+ this.getModel().setValue(ContributionConstant.NCKD_SCORE, validScore, i);
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ DynamicObjectCollection entryEntity = this.getModel().getEntryEntity(FormConstant.NCKD_ENTRYENTITY);
|
|
|
+ for (int i = 0; i < entryEntity.size(); i++) {
|
|
|
+ DynamicObject entry = entryEntity.get(i);
|
|
|
+ BigDecimal oriScore = entry.getBigDecimal(ContributionConstant.NCKD_ORISCORE);
|
|
|
+ this.getModel().setValue(ContributionConstant.NCKD_SCORE, oriScore, i);
|
|
|
}
|
|
|
}
|
|
|
}
|