|
|
@@ -5,6 +5,7 @@ import com.skyversation.xjcy.bean.Enterprise;
|
|
|
import com.skyversation.xjcy.bean.EnterpriseEconomic;
|
|
|
import com.skyversation.xjcy.bean.EnterpriseHealth;
|
|
|
import com.skyversation.xjcy.bean.LeaseDetail;
|
|
|
+import com.skyversation.xjcy.enums.HealthType;
|
|
|
import lombok.Getter;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
@@ -23,98 +24,6 @@ import java.util.stream.IntStream;
|
|
|
*/
|
|
|
public class EnterpriseHealthComputer {
|
|
|
|
|
|
- /**
|
|
|
- * 企业健康类型枚举
|
|
|
- * 定义各种健康状态及其描述
|
|
|
- */
|
|
|
- public enum HealthType {
|
|
|
- /**
|
|
|
- * 清算注销 - 企业已处于注销流程,请核查经营情况
|
|
|
- */
|
|
|
- LIQUIDATION(10, "清算注销", "企业已处于注销流程,请核查经营情况", "day"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 严重失信 - 企业列入严重违法失信名单,暂停政策申请
|
|
|
- */
|
|
|
- SERIOUS_DISHONESTY(11, "严重失信", "企业列入严重违法失信名单,暂停政策申请", "day"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 股权出质 - 股权已全额出质,关注经营稳定性
|
|
|
- */
|
|
|
- EQUITY_PLEDGE(12, "股权出质", "股权已全额出质,关注经营稳定性", "day"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 终本案件 - 存在大额未履行终本案件,注意法律风险
|
|
|
- */
|
|
|
- FINAL_CASE(13, "终本案件", "存在大额未履行终本案件,注意法律风险", "day"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 税收跳水 - 税收断崖式下跌,需核实经营情况
|
|
|
- */
|
|
|
- TAX_DIVE(14, "税收跳水", "税收断崖式下跌,需核实经营情况", "season"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 能耗异常 - 能耗接近零,疑似停产或外迁
|
|
|
- */
|
|
|
- ENERGY_ABNORMAL(15, "能耗异常", "能耗接近零,疑似停产或外迁", "season"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 租约到期 - 租约即将到期未续签,提前跟进招商
|
|
|
- */
|
|
|
- LEASE_EXPIRY(16, "租约到期", "租约即将到期未续签,提前跟进招商", "day"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 纳税逾期 - 多次逾期申报,提醒企业及时纳税
|
|
|
- */
|
|
|
- TAX_OVERDUE(17, "纳税逾期", "多次逾期申报,提醒企业及时纳税", "day"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 税收上升 - 税收稳步提升,潜力优秀
|
|
|
- */
|
|
|
- TAX_RISE(20, "税收上升", "税收稳步提升,潜力优秀", "season"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 产值上升 - 产值稳步提升,潜力优秀
|
|
|
- */
|
|
|
- OUTPUT_RISE(21, "产值上升", "产值稳步提升,潜力优秀", "season"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 升规成功 - 企业新晋规上,建议重点服务
|
|
|
- */
|
|
|
- UPGRADE_SUCCESS(22, "升规成功", "企业新晋规上,建议重点服务", "month"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 专利爆发 - 知识产权快速积累,创新力强
|
|
|
- */
|
|
|
- PATENT_EXPLOSION(23, "专利爆发", "知识产权快速积累,创新力强", "season"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 500强投资 - 背靠500强,扩张潜力大
|
|
|
- */
|
|
|
- TOP500_INVESTMENT(24, "500强投", "背靠500强,扩张潜力大", "day"),
|
|
|
-
|
|
|
- /**
|
|
|
- * 产业新星 - 重点产业新落地,建议跟踪服务
|
|
|
- */
|
|
|
- INDUSTRIAL_RISING_STAR(25, "产业新星", "重点产业新落地,建议跟踪服务", "day");
|
|
|
-
|
|
|
- @Getter
|
|
|
- final int value;
|
|
|
- @Getter
|
|
|
- final String defaultName;
|
|
|
- @Getter
|
|
|
- final String defaultDescribe;
|
|
|
- @Getter
|
|
|
- final String showTime;
|
|
|
-
|
|
|
- HealthType(int value, String defaultName, String defaultDescribe, String showTime) {
|
|
|
- this.value = value;
|
|
|
- this.defaultName = defaultName;
|
|
|
- this.defaultDescribe = defaultDescribe;
|
|
|
- this.showTime = showTime;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 一系列月份组成的季节<br/>不可变对象
|
|
|
*/
|
|
|
@@ -376,6 +285,32 @@ public class EnterpriseHealthComputer {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 计算是否是产业新星
|
|
|
+ */
|
|
|
+ public void computeRisingStar(LocalDateTime time) {
|
|
|
+ LocalDateTime earliestTime = time.minusYears(1);
|
|
|
+ for (Enterprise enterprise : allEnterprise) {
|
|
|
+ if (Objects.equals(enterprise.getCIsKeyProjectQp(), "2")){
|
|
|
+ if (enterprise.getCCertificateDate()!=null&&enterprise.getCCertificateDate().atStartOfDay().isAfter(earliestTime)){
|
|
|
+ putResult(enterprise,HealthType.INDUSTRIAL_RISING_STAR,time,enterprise.getCCertificateDate().atStartOfDay(),enterprise.getCCertificateDate().minusYears(1).atStartOfDay());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 计算是否是升规成功
|
|
|
+ */
|
|
|
+ public void computeUpgradeGsqy(LocalDateTime time) {
|
|
|
+ LocalDateTime earliestTime = time.minusMonths(1);
|
|
|
+ for (Enterprise enterprise : allEnterprise) {
|
|
|
+ if (Objects.equals(enterprise.getIsGsqy(), "2")){
|
|
|
+ if (enterprise.getGsqyTime()!=null&&enterprise.getGsqyTime().atStartOfDay().isAfter(earliestTime)){
|
|
|
+ putResult(enterprise,HealthType.UPGRADE_SUCCESS,time,enterprise.getCCertificateDate().atStartOfDay(),enterprise.getCCertificateDate().minusYears(1).atStartOfDay());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
/**
|
|
|
* 计算税收跳水情况
|
|
|
*
|
|
|
@@ -454,7 +389,7 @@ public class EnterpriseHealthComputer {
|
|
|
LocalDateTime healthStart, LocalDateTime healthEnd) {
|
|
|
LocalDateTime showTimeStart = computeTime.plusDays(1).toLocalDate().atStartOfDay();
|
|
|
LocalDateTime showTimeEnd;
|
|
|
- switch (type.showTime) {
|
|
|
+ switch (type.getShowTime()) {
|
|
|
case "day": {
|
|
|
showTimeEnd = showTimeStart.plusDays(1);
|
|
|
break;
|
|
|
@@ -471,7 +406,7 @@ public class EnterpriseHealthComputer {
|
|
|
showTimeEnd = showTimeStart.plusMonths(1);
|
|
|
}
|
|
|
}
|
|
|
- EnterpriseHealth result = new EnterpriseHealth(title, describe, type.value, computeTime,
|
|
|
+ EnterpriseHealth result = new EnterpriseHealth(title, describe, type.getValue(), computeTime,
|
|
|
healthStart, healthEnd, enterprise.getCUnifiedSocialCreditCode(),showTimeStart,showTimeEnd);
|
|
|
results.add(result);
|
|
|
}
|