|
|
@ -58,6 +58,8 @@ import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.portal.config.DictCommonType; |
|
|
|
import com.yxt.anrui.scm.api.scmwarehouse.ScmWarehouseFeign; |
|
|
|
import com.yxt.anrui.scm.api.scmwarehouse.ScmWarehouseVo; |
|
|
|
import com.yxt.common.base.config.component.DocPdfComponent; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
@ -166,6 +168,8 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
private BasePurchaseSystemService basePurchaseSystemService; |
|
|
|
@Autowired |
|
|
|
private BaseModelConfigService baseModelConfigService; |
|
|
|
@Autowired |
|
|
|
private ScmWarehouseFeign scmWarehouseFeign; |
|
|
|
|
|
|
|
private QueryWrapper<CommonContract> createQueryWrapper(CommonContractQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
@ -778,14 +782,14 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "主车" + num + "台,单台成交价:" + transactionPrice + "元。车架号:" + String.join("、", stringList); |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
|
remarks = "主车" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
//获取模板
|
|
|
|
ftl = "orderacar"; |
|
|
|
remarks = "主车" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
|
|
|
@ -821,14 +825,14 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "主车" + num + "台,单台成交价:" + transactionPrice + "元。车架号:" + String.join("、", stringList); |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
|
remarks = "主车" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
//获取模板
|
|
|
|
ftl = "orderacar"; |
|
|
|
remarks = "主车" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
remarks = "数量" + num + "台,单台成交价:" + transactionPrice + "元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
|
|
|
@ -850,36 +854,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
return pdfName; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 生成 新车买卖合同(现车) (空)pdf |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @param map |
|
|
|
* @param appOrderDetailsVo |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
/*private String genCarSaleContractBlank(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
String typeName = ""; |
|
|
|
String docName = ""; |
|
|
|
map.put("totalPrice", ""); |
|
|
|
map.put("priceRemarks", ""); |
|
|
|
map.put("depositTotal", ""); |
|
|
|
// 涉及高低开票的,需要打印两套合同,一套按照成交价打印(记账用),一套为价格空白的合同(开票用)
|
|
|
|
if ("1".equals(dto.getDiscountKey())) { |
|
|
|
// 现车
|
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
typeName = ContractTemplateEnum.CARSALECONTRACTNEWBLANK.getName(); |
|
|
|
} else { |
|
|
|
// 订车
|
|
|
|
typeName = ContractTemplateEnum.CARSALECONTRACTBOOKBLANK.getName(); |
|
|
|
} |
|
|
|
docName = typeName + "(" + appOrderDetailsVo.getName() + ").doc"; |
|
|
|
Map<String, String> map2 = docPdfComponent.createDocToPdf(map, typeName, docName); |
|
|
|
url += map2.get("prefixTemplateUrl"); |
|
|
|
} |
|
|
|
return url; |
|
|
|
}*/ |
|
|
|
private String genCarSaleContractBlank(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
map.put("totalPrice", ""); |
|
|
@ -899,14 +873,14 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "主车" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList); |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
|
remarks = "主车" + num + "台,单台成交价: 元。"; |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 订车获取模板
|
|
|
|
ftl = "orderacar_black"; |
|
|
|
remarks = "主车" + num + "台,单台成交价: 元。"; |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
@ -948,14 +922,14 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
List<String> stringList = orderModelInfoVo.getOrderVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
remarks = "主车" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList); |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。车架号:" + String.join("、", stringList); |
|
|
|
} else { |
|
|
|
remarks = "主车" + num + "台,单台成交价: 元。"; |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 订车获取模板
|
|
|
|
ftl = "orderacar_black"; |
|
|
|
remarks = "主车" + num + "台,单台成交价: 元。"; |
|
|
|
remarks = "数量" + num + "台,单台成交价: 元。"; |
|
|
|
} |
|
|
|
map.put("remarks", remarks); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
@ -1023,18 +997,11 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
if (stringList.size() > 0) { |
|
|
|
for (int i = 0; i < stringList.size(); i++) { |
|
|
|
InvoicMessageContractVo vo = new InvoicMessageContractVo(); |
|
|
|
if (stringList.get(i).length() > 8) { |
|
|
|
vo.setVinNo(stringList.get(i).substring(stringList.get(i).length() - 8)); |
|
|
|
} else { |
|
|
|
vo.setVinNo(stringList.get(i)); |
|
|
|
} |
|
|
|
vo.setType(appOrderDetailsVo.getInvoiceType()); |
|
|
|
invoicMessageContractVos.add(vo); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
for (int i = 0; i < Integer.parseInt(orderModelInfoVo.getTotal()); i++) { |
|
|
|
InvoicMessageContractVo vo = new InvoicMessageContractVo(); |
|
|
|
// vo.setType(appOrderDetailsVo.getInvoiceType());
|
|
|
|
invoicMessageContractVos.add(vo); |
|
|
|
} |
|
|
|
} |
|
|
@ -1069,21 +1036,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
private String getCarFin(Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
//查询销售订单的现车
|
|
|
|
/*AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
AppOrderDepositInfoVo depositInfo = appOrderDetailsVo.getDepositInfo(); |
|
|
|
String singleFinalPrice = priceInfo.getSingleFinalPrice(); |
|
|
|
String deposit = depositInfo.getDeposit(); |
|
|
|
if (new BigDecimal(singleFinalPrice).compareTo(new BigDecimal(deposit)) != 0) { |
|
|
|
//单台成交价-单台订金 = 单台车款
|
|
|
|
BigDecimal money = new BigDecimal(singleFinalPrice).subtract(new BigDecimal(deposit)).multiply(new BigDecimal(priceInfo.getNumber())); |
|
|
|
map.put("money", money); |
|
|
|
map.put("moneyDx", TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(money.toString()).doubleValue()))); |
|
|
|
} |
|
|
|
List<String> stringList = orderModelInfoVo.getVinList(); |
|
|
|
if (stringList.size() > 0) { |
|
|
|
map.put("vinNo", String.join(",", stringList)); |
|
|
|
}*/ |
|
|
|
//车款:money,大写:moneyDx
|
|
|
|
String ftl = "carFin"; |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
@ -1108,14 +1060,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
private String getMoneyFin(Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { |
|
|
|
String url = ""; |
|
|
|
//查询销售订单的现车
|
|
|
|
/* AppOrderModelInfoVo orderModelInfoVo = appOrderDetailsVo.getModelInfo(); |
|
|
|
AppOrderPriceInfoVo priceInfo = appOrderDetailsVo.getPriceInfo(); |
|
|
|
AppOrderDepositInfoVo depositInfo = appOrderDetailsVo.getDepositInfo(); |
|
|
|
String singleFinalPrice = priceInfo.getSingleFinalPrice(); |
|
|
|
String deposit = depositInfo.getDeposit(); |
|
|
|
map.put("money", new BigDecimal(singleFinalPrice).multiply(new BigDecimal(priceInfo.getNumber()))); |
|
|
|
map.put("moneyDx", TransformMoney.transform(TransformMoney.getDecimalStr(Double.valueOf(new BigDecimal(singleFinalPrice).multiply(new BigDecimal(priceInfo.getNumber())).toString()).doubleValue()))); |
|
|
|
map.put("moneyXx", new BigDecimal(deposit).multiply(new BigDecimal(priceInfo.getNumber())));*/ |
|
|
|
//车款:money,大写:moneyDx
|
|
|
|
String ftl = "moneyFin"; |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl + ".ftl"); |
|
|
@ -1147,16 +1091,6 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
if (vinNoList.size() > 0) { |
|
|
|
for (int i = 0; i < vinNoList.size(); i++) { |
|
|
|
CarContractListVo carContractListVo = new CarContractListVo(); |
|
|
|
/*carContractListVo.setBrand(orderModelInfoVo.getBrand()); |
|
|
|
carContractListVo.setVinNo(vinNoList.get(i).getVinNo()); |
|
|
|
String vinSid = vinNoList.get(i).getVinSid(); |
|
|
|
if (StringUtils.isNotBlank(vinSid)) { |
|
|
|
//根据车辆sid查询车辆信息获取发动机号
|
|
|
|
BaseVehicleSelectVo baseVehicleSelectVo = baseVehicleService.details(vinSid); |
|
|
|
if (baseVehicleSelectVo != null) { |
|
|
|
carContractListVo.setEnginNo(baseVehicleSelectVo.getEngineNo()); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
carContractListVos.add(carContractListVo); |
|
|
|
} |
|
|
|
} |
|
|
@ -1703,7 +1637,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
//马力
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getPowerValue()) && !"-".equals(baseVehicleModel.getPowerValue())){ |
|
|
|
modelAllName.append(baseVehicleModel.getPowerValue()).append("马力"); |
|
|
|
modelAllName.append(" ").append(baseVehicleModel.getPowerValue()).append("马力"); |
|
|
|
} |
|
|
|
//燃料
|
|
|
|
if (StringUtils.isNotBlank(baseVehicleModel.getFuelTypeValue()) && !"-".equals(baseVehicleModel.getFuelTypeValue())){ |
|
|
@ -1887,7 +1821,12 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
} |
|
|
|
//车辆交付地点
|
|
|
|
String address = priceInfo.getAddress(); |
|
|
|
//根据存放地点查询
|
|
|
|
ScmWarehouseVo scmWarehouseVo = scmWarehouseFeign.fetchBySid(priceInfo.getPlannedPickUpLocationKey()).getData(); |
|
|
|
String address = ""; |
|
|
|
if(scmWarehouseVo != null){ |
|
|
|
address = scmWarehouseVo.getWarehouseAttribute(); |
|
|
|
} |
|
|
|
//组装到文档相对应的字段中
|
|
|
|
if(StringUtils.isNotBlank(appOrderDetailsVo.getPurchaseSystemSid())){ |
|
|
|
ResultBean<FinCompanyInvoicingDetailsVo> invoicingDetailsVoResultBean = finCompanyInvoicingFeign.getDetailsByUseOrgAndSystem(appOrderDetailsVo.getUseOrgSid(),appOrderDetailsVo.getPurchaseSystemSid()); |
|
|
@ -2033,6 +1972,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
if (commonContractBuscenterVo == null) { |
|
|
|
String finalUrl = url; |
|
|
|
String finalUrlAll = urlAll; |
|
|
|
String finalAddress = address; |
|
|
|
Future<String> future3 = pool.submit(() -> { |
|
|
|
//新增合同信息
|
|
|
|
CommonContract commonContract = new CommonContract(); |
|
|
@ -2061,7 +2001,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
commonContract.setPartyB(customerName); |
|
|
|
//签订日期、签订地点
|
|
|
|
commonContract.setCreateDate(new Date()); |
|
|
|
commonContract.setAddress(address); |
|
|
|
commonContract.setAddress(finalAddress); |
|
|
|
//订金
|
|
|
|
commonContract.setDeposit(new BigDecimal(depositTotal)); |
|
|
|
//合同金额
|
|
|
|