| | |
| | | double estimateMileage = (null == orderPrivateCar.getEstimateMileage() ? 0D : orderPrivateCar.getEstimateMileage()); |
| | | System.out.println("预估里程数"+estimateMileage); |
| | | //在价格区间按照一口价算,不在区间按实时价格算 |
| | | if(d<estimateMileage+contentPrice.getDouble("num29")*1000 && d>estimateMileage-contentPrice.getDouble("num32")*1000){ |
| | | if(d<estimateMileage+contentPrice.getDouble("exceedMileageInner")*1000 && d>estimateMileage-contentPrice.getDouble("belowMileageInner")*1000){ |
| | | System.out.println("在区间==============="); |
| | | orderPrivateCar = calculationPrice1(orderPrivateCar,contentPrice,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPrice,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | System.out.println("返回订单数据"+orderPrivateCar); |
| | | }else{ |
| | | System.out.println("不在区间===================="); |
| | |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | /** |
| | | * 超过预估里程多少公里以内,按一口价计算 |
| | | */ |
| | | @TableField("exceedMileageInner") |
| | | private String exceedMileageInner; |
| | | |
| | | /** |
| | | * 超过预估里程多少公里以上,按实时价计算 |
| | | */ |
| | | @TableField("exceedMileageOut") |
| | | private String exceedMileageOut; |
| | | |
| | | /** |
| | | * 低于预估里程多少公里以上,按实时价计算 |
| | | */ |
| | | @TableField("belowMileageOut") |
| | | private String belowMileageOut; |
| | | |
| | | /** |
| | | * 低于预估里程多少公里以内,按一口价计算 |
| | | */ |
| | | @TableField("belowMileageInner") |
| | | private String belowMileageInner; |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | |
| | | this.serverCarModelId = serverCarModelId; |
| | | } |
| | | |
| | | public String getExceedMileageInner() { |
| | | return exceedMileageInner; |
| | | } |
| | | |
| | | public void setExceedMileageInner(String exceedMileageInner) { |
| | | this.exceedMileageInner = exceedMileageInner; |
| | | } |
| | | |
| | | public String getExceedMileageOut() { |
| | | return exceedMileageOut; |
| | | } |
| | | |
| | | public void setExceedMileageOut(String exceedMileageOut) { |
| | | this.exceedMileageOut = exceedMileageOut; |
| | | } |
| | | |
| | | public String getBelowMileageOut() { |
| | | return belowMileageOut; |
| | | } |
| | | |
| | | public void setBelowMileageOut(String belowMileageOut) { |
| | | this.belowMileageOut = belowMileageOut; |
| | | } |
| | | |
| | | public String getBelowMileageInner() { |
| | | return belowMileageInner; |
| | | } |
| | | |
| | | public void setBelowMileageInner(String belowMileageInner) { |
| | | this.belowMileageInner = belowMileageInner; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "SystemPrice{" + |
| | |
| | | ", companyId=" + companyId + |
| | | ", serverCarModelId=" + serverCarModelId + |
| | | ", content='" + content + '\'' + |
| | | ", exceedMileageInner='" + exceedMileageInner + '\'' + |
| | | ", exceedMileageOut='" + exceedMileageOut + '\'' + |
| | | ", belowMileageOut='" + belowMileageOut + '\'' + |
| | | ", belowMileageInner='" + belowMileageInner + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | model.addAttribute("contentNotThree", null); |
| | | model.addAttribute("contentExclusive", null); |
| | | model.addAttribute("contentPrice", null); |
| | | model.addAttribute("exceedMileageInner", null); |
| | | model.addAttribute("exceedMileageOut", null); |
| | | model.addAttribute("belowMileageOut", null); |
| | | model.addAttribute("belowMileageInner", null); |
| | | if(ToolUtil.isNotEmpty(price)){ |
| | | String s = Base64.decodeStr(price); |
| | | TSystemPrice tSystemPrice = JSON.parseObject(s, TSystemPrice.class); |
| | |
| | | model.addAttribute("contentNotThree", JSONObject.fromObject(tSystemPrice.getContentNotThree())); |
| | | model.addAttribute("contentExclusive", JSONObject.fromObject(tSystemPrice.getContentExclusive())); |
| | | model.addAttribute("contentPrice", JSONObject.fromObject(tSystemPrice.getContentPrice())); |
| | | model.addAttribute("exceedMileageInner", tSystemPrice.getExceedMileageInner()); |
| | | model.addAttribute("exceedMileageOut", tSystemPrice.getExceedMileageOut()); |
| | | model.addAttribute("belowMileageOut", tSystemPrice.getBelowMileageOut()); |
| | | model.addAttribute("belowMileageInner", tSystemPrice.getBelowMileageInner()); |
| | | } |
| | | |
| | | TServerCarmodel tServerCarmodel = tServerCarmodelService.selectById(id); |
| | |
| | | model.addAttribute("contentNotThree", JSONObject.fromObject(tSystemPrice.getContentNotThree())); |
| | | model.addAttribute("contentExclusive", JSONObject.fromObject(tSystemPrice.getContentExclusive())); |
| | | model.addAttribute("contentPrice", JSONObject.fromObject(tSystemPrice.getContentPrice())); |
| | | model.addAttribute("exceedMileageInner", tSystemPrice.getExceedMileageInner()); |
| | | model.addAttribute("exceedMileageOut", tSystemPrice.getExceedMileageOut()); |
| | | model.addAttribute("belowMileageOut", tSystemPrice.getBelowMileageOut()); |
| | | model.addAttribute("belowMileageInner", tSystemPrice.getBelowMileageInner()); |
| | | |
| | | //查询所有快车车型 |
| | | List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", ShiroKit.getUser().getObjectId()).ne("state", 3)); |
| | |
| | | @TableField("isOpenPrice") |
| | | private Integer isOpenPrice; |
| | | |
| | | /** |
| | | * 超过预估里程多少公里以内,按一口价计算 |
| | | */ |
| | | @TableField("exceedMileageInner") |
| | | private String exceedMileageInner; |
| | | |
| | | /** |
| | | * 超过预估里程多少公里以上,按实时价计算 |
| | | */ |
| | | @TableField("exceedMileageOut") |
| | | private String exceedMileageOut; |
| | | |
| | | /** |
| | | * 低于预估里程多少公里以上,按实时价计算 |
| | | */ |
| | | @TableField("belowMileageOut") |
| | | private String belowMileageOut; |
| | | |
| | | /** |
| | | * 低于预估里程多少公里以内,按一口价计算 |
| | | */ |
| | | @TableField("belowMileageInner") |
| | | private String belowMileageInner; |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | |
| | | public Integer getServerCarModelId() { |
| | | return serverCarModelId; |
| | | } |
| | | |
| | | |
| | | public String getExceedMileageInner() { |
| | | return exceedMileageInner; |
| | | } |
| | | |
| | | public void setExceedMileageInner(String exceedMileageInner) { |
| | | this.exceedMileageInner = exceedMileageInner; |
| | | } |
| | | |
| | | public String getExceedMileageOut() { |
| | | return exceedMileageOut; |
| | | } |
| | | |
| | | public void setExceedMileageOut(String exceedMileageOut) { |
| | | this.exceedMileageOut = exceedMileageOut; |
| | | } |
| | | |
| | | public String getBelowMileageOut() { |
| | | return belowMileageOut; |
| | | } |
| | | |
| | | public void setBelowMileageOut(String belowMileageOut) { |
| | | this.belowMileageOut = belowMileageOut; |
| | | } |
| | | |
| | | public String getBelowMileageInner() { |
| | | return belowMileageInner; |
| | | } |
| | | |
| | | public void setBelowMileageInner(String belowMileageInner) { |
| | | this.belowMileageInner = belowMileageInner; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | return "TSystemPrice{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", systemPriceCityId=" + systemPriceCityId + |
| | | ", serverCarModelId=" + serverCarModelId + |
| | | ", content='" + content + '\'' + |
| | | ", fareTypeNote1='" + fareTypeNote1 + '\'' + |
| | |
| | | ", isOpen=" + isOpen + |
| | | ", isOpenExclusive=" + isOpenExclusive + |
| | | ", isOpenPrice=" + isOpenPrice + |
| | | ", exceedMileageInner='" + exceedMileageInner + '\'' + |
| | | ", exceedMileageOut='" + exceedMileageOut + '\'' + |
| | | ", belowMileageOut='" + belowMileageOut + '\'' + |
| | | ", belowMileageInner='" + belowMileageInner + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | <br/> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">超过预估里程设置:</label> |
| | | <div class="col-sm-10"> |
| | | 超过预估里程 <input type="text" onblur="checkIsYuan(this)" name="exceedMileageInner" id="exceedMileageInner" value="${null != exceedMileageInner ? exceedMileageInner : ''}" class="form-control newWidth" placeholder="最多3位数"/> 公里以内,按一口价计算 |
| | | <br> |
| | | <br> |
| | | 超过预估里程 <input type="text" onblur="checkIsYuan(this)" name="exceedMileageOut" id="exceedMileageOut" value="${null != exceedMileageOut ? exceedMileageOut : ''}" class="form-control newWidth" placeholder="最多3位数"/> 公里以上,按实时计价计算 |
| | | <br> |
| | | <br> |
| | | 低于预估里程 <input type="text" onblur="checkIsYuan(this)" name="belowMileageOut" id="belowMileageOut" value="${null != belowMileageOut ? belowMileageOut : ''}" class="form-control newWidth" placeholder="最多3位数"/> 公里以上,按实时计价计算 |
| | | <br> |
| | | <br> |
| | | 低于预估里程 <input type="text" onblur="checkIsYuan(this)" name="belowMileageInner" id="belowMileageInner" value="${null != belowMileageInner ? belowMileageInner : ''}" class="form-control newWidth" placeholder="最多3位数"/> 公里以内,按一口价计算 |
| | | <br> |
| | | <br> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group p8"> |
| | | <input type="hidden" id="numFlag8" name="numFlag8" value="20"> |
| | | <input type="hidden" id="numFlag8" name="numFlag8" value="13"> |
| | | <!-- 时段价格表 --> |
| | | <table class="table table-bordered"> |
| | | <thead> |
| | |
| | | return |
| | | } |
| | | |
| | | |
| | | let exceedMileageInner = $('#exceedMileageInner').val(); // 超过预估里程设置 |
| | | let exceedMileageOut = $('#exceedMileageOut').val(); // 超过预估里程设置 |
| | | let belowMileageOut = $('#belowMileageOut').val(); // 超过预估里程设置 |
| | | let belowMileageInner = $('#belowMileageInner').val(); // 超过预估里程设置 |
| | | |
| | | var contentPrice = '{'; |
| | | //拼接数据 |
| | | $(".onePriceSetting input[type='text']").each(function(){ |
| | | var value = $(this).val(); |
| | | var name = this.name; |
| | | if('' == value){ |
| | | b = true; |
| | | Feng.info("请填写完整配置"); |
| | | return |
| | | } |
| | | contentPrice = contentPrice + '"'+$(this)[0].name+'":"'+value+'",'; |
| | | // 排除“超过预估里程设置” |
| | | var excludeFields = ["exceedMileageInner", "exceedMileageOut", "belowMileageOut", "belowMileageInner"]; |
| | | if(excludeFields.indexOf(name) === -1) { // 一口价设置值时排出 超过预估里程设置 |
| | | contentPrice = contentPrice + '"'+$(this)[0].name+'":"'+value+'",'; |
| | | } |
| | | }); |
| | | contentPrice = contentPrice.substring(0,contentPrice.length-1); |
| | | contentPrice += '}'; |
| | |
| | | contentPrice: contentPrice, |
| | | isOpen: isOpen, |
| | | isOpenExclusive: isOpenExclusive, |
| | | isOpenPrice: isOpenPrice |
| | | isOpenPrice: isOpenPrice, |
| | | exceedMileageInner: exceedMileageInner, |
| | | exceedMileageOut: exceedMileageOut, |
| | | belowMileageOut: belowMileageOut, |
| | | belowMileageInner: belowMileageInner |
| | | }; |
| | | window.parent.document.getElementById(serverCarModelId).value = btoa(JSON.stringify(jsonStr)); |
| | | window.parent.document.getElementById("zc_status_" + serverCarModelId).innerText = "已设置"; |