|
@@ -3,6 +3,7 @@ package com.jpsoft.picc.scheduled;
|
|
|
|
|
|
import com.jpsoft.picc.modules.base.entity.InsuranceDefinition;
|
|
import com.jpsoft.picc.modules.base.entity.InsuranceDefinition;
|
|
import com.jpsoft.picc.modules.base.service.InsuranceDefinitionService;
|
|
import com.jpsoft.picc.modules.base.service.InsuranceDefinitionService;
|
|
|
|
+import com.jpsoft.picc.modules.base.service.TemplateMessageService;
|
|
import com.jpsoft.picc.modules.business.entity.InsuranceApplication;
|
|
import com.jpsoft.picc.modules.business.entity.InsuranceApplication;
|
|
import com.jpsoft.picc.modules.business.entity.InsurancePolicy;
|
|
import com.jpsoft.picc.modules.business.entity.InsurancePolicy;
|
|
import com.jpsoft.picc.modules.business.entity.InsurancePolicyMember;
|
|
import com.jpsoft.picc.modules.business.entity.InsurancePolicyMember;
|
|
@@ -22,6 +23,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import java.security.Policy;
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -39,6 +41,9 @@ public class FissionWantedTask {
|
|
@Autowired
|
|
@Autowired
|
|
private InsuranceDefinitionService insuranceDefinitionService;
|
|
private InsuranceDefinitionService insuranceDefinitionService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TemplateMessageService templateMessageService;
|
|
|
|
+
|
|
//每5分钟执行一次
|
|
//每5分钟执行一次
|
|
@Scheduled(cron="0 0/5 * * * ?")
|
|
@Scheduled(cron="0 0/5 * * * ?")
|
|
public void staticCronTask() {
|
|
public void staticCronTask() {
|
|
@@ -66,7 +71,7 @@ public class FissionWantedTask {
|
|
|
|
|
|
int days = Days.daysBetween(DateTime.now(),startTime).getDays();
|
|
int days = Days.daysBetween(DateTime.now(),startTime).getDays();
|
|
|
|
|
|
- if (days>limit){
|
|
|
|
|
|
+ if (days>limit + 1){
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -83,15 +88,28 @@ public class FissionWantedTask {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String srcPolicyStatus = insurancePolicy.getStatus();
|
|
|
|
+ String destPolicyStatus;
|
|
|
|
+
|
|
if(isUnChecked){
|
|
if(isUnChecked){
|
|
- insurancePolicy.setStatus(PolicyStatus.PendingTrial.getValue() + "");
|
|
|
|
|
|
+ //下月投保有未审核人员则转人才超市核准
|
|
|
|
+ destPolicyStatus = PolicyStatus.PendingTrial.getValue() + "";
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- insurancePolicy.setStatus(PolicyStatus.PendingMakePolicy.getValue() + "");
|
|
|
|
|
|
+ //下月投保都已审核人员则转待制单
|
|
|
|
+ destPolicyStatus = PolicyStatus.PendingMakePolicy.getValue() + "";
|
|
}
|
|
}
|
|
|
|
|
|
- insurancePolicyService.update(insurancePolicy);
|
|
|
|
- affectCount++;
|
|
|
|
|
|
+ if (days==limit + 1){
|
|
|
|
+ //提前一天通知投保人
|
|
|
|
+ templateMessageService.sendTemplateMessage(insurancePolicy.getId(),
|
|
|
|
+ PolicyStatus.valueOf(srcPolicyStatus),PolicyStatus.NotifyInAdvance);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ insurancePolicy.setStatus(destPolicyStatus);
|
|
|
|
+ insurancePolicyService.update(insurancePolicy);
|
|
|
|
+ affectCount++;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
log.warn("已自动修改状态:" + affectCount + "条记录");
|
|
log.warn("已自动修改状态:" + affectCount + "条记录");
|