|
|
@ -151,8 +151,13 @@ import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.app.AppUserOrgInfoVo; |
|
|
|
import com.yxt.anrui.portal.config.DictCommonType; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.LoanSolutions; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.LoanSolutionsFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutions.app.SolutionsDetailsVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutionsdetail.LoanSolutionsDetail; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutionsdetail.LoanSolutionsDetailFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutionsotherpolicy.LoanSolutionsOtherpolicy; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansolutionsotherpolicy.LoanSolutionsOtherpolicyFeign; |
|
|
|
import com.yxt.anrui.scm.api.scmwarehouse.ScmWarehouseFeign; |
|
|
|
import com.yxt.anrui.scm.api.scmwarehouse.ScmWarehouseVo; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
@ -296,6 +301,11 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
private FinCompanyInvoicingFeign finCompanyInvoicingFeign; |
|
|
|
@Autowired |
|
|
|
private BusArrearsCarryVehicleApplyService busArrearsCarryVehicleApplyService; |
|
|
|
@Autowired |
|
|
|
private LoanSolutionsDetailFeign loanSolutionsDetailFeign; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private LoanSolutionsOtherpolicyFeign loanSolutionsOtherpolicyFeign; |
|
|
|
|
|
|
|
/** |
|
|
|
* 构造查询条件 |
|
|
@ -537,7 +547,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(totalValue.toString())) { |
|
|
|
if (busSalesOrderPriceDetailsVo != null) { |
|
|
|
BigDecimal discountA = totalValue.divide(new BigDecimal(busSalesOrderPriceDetailsVo.getQuantity())); |
|
|
|
BigDecimal discountA = totalValue.divide(new BigDecimal(busSalesOrderPriceDetailsVo.getQuantity()),BigDecimal.ROUND_CEILING); |
|
|
|
bigDecimalSing = bigDecimalSing.add(discountA); |
|
|
|
} |
|
|
|
} |
|
|
@ -3371,7 +3381,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(vo.getTotaldiscount())) { |
|
|
|
if (priceInfo != null) { |
|
|
|
BigDecimal discountA = new BigDecimal(vo.getTotaldiscount()).divide(new BigDecimal(priceInfo.getNumber())); |
|
|
|
BigDecimal discountA = new BigDecimal(vo.getTotaldiscount()).divide(new BigDecimal(priceInfo.getNumber()),BigDecimal.ROUND_CEILING); |
|
|
|
bigDecimalSing = bigDecimalSing.add(discountA); |
|
|
|
} |
|
|
|
} |
|
|
@ -3482,7 +3492,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
BigDecimal oneAll = BigDecimal.ZERO; |
|
|
|
if (StringUtils.isNotBlank(vo.getTotaldiscount())) { |
|
|
|
//总优惠/台数
|
|
|
|
oneAll = new BigDecimal(vo.getTotaldiscount()).divide(new BigDecimal(priceInfo.getNumber())); |
|
|
|
oneAll = new BigDecimal(vo.getTotaldiscount()).divide(new BigDecimal(priceInfo.getNumber()),BigDecimal.ROUND_CEILING); |
|
|
|
if (oneAll.compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
pkgPrice = "-¥" + oneAll.toString(); |
|
|
|
} else { |
|
|
@ -4769,6 +4779,15 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
//更新临时号
|
|
|
|
ResultBean busSalesOrderResultBean = busSalesOrderVehicleService.updateTemporaryNo(salesOrderVinSid, temporaryNo); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
for (int i = 0; i < vinList.size(); i++) { |
|
|
|
//销售订单中车辆表的sid
|
|
|
|
String salesOrderVinSid = vinList.get(i).getSid(); |
|
|
|
String temporaryNum = String.format("%02d", i + 1); |
|
|
|
//更新临时号
|
|
|
|
ResultBean busSalesOrderResultBean = busSalesOrderVehicleService.updateTemporaryNo(salesOrderVinSid, temporaryNum); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//查询是否是结转金额,如果是,则订金金额为补交金额/台数。若为现金则为单台订金
|
|
|
|
String key = depositInfo.getDepositTypeKey(); |
|
|
@ -4776,7 +4795,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
if ("02".equals(key)) { |
|
|
|
String makeUpAll = depositInfo.getMakeUpDeposit(); |
|
|
|
if (makeUpAll != null) { |
|
|
|
bigDecimalKeyAll = bigDecimalKeyAll.add(new BigDecimal(makeUpAll).divide(new BigDecimal(num))); |
|
|
|
bigDecimalKeyAll = bigDecimalKeyAll.add(new BigDecimal(makeUpAll).divide(new BigDecimal(num),BigDecimal.ROUND_CEILING)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
bigDecimalKeyAll = bigDecimalKeyAll.add(new BigDecimal(depositInfo.getDeposit())); |
|
|
@ -5708,7 +5727,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
String totaldiscount = appOrderDetailsVo.getTotaldiscount(); |
|
|
|
if (StringUtils.isNotBlank(totaldiscount)) { |
|
|
|
//计算单台优惠
|
|
|
|
BigDecimal bigDecimal = new BigDecimal(totaldiscount).divide(new BigDecimal(total)); |
|
|
|
BigDecimal bigDecimal = new BigDecimal(totaldiscount).divide(new BigDecimal(total),BigDecimal.ROUND_CEILING); |
|
|
|
busSaleOrderVehicleOutVo.setTotaldiscount(bigDecimal.toString()); |
|
|
|
//赠送情况
|
|
|
|
List<AppOrderDiscountListVo> discountList = appOrderDetailsVo.getDiscountList(); |
|
|
@ -6078,7 +6097,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean<String> rePublishSaleOrder(String saleOrderSid) throws InvocationTargetException, IllegalAccessException { |
|
|
|
public ResultBean rePublishSaleOrder(String saleOrderSid) throws InvocationTargetException, IllegalAccessException { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String newSalesOrderSid = ""; |
|
|
|
boolean saleOrderSave = false; |
|
|
@ -6288,8 +6307,63 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 项目金额方案单车
|
|
|
|
List<LoanSolutions> loanSolutionsList = loanSolutionsFeign.selectByOrderSid(saleOrderSid).getData(); |
|
|
|
if (null != loanSolutionsList) { |
|
|
|
for (LoanSolutions loanSolutions : loanSolutionsList) { |
|
|
|
if (null != loanSolutions) { |
|
|
|
LoanSolutions newObject = new LoanSolutions(); |
|
|
|
String sid = newObject.getSid(); |
|
|
|
Date createTime = newObject.getCreateTime(); |
|
|
|
Date modifyTime = newObject.getModifyTime(); |
|
|
|
BeanUtils.copyProperties(newObject, loanSolutions); |
|
|
|
newObject.setSid(sid); |
|
|
|
newObject.setCreateTime(createTime); |
|
|
|
newObject.setModifyTime(modifyTime); |
|
|
|
newObject.setSalesOrderSid(newSalesOrderSid); |
|
|
|
loanSolutionsFeign.saveByOrderSid(newObject); |
|
|
|
//金融方案表(费用明细)
|
|
|
|
List<LoanSolutionsDetail> data = loanSolutionsDetailFeign.fetchListBySid(loanSolutions.getSid()).getData(); |
|
|
|
if (null != data) { |
|
|
|
for (LoanSolutionsDetail detail : data) { |
|
|
|
if (null != detail) { |
|
|
|
LoanSolutionsDetail newDetail = new LoanSolutionsDetail(); |
|
|
|
String newDetailSid = newDetail.getSid(); |
|
|
|
Date newDetailCreateTime = newDetail.getCreateTime(); |
|
|
|
Date newDetailModifyTime = newDetail.getModifyTime(); |
|
|
|
BeanUtils.copyProperties(newDetail, detail); |
|
|
|
newDetail.setSid(newDetailSid); |
|
|
|
newDetail.setCreateTime(newDetailCreateTime); |
|
|
|
newDetail.setModifyTime(newDetailModifyTime); |
|
|
|
newDetail.setSolutionsSid(sid); |
|
|
|
loanSolutionsDetailFeign.save(newDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//金融方案表(其它融)
|
|
|
|
List<LoanSolutionsOtherpolicy> otherpolicyList = loanSolutionsOtherpolicyFeign.fetchListBySid(loanSolutions.getSid()).getData(); |
|
|
|
if (null != otherpolicyList) { |
|
|
|
for (LoanSolutionsOtherpolicy otherpolicy : otherpolicyList) { |
|
|
|
if (null != otherpolicy) { |
|
|
|
LoanSolutionsOtherpolicy newOtherpolicy = new LoanSolutionsOtherpolicy(); |
|
|
|
String newSid = newOtherpolicy.getSid(); |
|
|
|
Date newCreateTime = newOtherpolicy.getCreateTime(); |
|
|
|
Date newModifyTime = newOtherpolicy.getModifyTime(); |
|
|
|
BeanUtils.copyProperties(newOtherpolicy, otherpolicy); |
|
|
|
newOtherpolicy.setSid(newSid); |
|
|
|
newOtherpolicy.setCreateTime(newCreateTime); |
|
|
|
newOtherpolicy.setModifyTime(newModifyTime); |
|
|
|
newOtherpolicy.setSolutionsSid(sid); |
|
|
|
loanSolutionsOtherpolicyFeign.save(newOtherpolicy); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (saleOrderSave) { |
|
|
|
return rb.success().setMsg("重新发起成功,请在待办理列表进行修改提交。"); |
|
|
|
// return rb.success().setMsg("重新发起成功,请在待办理列表进行修改提交。");
|
|
|
|
return rb.success().setData(newSalesOrderSid).setMsg("重新发起成功,请在待办理列表进行修改提交。"); |
|
|
|
} else { |
|
|
|
return rb.success().setMsg("重新发起失败"); |
|
|
|
} |
|
|
|