|
|
@ -82,6 +82,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import java.io.File; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.MessageFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.*; |
|
|
@ -1264,16 +1265,12 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean submitCarSaleContractApprove(CarSaleContractApproveDto dto) { |
|
|
|
String staffSid = sysUserFeign.selectBySid(dto.getUserSid()).getData().getStaffSid(); |
|
|
|
ResultBean<String> resultBean = sysStaffOrgFeign.getSysStaffOrgSidListByStaffSid(staffSid); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return new ResultBean().fail().setMsg("用户组织机构不能为空"); |
|
|
|
} |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("businessSid", dto.getBusinessSid()); |
|
|
|
variables.put("orgSid", resultBean.getData()); |
|
|
|
AppSubmitContractInfoDto submitContractInfoDto = new AppSubmitContractInfoDto(); |
|
|
|
BeanUtil.copyProperties(dto,submitContractInfoDto); |
|
|
|
ResultBean resultBean = submitContractInfo(submitContractInfoDto); |
|
|
|
return resultBean; |
|
|
|
|
|
|
|
|
|
|
|
return null;//flowableService.businessStart(ProcDefEnum.CARSALECONTRACTAPPROVE.getProDefId(), dto.getUserSid(), variables);
|
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<CommonContractVo> fetchAllBySid(String sid) { |
|
|
@ -1873,7 +1870,14 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
} |
|
|
|
//生成合同编号
|
|
|
|
String contractNo = getApplyCode(dto.getUserSid(), appOrderModelInfoVo.getModelSid()); |
|
|
|
String contractNo = ""; |
|
|
|
CommonContractBuscenterVo commonContractBuscenterVo = baseMapper.selectByBusSid(dto.getBusSid()); |
|
|
|
if (commonContractBuscenterVo == null) { |
|
|
|
contractNo = getApplyCode(dto.getUserSid(), appOrderModelInfoVo.getModelSid()); |
|
|
|
}else{ |
|
|
|
contractNo = commonContractBuscenterVo.getContractNo(); |
|
|
|
} |
|
|
|
// String contractNo = getApplyCode(dto.getUserSid(), appOrderModelInfoVo.getModelSid());
|
|
|
|
map.put("contractNo", contractNo); |
|
|
|
String url = ""; |
|
|
|
PrintConfirmVo printConfirmVo = null; |
|
|
@ -1991,16 +1995,17 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
//生成合同数据
|
|
|
|
//根据销售订单sid查询合同表中是否存在
|
|
|
|
CommonContractBuscenterVo commonContractBuscenterVo = baseMapper.selectByBusSid(dto.getBusSid()); |
|
|
|
commonContractBuscenterVo = baseMapper.selectByBusSid(dto.getBusSid()); |
|
|
|
if (commonContractBuscenterVo == null) { |
|
|
|
String finalUrl = url; |
|
|
|
String finalUrlAll = urlAll; |
|
|
|
String finalAddress = address; |
|
|
|
String finalContractNo = contractNo; |
|
|
|
Future<String> future3 = pool.submit(() -> { |
|
|
|
//新增合同信息
|
|
|
|
CommonContract commonContract = new CommonContract(); |
|
|
|
//合同编号
|
|
|
|
commonContract.setContractNo(contractNo); |
|
|
|
commonContract.setContractNo(finalContractNo); |
|
|
|
//合同类型
|
|
|
|
if ("现车".equals(appOrderDetailsVo.getOrderType())) { |
|
|
|
commonContract.setContractTypeKey(CommonContractEnum.contractType.XC_CONTRACT.getCode()); |
|
|
@ -2047,6 +2052,10 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
commonContract.setCustomerTypeKey(appOrderDetailsVo.getCustomerKey()); |
|
|
|
commonContract.setContractUrlAll(finalUrlAll); |
|
|
|
save(commonContract); |
|
|
|
AppOrderContractNoDto appOrderContractNoDto = new AppOrderContractNoDto(); |
|
|
|
appOrderContractNoDto.setContractNo(commonContract.getContractNo()); |
|
|
|
appOrderContractNoDto.setSaleOrderSid(commonContract.getBusSid()); |
|
|
|
busSalesOrderFeign.updateContractNoBySid(appOrderContractNoDto); |
|
|
|
if (list.size() > 0) { |
|
|
|
//添加合同下载路径
|
|
|
|
for (PrintConfirmVo vo : list) { |
|
|
@ -2227,10 +2236,10 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
} else { |
|
|
|
//更新销售订单合同编号字段
|
|
|
|
AppOrderContractNoDto appOrderContractNoDto = new AppOrderContractNoDto(); |
|
|
|
/* AppOrderContractNoDto appOrderContractNoDto = new AppOrderContractNoDto(); |
|
|
|
appOrderContractNoDto.setContractNo(commonContract.getContractNo()); |
|
|
|
appOrderContractNoDto.setSaleOrderSid(commonContract.getBusSid()); |
|
|
|
busSalesOrderFeign.updateContractNoBySid(appOrderContractNoDto); |
|
|
|
busSalesOrderFeign.updateContractNoBySid(appOrderContractNoDto);*/ |
|
|
|
//更新客户中的证件
|
|
|
|
ResultBean<List<String>> listResultBean = crmCustomerTempFeign.selectCustomerFile(commonContract.getCustomerSid()); |
|
|
|
List<String> stringList = listResultBean.getData(); |
|
|
|