if(t.getNum4() != null && tProjectSystemOutCount.getNum4() != null && t.getNum4().compareTo(tProjectSystemOutCount.getNum4()) > -1){ t.setNum4(ObjUtil.decSub(t.getNum4(), tProjectSystemOutCount.getNum4(), 2)); } else { t.setNum4(BigDecimal.valueOf(0)); }

if(t.getDomestic() != null && tProjectSystemOutCount.getDomestic() != null && t.getDomestic().compareTo(tProjectSystemOutCount.getDomestic()) > -1){ t.setDomestic(ObjUtil.decSub(t.getDomestic(), tProjectSystemOutCount.getDomestic(), 2)); }else { t.setDomestic(BigDecimal.valueOf(0)); }

if(t.getAbroad() != null && tProjectSystemOutCount.getAbroad() != null && t.getAbroad().compareTo(tProjectSystemOutCount.getAbroad()) > -1){ t.setAbroad(ObjUtil.decSub(t.getAbroad(), tProjectSystemOutCount.getAbroad(), 2)); } else { t.setAbroad(BigDecimal.valueOf(0)); }

if(t.getEpc() != null && tProjectSystemOutCount.getEpc() != null && t.getEpc().compareTo(tProjectSystemOutCount.getEpc()) > -1){ t.setEpc(ObjUtil.decSub(t.getEpc(), tProjectSystemOutCount.getEpc(), 2)); }else { t.setEpc(BigDecimal.valueOf(0)); }

if(t.getDesignPurchase() != null && tProjectSystemOutCount.getDesignPurchase() != null && t.getDesignPurchase().compareTo(tProjectSystemOutCount.getDesignPurchase()) > -1){ t.setDesignPurchase(ObjUtil.decSub(t.getDesignPurchase(), tProjectSystemOutCount.getDesignPurchase(), 2)); }else { t.setDesignPurchase(BigDecimal.valueOf(0)); }

if(t.getPurchaseConstruction() != null && tProjectSystemOutCount.getPurchaseConstruction() != null && t.getPurchaseConstruction().compareTo(tProjectSystemOutCount.getPurchaseConstruction()) > -1){ t.setPurchaseConstruction(ObjUtil.decSub(t.getPurchaseConstruction(), tProjectSystemOutCount.getPurchaseConstruction(), 2)); } else { t.setPurchaseConstruction(BigDecimal.valueOf(0)); }

if(t.getDesign() != null && tProjectSystemOutCount.getDesign() != null && t.getDesign().compareTo(tProjectSystemOutCount.getDesign()) > -1){ t.setDesign(ObjUtil.decSub(t.getDesign(), tProjectSystemOutCount.getDesign(), 2)); }else { t.setDesign(BigDecimal.valueOf(0)); }

if(t.getPurchase() != null && tProjectSystemOutCount.getPurchase() != null && t.getPurchase().compareTo(tProjectSystemOutCount.getPurchase()) > -1){ t.setPurchase(ObjUtil.decSub(t.getPurchase(), tProjectSystemOutCount.getPurchase(), 2)); }else { t.setPurchase(BigDecimal.valueOf(0)); }

if(t.getConstruction() != null && tProjectSystemOutCount.getConstruction() != null && t.getConstruction().compareTo(tProjectSystemOutCount.getConstruction()) > -1){ t.setConstruction(ObjUtil.decSub(t.getConstruction(), tProjectSystemOutCount.getConstruction(), 2)); } else { t.setConstruction(BigDecimal.valueOf(0)); }

if(t.getConsultation() != null && tProjectSystemOutCount.getConsultation() != null && t.getConsultation().compareTo(tProjectSystemOutCount.getConsultation()) > -1){ t.setConsultation(ObjUtil.decSub(t.getConsultation(), tProjectSystemOutCount.getConsultation(), 2)); }else { t.setConsultation(BigDecimal.valueOf(0)); }

if(t.getSurvey() != null && tProjectSystemOutCount.getSurvey() != null && t.getSurvey().compareTo(tProjectSystemOutCount.getSurvey()) > -1){ t.setSurvey(ObjUtil.decSub(t.getSurvey(), tProjectSystemOutCount.getSurvey(), 2)); }else { t.setSurvey(BigDecimal.valueOf(0)); }

if(t.getSupervision() != null && tProjectSystemOutCount.getSupervision() != null && t.getSupervision().compareTo(tProjectSystemOutCount.getSupervision()) > -1){ t.setSupervision(ObjUtil.decSub(t.getSupervision(), tProjectSystemOutCount.getSupervision(), 2)); } else { t.setSupervision(BigDecimal.valueOf(0)); }

if(t.getNdt() != null && tProjectSystemOutCount.getNdt() != null && t.getNdt().compareTo(tProjectSystemOutCount.getNdt()) > -1){ t.setNdt(ObjUtil.decSub(t.getNdt(), tProjectSystemOutCount.getNdt(), 2)); }else { t.setNdt(BigDecimal.valueOf(0)); }

Java 代码优化:添加非空判断以确保安全计算

原文地址: https://www.cveoy.top/t/topic/olSS 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录