|
@@ -12,6 +12,7 @@ import com.ydtech.modules.protocols.entity.po.*;
|
|
|
import com.ydtech.modules.protocols.entity.vo.AgreementProductCosts;
|
|
import com.ydtech.modules.protocols.entity.vo.AgreementProductCosts;
|
|
|
import com.ydtech.modules.protocols.entity.vo.AgreementProductCostsSave;
|
|
import com.ydtech.modules.protocols.entity.vo.AgreementProductCostsSave;
|
|
|
import com.ydtech.modules.protocols.service.*;
|
|
import com.ydtech.modules.protocols.service.*;
|
|
|
|
|
+import com.ydtech.utils.idgen.IdGenerate;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -282,7 +283,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
//校验非车信息是否存在
|
|
//校验非车信息是否存在
|
|
|
List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
|
|
List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
|
|
|
if (nonMotorInsurance.size() > 0) {
|
|
if (nonMotorInsurance.size() > 0) {
|
|
|
- if((!nonMotorInsurance.get(0).getMin().equals("0") || !nonMotorInsurance.get(0).getMax().equals("0"))) {
|
|
|
|
|
|
|
+ if(nonMotorInsurance.get(0).getMin() != null || nonMotorInsurance.get(0).getMax() != null)
|
|
|
|
|
+ {
|
|
|
if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
|
|
if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
|
|
|
throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
|
|
throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
|
|
|
}
|
|
}
|
|
@@ -312,6 +314,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
PtlAgreementProductCostsNewHistory ptlAgreementProductCostsNewHistory = new PtlAgreementProductCostsNewHistory();
|
|
PtlAgreementProductCostsNewHistory ptlAgreementProductCostsNewHistory = new PtlAgreementProductCostsNewHistory();
|
|
|
BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNewHistory);
|
|
BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNewHistory);
|
|
|
//添加费用ID
|
|
//添加费用ID
|
|
|
|
|
+ ptlAgreementProductCostsNewHistory.setId(IdGenerate.nextId());
|
|
|
ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
|
//生成批次ID
|
|
//生成批次ID
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
String uuid = UUID.randomUUID().toString();
|
|
@@ -341,6 +344,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
costsAttrLink.add(x);
|
|
costsAttrLink.add(x);
|
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
|
//设置产品费用因子历史记录
|
|
//设置产品费用因子历史记录
|
|
|
|
|
+ costsAttrLinkHistory.setId(IdGenerate.nextId());
|
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
|
costsAttrLinkHistory.setOperatorType("add");
|
|
costsAttrLinkHistory.setOperatorType("add");
|
|
|
costsAttrLinkHistory.setModifier(BaseController.getUser().getId());
|
|
costsAttrLinkHistory.setModifier(BaseController.getUser().getId());
|
|
@@ -354,6 +358,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
costsAttrLink.add(x);
|
|
costsAttrLink.add(x);
|
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
|
//设置产品费用因子历史记录
|
|
//设置产品费用因子历史记录
|
|
|
|
|
+ costsAttrLinkHistory.setId(IdGenerate.nextId());
|
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
|
|
|
|
|
|
costsAttrLinkHistory.setOperatorType("add");
|
|
costsAttrLinkHistory.setOperatorType("add");
|
|
@@ -374,15 +379,15 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
@Override
|
|
@Override
|
|
|
public boolean costsUpdate(AgreementProductCosts agreementProductCosts) {
|
|
public boolean costsUpdate(AgreementProductCosts agreementProductCosts) {
|
|
|
//校验非车信息是否存在
|
|
//校验非车信息是否存在
|
|
|
-// List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
|
|
|
|
|
-// if (nonMotorInsurance.size() > 0) {
|
|
|
|
|
-//
|
|
|
|
|
-// if((!nonMotorInsurance.get(0).getMin().equals("0") || !nonMotorInsurance.get(0).getMax().equals("0"))) {
|
|
|
|
|
-// if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
|
|
|
|
|
-// throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ List<PtlAgreementProductCostsAttrLink> nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).collect(Collectors.toList());
|
|
|
|
|
+ if (nonMotorInsurance.size() > 0) {
|
|
|
|
|
+ if(nonMotorInsurance.get(0).getMin() != null || nonMotorInsurance.get(0).getMax() != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
|
|
|
|
|
+ throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//更新费用主表信息
|
|
//更新费用主表信息
|
|
|
PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();
|
|
PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();
|
|
@@ -413,6 +418,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
PtlAgreementProductCostsNewHistory ptlAgreementProductCostsNewHistory = new PtlAgreementProductCostsNewHistory();
|
|
PtlAgreementProductCostsNewHistory ptlAgreementProductCostsNewHistory = new PtlAgreementProductCostsNewHistory();
|
|
|
BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNewHistory);
|
|
BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNewHistory);
|
|
|
//添加费用ID
|
|
//添加费用ID
|
|
|
|
|
+ ptlAgreementProductCostsNewHistory.setId(IdGenerate.nextId());
|
|
|
ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
|
//生成批次ID
|
|
//生成批次ID
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
String uuid = UUID.randomUUID().toString();
|
|
@@ -454,6 +460,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
//设置产品费用因子历史记录
|
|
//设置产品费用因子历史记录
|
|
|
PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
|
|
PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
|
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
|
|
|
+ costsAttrLinkHistory.setId(IdGenerate.nextId());
|
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
|
|
|
|
|
|
costsAttrLinkHistory.setOperatorType("update");
|
|
costsAttrLinkHistory.setOperatorType("update");
|
|
@@ -471,6 +478,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
//设置产品费用因子历史记录
|
|
//设置产品费用因子历史记录
|
|
|
PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
|
|
PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
|
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
|
|
|
+ costsAttrLinkHistory.setId(IdGenerate.nextId());
|
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
|
|
|
|
|
|
costsAttrLinkHistory.setOperatorType("update");
|
|
costsAttrLinkHistory.setOperatorType("update");
|
|
@@ -487,6 +495,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
//设置产品费用因子历史记录
|
|
//设置产品费用因子历史记录
|
|
|
PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
|
|
PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
|
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
|
|
|
+ costsAttrLinkHistory.setId(IdGenerate.nextId());
|
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
|
|
|
|
|
|
costsAttrLinkHistory.setOperatorType("update");
|
|
costsAttrLinkHistory.setOperatorType("update");
|
|
@@ -517,6 +526,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
BeanUtils.copyProperties(ptlAgreementProductCostsNew, ptlAgreementProductCostsNewHistory);
|
|
BeanUtils.copyProperties(ptlAgreementProductCostsNew, ptlAgreementProductCostsNewHistory);
|
|
|
BeanUtils.copyProperties(productCostsExport, ptlAgreementProductCostsNewHistory);
|
|
BeanUtils.copyProperties(productCostsExport, ptlAgreementProductCostsNewHistory);
|
|
|
//添加费用ID
|
|
//添加费用ID
|
|
|
|
|
+ ptlAgreementProductCostsNewHistory.setId(IdGenerate.nextId());
|
|
|
ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
ptlAgreementProductCostsNewHistory.setCostsId(ptlAgreementProductCostsNew.getId());
|
|
|
//生成批次ID
|
|
//生成批次ID
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
String uuid = UUID.randomUUID().toString();
|
|
@@ -538,8 +548,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
|
|
PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
|
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
BeanUtils.copyProperties(x, costsAttrLinkHistory);
|
|
|
//设置产品费用因子历史记录
|
|
//设置产品费用因子历史记录
|
|
|
|
|
+ costsAttrLinkHistory.setId(IdGenerate.nextId());
|
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
costsAttrLinkHistory.setBatch(uuid);
|
|
|
- costsAttrLinkHistory.setOperatorType("add");
|
|
|
|
|
|
|
+ costsAttrLinkHistory.setOperatorType("delete");
|
|
|
costsAttrLinkHistory.setModifier(BaseController.getUser().getId());
|
|
costsAttrLinkHistory.setModifier(BaseController.getUser().getId());
|
|
|
costsAttrLinkHistory.setOperatorTime(LocalDateTime.now());
|
|
costsAttrLinkHistory.setOperatorTime(LocalDateTime.now());
|
|
|
costsAttrLinkHistories.add(costsAttrLinkHistory);
|
|
costsAttrLinkHistories.add(costsAttrLinkHistory);
|