|
@@ -4,10 +4,14 @@ import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collector;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
+import org.example.mybatisplus.module.AuditResult;
|
|
|
import org.example.mybatisplus.module.BasicInfo;
|
|
|
import org.example.mybatisplus.module.vo.BasicInfoCheck;
|
|
|
import org.example.mybatisplus.module.vo.BasicInfoScore;
|
|
|
+import org.example.mybatisplus.module.vo.CheckItemScore;
|
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
@@ -21,6 +25,28 @@ public class CmsEnterpriseRiskInfoCheckBO {
|
|
|
private Map<String, CmsEntRiskInfoCktItemCategory> mpCmsEntRiskInfoCktItemCategory =
|
|
|
Collections.emptyMap();
|
|
|
|
|
|
+ public Long getScore() {
|
|
|
+ return mpCmsEntRiskInfoCktItemCategory.values().stream()
|
|
|
+ .mapToLong(CmsEntRiskInfoCktItemCategory::getScore).sum();
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getRiskAlert() {
|
|
|
+ return mpCmsEnterpriseRiskInfoCheckItem.values().stream()
|
|
|
+ .filter(item -> !item.getBizResult())
|
|
|
+ .map(item -> item.getResultMsg())
|
|
|
+ .reduce("", (r, msg) -> { return String.format("%s\n%s", msg); });
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<CheckItemScore> getCheckItemScores() {
|
|
|
+ return mpCmsEnterpriseRiskInfoCheckItem.values().stream().map(item -> {
|
|
|
+ CheckItemScore ret = new CheckItemScore();
|
|
|
+ ret.setItemName(item.getItemName());
|
|
|
+ ret.setScore(item.getBizScore());
|
|
|
+ ret.setCategory(mpCmsEntRiskInfoCktItemCategory.get(item.getCategoryType()).getCategoryName());
|
|
|
+ return ret;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
public void fillBasicInfoVO(BasicInfo basicInfo) {
|
|
|
List<BasicInfoCheck> checks = new ArrayList<>();
|
|
|
for(String label: new String[] {"donation_revenue_scale", "net_worth_rating", "operation_years", "moca_rating"}) {
|
|
@@ -40,4 +66,13 @@ public class CmsEnterpriseRiskInfoCheckBO {
|
|
|
cmsEnterpriseRiskInfoCheck.getAdvice()
|
|
|
));
|
|
|
}
|
|
|
+
|
|
|
+ public void fillAuditResultVO(AuditResult auditResult) {
|
|
|
+ auditResult.setScore(Long.toString(this.getScore()));
|
|
|
+ auditResult.setOpinion(cmsEnterpriseRiskInfoCheck.getReview());
|
|
|
+ auditResult.setAuditDate(cmsEnterpriseRiskInfoCheck.getCheckTime().toString());
|
|
|
+ auditResult.setRiskAlert(this.getRiskAlert());
|
|
|
+ auditResult.setSuggestion(cmsEnterpriseRiskInfoCheck.getAdvice());
|
|
|
+ auditResult.setCheckItemScores(getCheckItemScores());
|
|
|
+ }
|
|
|
}
|