Преглед изворни кода

现询协议排除0的费用

785834757 пре 2 година
родитељ
комит
8b1283633c

+ 20 - 1
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -5,6 +5,7 @@ import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.service.SysUserService;
@@ -1880,6 +1881,24 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         }
         queryWrapper.eq(PtlAgreementProductCostsNew::getIsAudit,"1");
         queryWrapper.eq(PtlAgreementProductCostsNew::getIsInquiryNow,"0");
-        return baseMapper.selectList(queryWrapper);
+        List<PtlAgreementProductCostsNew> ptlAgreementProductCostsNews = baseMapper.selectList(queryWrapper);
+
+        ptlAgreementProductCostsNews.forEach(item->{
+            if(item.getProductId().equals(ProductsType.PT_0330.getCode())){
+                if(item.getSyCostsProportion().equals("0")){
+                    item.setSyCostsProportion(null);
+                }
+
+            }else if(item.getProductId().equals(ProductsType.PT_034002.getCode()) || item.getProductId().equals(ProductsType.PT_034001.getCode())){
+                if(item.getJqCostsProportion().equals("0")){
+                    item.setJqCostsProportion(null);
+                }
+            }
+            if(item.getNoCarCostsProportion().equals("0")){
+                item.setNoCostsProportion(null);
+            }
+        });
+
+        return ptlAgreementProductCostsNews;
     }
 }