From 1c3af4bc2b94fb1ccabbce1d50000f47b4fc4f69 Mon Sep 17 00:00:00 2001 From: dimengzhe <251008545@qq.com> Date: Fri, 21 Apr 2023 11:19:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/order/AppOrderPriceInfoVo.java | 19 ++++ .../bussalesorder/BusSalesOrderService.java | 104 +++++++++++++++++- .../portal/api/flow/app/FlowTaskFinishVo.java | 5 + .../portal/biz/flow/FlowableService.java | 1 + .../saleOrders/order/OrderPriceInfoVo.java | 18 ++- 5 files changed, 142 insertions(+), 5 deletions(-) diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/app/order/AppOrderPriceInfoVo.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/app/order/AppOrderPriceInfoVo.java index 4c6d989d30..5f8a88ca89 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/app/order/AppOrderPriceInfoVo.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/app/order/AppOrderPriceInfoVo.java @@ -35,4 +35,23 @@ public class AppOrderPriceInfoVo implements Vo { @ApiModelProperty("xx日期限内") private String payDepositDays; + + + @ApiModelProperty("挂车价格") + private String gcPrice; + @ApiModelProperty("上装价格") + private String szPrice; + @ApiModelProperty("价格折让(元/台)") + private String priceDiscount; + @ApiModelProperty("中介返利(元/台)") + private String zjReturnPrice; + @ApiModelProperty("优惠套餐(元/台)") + private String pkgPrice; + @ApiModelProperty("实际成交价(元/台)") + private String realPrice; + @ApiModelProperty("差额") + private String diffPrice; + + + } diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java index 6e9b6efffb..d73b2dcf33 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java @@ -2802,6 +2802,24 @@ public class BusSalesOrderService extends MybatisBaseService solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(sid); + SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData(); + if (solutionsDetailsVo != null) { + if (StringUtils.isNotBlank(solutionsDetailsVo.getTypeKey())) { + if (!"02".equals(solutionsDetailsVo.getTypeKey())) { + //判断实收和单台订金 + if(new BigDecimal(solutionsDetailsVo.getRealTotal()).compareTo(busSalesOrderDeposit.getDeposit())<0){ + return rb.setMsg("金融方案中实收金额小于单台订金"); + } + } + } else {//担保贷款 + return rb.setMsg("金融方案中实收金额小于单台订金"); + } + } + } return rb.success(); } @@ -3178,6 +3196,7 @@ public class BusSalesOrderService extends MybatisBaseService0){ + //如果中介返利小于0,乘以-1 + zjAll = zjAll.multiply(new BigDecimal(-1)); + zjReturnPrice = "-¥"+zjAll.toString(); + }else{ + zjReturnPrice = "¥"+zjAll.toString(); + } + priceInfo.setZjReturnPrice(zjReturnPrice); + } + } //计算单台折让 BigDecimal bigDecimalSing = new BigDecimal("0"); @@ -3330,8 +3366,14 @@ public class BusSalesOrderService extends MybatisBaseService stringList = new ArrayList<>(); if (!list.isEmpty()) { - for (BusDepositFictitiousDetailsVo v : list) { - String b = "编号为" + v.getDepositBillNo() + "简易订单订金转入" + v.getPrice() + "元,"; + for (int j = 0;j payPathList = Arrays.asList(v.getPayPath().split(",")); @@ -3340,7 +3382,7 @@ public class BusSalesOrderService extends MybatisBaseService solutionsDetailsVoResultBean = loanSolutionsFeign.selectDetailss(sid); + List list = new ArrayList<>(); + if (solutionsDetailsVoResultBean.getData() != null) { + SolutionsDetailsVo solutionsDetailsVo = solutionsDetailsVoResultBean.getData(); + //挂车 + if (StringUtils.isNotBlank(solutionsDetailsVo.getTrailerAmount())) { + if(priceInfo != null){ + priceInfo.setGcPrice(solutionsDetailsVo.getTrailerAmount()); + } + }else{ + priceInfo.setGcPrice("¥0"); + } + + } + + if(priceInfo != null){ + priceInfo.setSzPrice(topPriice); + //价格折让 = 销售合同价(整体成交价)-销售指导价(整体指导价) + //销售合同价-销售指导价 + BigDecimal all = new BigDecimal(priceInfo.getSingleFinalPrice()).subtract(new BigDecimal(priceInfo.getSingleGuildPrice())); + String priceAll = ""; + if(all.compareTo(BigDecimal.ZERO) <0){ + //如果价格折让小于0,乘以-1 + all = all.multiply(new BigDecimal(-1)); + priceAll = "-¥"+all.toString(); + }else{ + priceAll = "¥"+all.toString(); + } + priceInfo.setPriceDiscount(priceAll); + //优惠套餐 = 优惠套餐总额/台数(保留到个位) + String pkgPrice = ""; + BigDecimal oneAll = BigDecimal.ZERO; + if(StringUtils.isNotBlank(vo.getTotaldiscount())){ + //总优惠/台数 + oneAll = new BigDecimal(vo.getTotaldiscount()).divide(new BigDecimal(priceInfo.getNumber())); + if(oneAll.compareTo(BigDecimal.ZERO) >0){ + //如果小于0,乘以-1 + oneAll = oneAll.multiply(new BigDecimal(-1)); + pkgPrice = "-¥"+oneAll.toString(); + }else{ + pkgPrice = "¥"+oneAll.toString(); + } + priceInfo.setPkgPrice(pkgPrice); + } + //实际成交 = 销售指导价-价格折让-中介返利-优惠套餐 + BigDecimal realAll = BigDecimal.ZERO; + realAll = realAll.add(new BigDecimal(priceInfo.getSingleGuildPrice())).add(all).add(zjAll.multiply(new BigDecimal(-1))).add(oneAll.multiply(new BigDecimal(-1))); + priceInfo.setRealPrice("¥"+realAll.toString()); + //差额 = 实际成交价-销售指导价 + BigDecimal diffAll = BigDecimal.ZERO; + diffAll = realAll.subtract(new BigDecimal(priceInfo.getSingleGuildPrice())); + priceInfo.setDiffPrice(diffAll.toString()); + } + return rb.success().setData(vo); } diff --git a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/flow/app/FlowTaskFinishVo.java b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/flow/app/FlowTaskFinishVo.java index 75f58cc4c6..bb90bf54be 100644 --- a/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/flow/app/FlowTaskFinishVo.java +++ b/anrui-portal/anrui-portal-api/src/main/java/com/yxt/anrui/portal/api/flow/app/FlowTaskFinishVo.java @@ -59,4 +59,9 @@ public class FlowTaskFinishVo implements Vo { @ApiModelProperty("流程名称") private String flowableName; + @ApiModelProperty("业务sid") + private String businessSid; + @ApiModelProperty("发起人sid") + @JsonProperty("createUserSid") + private String startUserSid; } diff --git a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/flow/FlowableService.java b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/flow/FlowableService.java index 72a9429b8c..3fa97492e4 100644 --- a/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/flow/FlowableService.java +++ b/anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/flow/FlowableService.java @@ -656,6 +656,7 @@ public class FlowableService extends MybatisBaseService flowMap = f.getProcessVariables(); + f.setBusinessSid(flowMap.get("businessSid").toString()); Map appMap = ConstantUtils.getMap(flowMap, "app"); String json = JSONObject.toJSONString(appMap); AppVo appVo = new AppVo(); diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/saleOrders/order/OrderPriceInfoVo.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/saleOrders/order/OrderPriceInfoVo.java index df2714df2f..553ebea718 100644 --- a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/saleOrders/order/OrderPriceInfoVo.java +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/saleOrders/order/OrderPriceInfoVo.java @@ -31,7 +31,21 @@ public class OrderPriceInfoVo implements Vo { @ApiModelProperty("单台整体成交价") @JsonProperty("overallPrice") private String singleFinalPrice; - - //单车折让 + @ApiModelProperty("单车折让") private String singleCarDiscountPrice; + + @ApiModelProperty("挂车价格") + private String gcPrice; + @ApiModelProperty("上装价格") + private String szPrice; + @ApiModelProperty("价格折让(元/台)") + private String priceDiscount; + @ApiModelProperty("中介返利(元/台)") + private String zjReturnPrice; + @ApiModelProperty("优惠套餐(元/台)") + private String pkgPrice; + @ApiModelProperty("实际成交价(元/台)") + private String realPrice; + @ApiModelProperty("差额") + private String diffPrice; }