|
@@ -121,11 +121,19 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
}
|
|
}
|
|
|
List<String> createdIds = new ArrayList<>();
|
|
List<String> createdIds = new ArrayList<>();
|
|
|
for (CostAdd costAdd : costAddList) {
|
|
for (CostAdd costAdd : costAddList) {
|
|
|
- for (PtlAgreementCostAdd ptlAgreementCostAdd : costAdd.getPtlAgreementCostAddList()){
|
|
|
|
|
- if (ListUtils.hasDuplicates(ptlAgreementCostAdd.getRuleConditions())){
|
|
|
|
|
|
|
+ for (PtlAgreementCostAdd ptlAgreementCostAdd : costAdd.getPtlAgreementCostAddList()) {
|
|
|
|
|
+ // 规则条件 min 根据 minArray 重组:多选/下拉等多值场景前端以数组提交,落库需以逗号分隔
|
|
|
|
|
+ if (CollUtil.isNotEmpty(ptlAgreementCostAdd.getRuleConditions())) {
|
|
|
|
|
+ ptlAgreementCostAdd.getRuleConditions().forEach(item -> {
|
|
|
|
|
+ if (CollUtil.isNotEmpty(item.getMinArray())) {
|
|
|
|
|
+ item.setMin(String.join(",", item.getMinArray()));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ListUtils.hasDuplicates(ptlAgreementCostAdd.getRuleConditions())) {
|
|
|
throw new SystemException("添加数据存在相同费用规则,请检查");
|
|
throw new SystemException("添加数据存在相同费用规则,请检查");
|
|
|
}
|
|
}
|
|
|
- if(StrUtil.isEmpty(costAdd.getPtlAgreementId())){
|
|
|
|
|
|
|
+ if (StrUtil.isEmpty(costAdd.getPtlAgreementId())) {
|
|
|
log.info("新增费用的时候,需要指定关联的协议信息。ptlAgreemenCostAdd=[{}]", JSONUtil.toJsonStr(ptlAgreemenCostAdd));
|
|
log.info("新增费用的时候,需要指定关联的协议信息。ptlAgreemenCostAdd=[{}]", JSONUtil.toJsonStr(ptlAgreemenCostAdd));
|
|
|
return HttpResult.error("新增费用的时候,需要指定关联的协议信息");
|
|
return HttpResult.error("新增费用的时候,需要指定关联的协议信息");
|
|
|
}
|
|
}
|
|
@@ -174,7 +182,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
// 校验ptlAgreementCostTypeList 数据 exportKeepPointRatio 不能大于 export
|
|
// 校验ptlAgreementCostTypeList 数据 exportKeepPointRatio 不能大于 export
|
|
|
if (!CollectionUtils.isEmpty(ptlAgreementCostEnd.getPtlAgreementCostTypeList())) {
|
|
if (!CollectionUtils.isEmpty(ptlAgreementCostEnd.getPtlAgreementCostTypeList())) {
|
|
|
for (PtlAgreementCostEnd.PtlAgreementCostTypeDto ptlAgreementCostTypeDto : ptlAgreementCostEnd.getPtlAgreementCostTypeList()) {
|
|
for (PtlAgreementCostEnd.PtlAgreementCostTypeDto ptlAgreementCostTypeDto : ptlAgreementCostEnd.getPtlAgreementCostTypeList()) {
|
|
|
- if (null != ptlAgreementCostTypeDto.getExportKeepPointRatio() && null != ptlAgreementCostTypeDto.getExport()){
|
|
|
|
|
|
|
+ if (null != ptlAgreementCostTypeDto.getExportKeepPointRatio() && null != ptlAgreementCostTypeDto.getExport()) {
|
|
|
if (ptlAgreementCostTypeDto.getExportKeepPointRatio().compareTo(ptlAgreementCostTypeDto.getExport()) > 0) {
|
|
if (ptlAgreementCostTypeDto.getExportKeepPointRatio().compareTo(ptlAgreementCostTypeDto.getExport()) > 0) {
|
|
|
return HttpResult.error("出口留点比例不能大于出口比例");
|
|
return HttpResult.error("出口留点比例不能大于出口比例");
|
|
|
}
|
|
}
|
|
@@ -194,16 +202,15 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
}
|
|
}
|
|
|
// 处理minArray
|
|
// 处理minArray
|
|
|
if (!CollectionUtils.isEmpty(ptlAgreementCostEnd.getRuleConditions())) {
|
|
if (!CollectionUtils.isEmpty(ptlAgreementCostEnd.getRuleConditions())) {
|
|
|
- ptlAgreementCostEnd.getRuleConditions().forEach(item->{
|
|
|
|
|
|
|
+ ptlAgreementCostEnd.getRuleConditions().forEach(item -> {
|
|
|
StringBuilder min = new StringBuilder();
|
|
StringBuilder min = new StringBuilder();
|
|
|
- if(item.getMinArray() != null && item.getMinArray().size() > 0){
|
|
|
|
|
- item.getMinArray().forEach(kk->{
|
|
|
|
|
|
|
+ if (item.getMinArray() != null && item.getMinArray().size() > 0) {
|
|
|
|
|
+ item.getMinArray().forEach(kk -> {
|
|
|
min.append(kk).append(",");
|
|
min.append(kk).append(",");
|
|
|
});
|
|
});
|
|
|
- min.substring(0,min.length()-1);
|
|
|
|
|
|
|
+ min.substring(0, min.length() - 1);
|
|
|
item.setMin(min.toString());
|
|
item.setMin(min.toString());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
costRuleService.saveOrUpdateCostRule(BeanUtil.copyToList(ptlAgreementCostEnd.getRuleConditions(), PtlAgreementCostRule.class), ptlAgreementCost.getId());
|
|
costRuleService.saveOrUpdateCostRule(BeanUtil.copyToList(ptlAgreementCostEnd.getRuleConditions(), PtlAgreementCostRule.class), ptlAgreementCost.getId());
|
|
|
}
|
|
}
|
|
@@ -211,36 +218,35 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public String buildDescString(String companyId, List<?> list){
|
|
|
|
|
- if (CollectionUtils.isEmpty(list)){
|
|
|
|
|
|
|
+ public String buildDescString(String companyId, List<?> list) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
String desc = BuildDescUtils.buildDesc(companyId, BeanUtil.copyToList(list, PtlAgreementUndwrtRulesAttr.class), agreementUndwrtRulesAttrService.getUndwrtRulesAttrList());
|
|
String desc = BuildDescUtils.buildDesc(companyId, BeanUtil.copyToList(list, PtlAgreementUndwrtRulesAttr.class), agreementUndwrtRulesAttrService.getUndwrtRulesAttrList());
|
|
|
- // buildDesc返回的条件间以相邻双逗号分隔,此处合并为单个分号
|
|
|
|
|
- return StringUtils.mergeAdjacentComma(desc);
|
|
|
|
|
|
|
+ return desc;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public boolean verify(PtlAgreementCostAdd ptlAgreementCostAdd){
|
|
|
|
|
|
|
+ public boolean verify(PtlAgreementCostAdd ptlAgreementCostAdd) {
|
|
|
CostAgreementParam costAgreementParam = new CostAgreementParam();
|
|
CostAgreementParam costAgreementParam = new CostAgreementParam();
|
|
|
costAgreementParam.setPtlAgreementId(ptlAgreementCostAdd.getPtlAgreementId());
|
|
costAgreementParam.setPtlAgreementId(ptlAgreementCostAdd.getPtlAgreementId());
|
|
|
costAgreementParam.setCoverRuleId(ptlAgreementCostAdd.getCoverRuleId());
|
|
costAgreementParam.setCoverRuleId(ptlAgreementCostAdd.getCoverRuleId());
|
|
|
List<PtlAgreementCostVo> voList = queryByAgreementId(costAgreementParam);
|
|
List<PtlAgreementCostVo> voList = queryByAgreementId(costAgreementParam);
|
|
|
- if (CollectionUtils.isEmpty(voList)){
|
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(voList)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
// 比较规则是否相同
|
|
// 比较规则是否相同
|
|
|
Map<String, List<PtlAgreementCostVo>> listMap = voList.stream().filter(v -> Constants.ENABLE == v.getIsEnabled() && Constants.EFFECTIVE == v.getIsValid()).collect(Collectors.groupingBy(PtlAgreementCostVo::getProductId));
|
|
Map<String, List<PtlAgreementCostVo>> listMap = voList.stream().filter(v -> Constants.ENABLE == v.getIsEnabled() && Constants.EFFECTIVE == v.getIsValid()).collect(Collectors.groupingBy(PtlAgreementCostVo::getProductId));
|
|
|
List<PtlAgreementCostVo> ptlAgreementCostVos = listMap.get(ptlAgreementCostAdd.getProductId());
|
|
List<PtlAgreementCostVo> ptlAgreementCostVos = listMap.get(ptlAgreementCostAdd.getProductId());
|
|
|
- if (CollectionUtils.isEmpty(ptlAgreementCostVos)){
|
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(ptlAgreementCostVos)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
List<RuleConditionsVerify> ruleConditionsVerifies = BeanUtil.copyToList(ptlAgreementCostAdd.getRuleConditions(), RuleConditionsVerify.class);
|
|
List<RuleConditionsVerify> ruleConditionsVerifies = BeanUtil.copyToList(ptlAgreementCostAdd.getRuleConditions(), RuleConditionsVerify.class);
|
|
|
- if (CollectionUtils.isEmpty(ruleConditionsVerifies)){
|
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(ruleConditionsVerifies)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
for (PtlAgreementCostVo ptlAgreementCostVo : ptlAgreementCostVos) {
|
|
for (PtlAgreementCostVo ptlAgreementCostVo : ptlAgreementCostVos) {
|
|
|
List<RuleConditionsVerify> verifies = BeanUtil.copyToList(ptlAgreementCostVo.getRuleConditions(), RuleConditionsVerify.class);
|
|
List<RuleConditionsVerify> verifies = BeanUtil.copyToList(ptlAgreementCostVo.getRuleConditions(), RuleConditionsVerify.class);
|
|
|
- if (ObjectUtil.equals(verifies,ruleConditionsVerifies)){
|
|
|
|
|
|
|
+ if (ObjectUtil.equals(verifies, ruleConditionsVerifies)) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -258,7 +264,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
public HttpResult<PtlAgreementCostVo> queryById(Long id) {
|
|
public HttpResult<PtlAgreementCostVo> queryById(Long id) {
|
|
|
log.info("查询协议的费用信息:协议费用id=[{}]", id);
|
|
log.info("查询协议的费用信息:协议费用id=[{}]", id);
|
|
|
PtlAgreementCostVo ptlAgreementCostVo = ptlAgreementCostMapper.queryById(id);
|
|
PtlAgreementCostVo ptlAgreementCostVo = ptlAgreementCostMapper.queryById(id);
|
|
|
- if (ObjectUtil.isEmpty(ptlAgreementCostVo)){
|
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(ptlAgreementCostVo)) {
|
|
|
return HttpResult.ok(ptlAgreementCostVo);
|
|
return HttpResult.ok(ptlAgreementCostVo);
|
|
|
}
|
|
}
|
|
|
RList<SysDict> rules = redissonClient.getList(DICT_REDIS_KEY + "rule_operator");
|
|
RList<SysDict> rules = redissonClient.getList(DICT_REDIS_KEY + "rule_operator");
|
|
@@ -272,10 +278,10 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
ruleCondition.setMin(value);
|
|
ruleCondition.setMin(value);
|
|
|
}
|
|
}
|
|
|
String attrType = ruleCondition.getAttrType();
|
|
String attrType = ruleCondition.getAttrType();
|
|
|
- if (StringUtils.isNotEmpty(attrType) && java.util.Arrays.stream(COST_TYPE_DICT_KEY).anyMatch(attrType::equals)){
|
|
|
|
|
- if (StringUtils.isNotEmpty(ruleCondition.getMin()) && ruleCondition.getMin().contains(",")){
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(attrType) && java.util.Arrays.stream(COST_TYPE_DICT_KEY).anyMatch(attrType::equals)) {
|
|
|
|
|
+ if (StringUtils.isNotEmpty(ruleCondition.getMin()) && ruleCondition.getMin().contains(",")) {
|
|
|
ruleCondition.setMinArray(Arrays.asList(ruleCondition.getMin().split(",")));
|
|
ruleCondition.setMinArray(Arrays.asList(ruleCondition.getMin().split(",")));
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
ruleCondition.setMinArray(Collections.singletonList(ruleCondition.getMin()));
|
|
ruleCondition.setMinArray(Collections.singletonList(ruleCondition.getMin()));
|
|
|
//ruleCondition.setMinArray(Collections.singletonList(ruleCondition.getMin()));
|
|
//ruleCondition.setMinArray(Collections.singletonList(ruleCondition.getMin()));
|
|
|
}
|
|
}
|
|
@@ -297,21 +303,21 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- private List<PtlAgreementCostVo> queryByAgreementId(CostAgreementParam costAgreementParam){
|
|
|
|
|
|
|
+ private List<PtlAgreementCostVo> queryByAgreementId(CostAgreementParam costAgreementParam) {
|
|
|
return ptlAgreementCostMapper.queryByAgreementId(costAgreementParam);
|
|
return ptlAgreementCostMapper.queryByAgreementId(costAgreementParam);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public HttpResult enableDisableByIds(List<String> ids,Boolean isEnabled) {
|
|
|
|
|
- if (CollectionUtils.isEmpty(ids)){
|
|
|
|
|
|
|
+ public HttpResult enableDisableByIds(List<String> ids, Boolean isEnabled) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(ids)) {
|
|
|
return HttpResult.error("参数不能为空");
|
|
return HttpResult.error("参数不能为空");
|
|
|
}
|
|
}
|
|
|
PtlAgreementCost ptlAgreementCost = new PtlAgreementCost();
|
|
PtlAgreementCost ptlAgreementCost = new PtlAgreementCost();
|
|
|
ptlAgreementCost.setIsEnabled(isEnabled ? 0 : 1);
|
|
ptlAgreementCost.setIsEnabled(isEnabled ? 0 : 1);
|
|
|
ptlAgreementCost.setIsValid(isEnabled ? 0 : 1);
|
|
ptlAgreementCost.setIsValid(isEnabled ? 0 : 1);
|
|
|
- return baseMapper.update(ptlAgreementCost,new LambdaQueryWrapper<>(PtlAgreementCost.class)
|
|
|
|
|
- .in(PtlAgreementCost::getId,ids)) > 0 ?
|
|
|
|
|
|
|
+ return baseMapper.update(ptlAgreementCost, new LambdaQueryWrapper<>(PtlAgreementCost.class)
|
|
|
|
|
+ .in(PtlAgreementCost::getId, ids)) > 0 ?
|
|
|
HttpResult.ok(isEnabled ? "启用成功" : "禁用成功") : HttpResult.error(isEnabled ? "启用失败" : "禁用失败");
|
|
HttpResult.ok(isEnabled ? "启用成功" : "禁用成功") : HttpResult.error(isEnabled ? "启用失败" : "禁用失败");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -319,7 +325,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
public void updateAuditMethod(List<Long> ids) {
|
|
public void updateAuditMethod(List<Long> ids) {
|
|
|
PtlAgreementCost ptlAgreementCost = new PtlAgreementCost();
|
|
PtlAgreementCost ptlAgreementCost = new PtlAgreementCost();
|
|
|
ptlAgreementCost.setAuditMethod(0);
|
|
ptlAgreementCost.setAuditMethod(0);
|
|
|
- baseMapper.update(ptlAgreementCost,new LambdaQueryWrapper<>(PtlAgreementCost.class).in(PtlAgreementCost::getId,ids));
|
|
|
|
|
|
|
+ baseMapper.update(ptlAgreementCost, new LambdaQueryWrapper<>(PtlAgreementCost.class).in(PtlAgreementCost::getId, ids));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -360,9 +366,9 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(isSuccessful) {
|
|
|
|
|
|
|
+ if (isSuccessful) {
|
|
|
return HttpResult.ok("审核成功", costReviewParam.isAutomatic() ? nextDataID() : null);
|
|
return HttpResult.ok("审核成功", costReviewParam.isAutomatic() ? nextDataID() : null);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return HttpResult.ok("驳回成功", costReviewParam.isAutomatic() ? nextDataID() : null);
|
|
return HttpResult.ok("驳回成功", costReviewParam.isAutomatic() ? nextDataID() : null);
|
|
|
}
|
|
}
|
|
|
} catch (SystemException e) {
|
|
} catch (SystemException e) {
|
|
@@ -406,7 +412,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
// LocalDateTime localDateTime = end.plusDays(1).atStartOfDay();
|
|
// LocalDateTime localDateTime = end.plusDays(1).atStartOfDay();
|
|
|
// costParam.setAuditTimeEnd(localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
// costParam.setAuditTimeEnd(localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
// }
|
|
// }
|
|
|
- if(StrUtil.isNotEmpty(costParam.getCompanyId())){
|
|
|
|
|
|
|
+ if (StrUtil.isNotEmpty(costParam.getCompanyId())) {
|
|
|
HttpResult<List<String>> res = esmInsCompanyClient.queryOwnAndSubCompandyIds(costParam.getCompanyId());
|
|
HttpResult<List<String>> res = esmInsCompanyClient.queryOwnAndSubCompandyIds(costParam.getCompanyId());
|
|
|
costParam.setCompanyIdList(res.getData());
|
|
costParam.setCompanyIdList(res.getData());
|
|
|
}
|
|
}
|
|
@@ -415,19 +421,31 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
costParam.setPhones(phones);
|
|
costParam.setPhones(phones);
|
|
|
|
|
|
|
|
Map<String, String> userName2Name = sysUserJzgInfoService.queryUserInfoUserName2Name(baseController.getSystemCode());
|
|
Map<String, String> userName2Name = sysUserJzgInfoService.queryUserInfoUserName2Name(baseController.getSystemCode());
|
|
|
|
|
+ Map<String, String> name2UserName = new HashMap<>(userName2Name);
|
|
|
|
|
+ for (String s : userName2Name.keySet()) {
|
|
|
|
|
+ String name = userName2Name.get(s);
|
|
|
|
|
+ if(!s.equals(name)){
|
|
|
|
|
+ name2UserName.put(name, s);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StrUtil.isNotEmpty(costParam.getAuditPerson())){
|
|
|
|
|
+ String auditPersonPhone = name2UserName.getOrDefault(costParam.getAuditPerson(), costParam.getAuditPerson());
|
|
|
|
|
+ log.info("姓名换汇为手机号。 name=[{}],phone=[{}]",costParam.getAuditPerson(), auditPersonPhone);
|
|
|
|
|
+ costParam.setAuditPerson(auditPersonPhone);
|
|
|
|
|
+ }
|
|
|
Page<CostManagementVo> costManagementVoPage = baseMapper.pageList(costParam.getPage(), costParam);
|
|
Page<CostManagementVo> costManagementVoPage = baseMapper.pageList(costParam.getPage(), costParam);
|
|
|
// 按承保规则属性 sort 正序,重新排列 cost_rules 各段描述
|
|
// 按承保规则属性 sort 正序,重新排列 cost_rules 各段描述
|
|
|
reorderCostRules(costManagementVoPage.getRecords());
|
|
reorderCostRules(costManagementVoPage.getRecords());
|
|
|
- costManagementVoPage.getRecords().forEach(item->{
|
|
|
|
|
- if(item.getCostRules() != null && !item.getCostRules().isEmpty()){
|
|
|
|
|
- item.setCostRules(item.getCostRules().substring(0,item.getCostRules().length()-1));
|
|
|
|
|
|
|
+ costManagementVoPage.getRecords().forEach(item -> {
|
|
|
|
|
+ if (item.getCostRules() != null && !item.getCostRules().isEmpty()) {
|
|
|
|
|
+ item.setCostRules(item.getCostRules().substring(0, item.getCostRules().length() - 1));
|
|
|
}
|
|
}
|
|
|
- if(item.getRuleDescription() != null && !item.getRuleDescription().isEmpty()){
|
|
|
|
|
- item.setRuleDescription(item.getRuleDescription().substring(0,item.getRuleDescription().length()-1));
|
|
|
|
|
|
|
+ if (item.getRuleDescription() != null && !item.getRuleDescription().isEmpty()) {
|
|
|
|
|
+ item.setRuleDescription(item.getRuleDescription().substring(0, item.getRuleDescription().length() - 1));
|
|
|
}
|
|
}
|
|
|
// ruleDescription中出现两个相邻的","或","时,转换为"或"字
|
|
// ruleDescription中出现两个相邻的","或","时,转换为"或"字
|
|
|
item.setRuleDescription(StringUtils.convertAdjacentCommaToOr(item.getRuleDescription()));
|
|
item.setRuleDescription(StringUtils.convertAdjacentCommaToOr(item.getRuleDescription()));
|
|
|
- item.setAuditPersonName(userName2Name.getOrDefault(item.getAuditPerson(),item.getAuditPerson()));
|
|
|
|
|
|
|
+ item.setAuditPersonName(userName2Name.getOrDefault(item.getAuditPerson(), item.getAuditPerson()));
|
|
|
});
|
|
});
|
|
|
return HttpResult.ok(costManagementVoPage);
|
|
return HttpResult.ok(costManagementVoPage);
|
|
|
}
|
|
}
|
|
@@ -499,9 +517,9 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
List<String> newCostId = new ArrayList<>();
|
|
List<String> newCostId = new ArrayList<>();
|
|
|
List<String> costIds = costCopyParam.getCostIds();
|
|
List<String> costIds = costCopyParam.getCostIds();
|
|
|
StringBuilder errMsg = new StringBuilder();
|
|
StringBuilder errMsg = new StringBuilder();
|
|
|
- costIds.forEach(oldCostId-> {
|
|
|
|
|
|
|
+ costIds.forEach(oldCostId -> {
|
|
|
PtlAgreementCost ptlAgreementCost = ptlAgreementCostMapper.selectById(oldCostId);
|
|
PtlAgreementCost ptlAgreementCost = ptlAgreementCostMapper.selectById(oldCostId);
|
|
|
- if(ptlAgreementCost != null){
|
|
|
|
|
|
|
+ if (ptlAgreementCost != null) {
|
|
|
List<PtlAgreementCostType> ptlAgreementCostTypes = ptlAgreementCostTypeMapper.selectList(new LambdaQueryWrapper<PtlAgreementCostType>()
|
|
List<PtlAgreementCostType> ptlAgreementCostTypes = ptlAgreementCostTypeMapper.selectList(new LambdaQueryWrapper<PtlAgreementCostType>()
|
|
|
.eq(PtlAgreementCostType::getPtlAgreementCostId, ptlAgreementCost.getId()));
|
|
.eq(PtlAgreementCostType::getPtlAgreementCostId, ptlAgreementCost.getId()));
|
|
|
List<PtlAgreementCostRule> ptlAgreementCostRules = ptlAgreementCostRuleMapper.selectList(new LambdaQueryWrapper<PtlAgreementCostRule>()
|
|
List<PtlAgreementCostRule> ptlAgreementCostRules = ptlAgreementCostRuleMapper.selectList(new LambdaQueryWrapper<PtlAgreementCostRule>()
|
|
@@ -515,10 +533,10 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
ptlAgreementCost.setCostDescribe(ptlAgreementCost.getCostDescribe());
|
|
ptlAgreementCost.setCostDescribe(ptlAgreementCost.getCostDescribe());
|
|
|
ptlAgreementCost.setCreateTime(LocalDateTime.now());
|
|
ptlAgreementCost.setCreateTime(LocalDateTime.now());
|
|
|
ptlAgreementCost.setUpdateTime(LocalDateTime.now());
|
|
ptlAgreementCost.setUpdateTime(LocalDateTime.now());
|
|
|
- if(costCopyParam.getProductId() != null && !costCopyParam.getProductId().isEmpty()){
|
|
|
|
|
|
|
+ if (costCopyParam.getProductId() != null && !costCopyParam.getProductId().isEmpty()) {
|
|
|
ptlAgreementCost.setProductId(costCopyParam.getProductId());
|
|
ptlAgreementCost.setProductId(costCopyParam.getProductId());
|
|
|
}
|
|
}
|
|
|
- if(costCopyParam.getProductName() != null && !costCopyParam.getProductName().isEmpty()){
|
|
|
|
|
|
|
+ if (costCopyParam.getProductName() != null && !costCopyParam.getProductName().isEmpty()) {
|
|
|
ptlAgreementCost.setProductName(costCopyParam.getProductName());
|
|
ptlAgreementCost.setProductName(costCopyParam.getProductName());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -548,7 +566,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
})
|
|
})
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
- ptlAgreementCostRules.forEach(item->{
|
|
|
|
|
|
|
+ ptlAgreementCostRules.forEach(item -> {
|
|
|
item.setId(IdGenerate.nextId());
|
|
item.setId(IdGenerate.nextId());
|
|
|
item.setPtlAgreementCostId(costId);
|
|
item.setPtlAgreementCostId(costId);
|
|
|
});
|
|
});
|
|
@@ -558,13 +576,13 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
ptlAgreementCostRuleMapper.insert(ptlAgreementCostRules);
|
|
ptlAgreementCostRuleMapper.insert(ptlAgreementCostRules);
|
|
|
newCostId.add(ptlAgreementCost.getId());
|
|
newCostId.add(ptlAgreementCost.getId());
|
|
|
|
|
|
|
|
- }else{
|
|
|
|
|
- errMsg.append("costId为"+oldCostId+"的费用信息已被删除");
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ errMsg.append("costId为" + oldCostId + "的费用信息已被删除");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
- return HttpResult.ok(errMsg.toString(),newCostId);
|
|
|
|
|
|
|
+ return HttpResult.ok(errMsg.toString(), newCostId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -628,6 +646,7 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
? HttpResult.ok("批量修改成功,共修改 " + finalCostIds.size() + " 条记录")
|
|
? HttpResult.ok("批量修改成功,共修改 " + finalCostIds.size() + " 条记录")
|
|
|
: HttpResult.error("批量修改失败");
|
|
: HttpResult.error("批量修改失败");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public HttpResult<String> batchAdjustCostRatio(PtlAgreementCostBatchAdjustParam param) {
|
|
public HttpResult<String> batchAdjustCostRatio(PtlAgreementCostBatchAdjustParam param) {
|