|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ydtech.config.DictEnumConfig;
|
|
|
@@ -32,6 +33,11 @@ import com.ydtech.modules.protocol.entity.po.*;
|
|
|
import com.ydtech.modules.protocol.entity.vo.*;
|
|
|
import com.ydtech.modules.protocol.service.*;
|
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
+import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsAttrLink;
|
|
|
+import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew;
|
|
|
+import com.ydtech.modules.protocols.entity.vo.AgreementAllInformationCopyVo;
|
|
|
+import com.ydtech.modules.protocols.service.PtlAgreementProductCostsAttrLinkService;
|
|
|
+import com.ydtech.modules.protocols.service.PtlAgreementProductCostsNewService;
|
|
|
import com.ydtech.utils.idgen.IdGenerate;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -91,7 +97,6 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
@Autowired
|
|
|
private PtlAgreementDeptHistoryService ptlAgreementDeptHistoryService;
|
|
|
|
|
|
-
|
|
|
@Autowired
|
|
|
private PtlAgreementMapper ptlAgreementMapper;
|
|
|
|
|
|
@@ -998,8 +1003,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- // @Autowired
|
|
|
-// private PtlAgreementProductCostsNewService ptlAgreementProductCostsNewService;
|
|
|
+
|
|
|
public List<PtlAgreement> getCurrentAgreementList(String agreementId) {
|
|
|
PtlAgreement ptlAgreement = this.getById(agreementId);
|
|
|
String insuranceCompanyId = ptlAgreement.getInsuranceCompanyId();
|
|
|
@@ -1138,4 +1142,54 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PtlAgreementProductCostsNewService ptlAgreementProductCostsNewService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PtlAgreementProductCostsAttrLinkService ptlAgreementProductCostsAttrLinkService;
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void agreementAllInformationCopyVo(AgreementAllInformationCopyVo agreementAllInformationCopyVo) {
|
|
|
+ PtlAgreement ptlAgreement = getById(agreementAllInformationCopyVo.getAgreementId());
|
|
|
+ ptlAgreement.setId(null);
|
|
|
+ save(ptlAgreement);
|
|
|
+
|
|
|
+ AgreementAllInformationCopyVo.InformationDTO cost = agreementAllInformationCopyVo.getCost();
|
|
|
+ List<PtlAgreementProductCostsNew> ptlAgreementProductCostsNews = new ArrayList<>();
|
|
|
+ if (cost.isAll()) {
|
|
|
+ ptlAgreementProductCostsNews = ptlAgreementProductCostsNewService.getByAgreementId(ptlAgreement.getId());
|
|
|
+ ptlAgreementProductCostsNews.forEach(x -> {
|
|
|
+ x.setAgreementId(ptlAgreement.getId());
|
|
|
+ x.setId(null);
|
|
|
+ });
|
|
|
+ } else if(!cost.getInformationId().isEmpty()){
|
|
|
+ ptlAgreementProductCostsNews = ptlAgreementProductCostsNewService.lambdaQuery()
|
|
|
+ .in(PtlAgreementProductCostsNew::getId, cost.getInformationId()).list();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!ptlAgreementProductCostsNews.isEmpty()) {
|
|
|
+ List<String> collect = ptlAgreementProductCostsNews.stream().map(PtlAgreementProductCostsNew::getId).collect(Collectors.toList());
|
|
|
+ List<PtlAgreementProductCostsAttrLink> ptlAgreementProductCostsAttrLinkList = ptlAgreementProductCostsAttrLinkService.lambdaQuery()
|
|
|
+ .in(PtlAgreementProductCostsAttrLink::getCostsId, collect)
|
|
|
+ .list();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ AgreementAllInformationCopyVo.InformationDTO underwritingRules = agreementAllInformationCopyVo.getUnderwritingRules();
|
|
|
+ if (underwritingRules.isAll()) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ int size = list.size();
|
|
|
+ System.out.println(size);
|
|
|
+ }
|
|
|
+
|
|
|
}
|