|
|
@@ -13,6 +13,7 @@ import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
|
|
|
import com.jzg.commons.entity.vo.AgreementRulesVo;
|
|
|
import com.jzg.commons.entity.vo.CostListVo;
|
|
|
import com.jzg.commons.entity.vo.PtlAgreementCostVo;
|
|
|
+import com.jzg.costsorrule.constants.OperatorConstant;
|
|
|
import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrLinkMapper;
|
|
|
import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrMapper;
|
|
|
import com.jzg.organization.mapper.PtlAgreementUndwrtRulesMapper;
|
|
|
@@ -26,6 +27,9 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.ZoneId;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -56,6 +60,7 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
@Override
|
|
|
public List<AgreementRulesVo> queryList(String agreementId) {
|
|
|
List<AgreementRulesVo> rulesVos = baseMapper.queryList(agreementId);
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
if(CollUtil.isNotEmpty(rulesVos)){
|
|
|
for (AgreementRulesVo rulesVo : rulesVos) {
|
|
|
CostAgreementParam param = new CostAgreementParam();
|
|
|
@@ -63,6 +68,22 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
|
|
|
param.setCoverRuleId(rulesVo.getId());
|
|
|
List<CostListVo> costVos = ptlAgreementCostService.queryByAgreementIdAndCoverRuleId(param);
|
|
|
if(CollUtil.isNotEmpty(costVos)){
|
|
|
+ costVos.forEach(cost->{
|
|
|
+ cost.getPtlAgreementCostVoList().forEach(vo->{
|
|
|
+ LocalDateTime effectiveTime = vo.getEffectiveTime().toInstant()
|
|
|
+ .atZone(ZoneId.systemDefault())
|
|
|
+ .toLocalDateTime();
|
|
|
+ LocalDateTime failureTime = vo.getEffectiveTime().toInstant()
|
|
|
+ .atZone(ZoneId.systemDefault())
|
|
|
+ .toLocalDateTime();
|
|
|
+ if(now.isAfter(effectiveTime) && now.isBefore(failureTime)){
|
|
|
+ vo.setIsValid(0);
|
|
|
+ }else{
|
|
|
+ vo.setIsValid(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ });
|
|
|
rulesVo.setCostVoList(costVos);
|
|
|
}
|
|
|
}
|