|
|
@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendix; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAttachTypeEnum; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.PcCommonAppendixDto; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.*; |
|
|
|
import com.yxt.anrui.base.biz.basemodelszconfig.BaseModelSzconfigService; |
|
|
|
import com.yxt.anrui.base.biz.basetrailer.BaseTrailerService; |
|
|
@ -14,7 +16,11 @@ import com.yxt.anrui.base.biz.flow.FlowableService; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeposit.BusDepositFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositvehicle.BusDepositVehicleFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.busorder.BusOrderVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.AppBusSalesOrderVo; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomer.CrmCustomerFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomerfile.CrmCustomerFile; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomerfile.CrmCustomerFileFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomerfile.CrmCustomerFileListVo; |
|
|
|
import com.yxt.anrui.flowable.api.sysformlink.SysFormLinkFeign; |
|
|
|
import com.yxt.anrui.flowable.api.sysformlink.SysFormStateVo; |
|
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
@ -25,6 +31,7 @@ import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
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.api.sysuser.app.AppUserOrgInfoVo; |
|
|
|
import com.yxt.anrui.portal.config.DictCommonType; |
|
|
|
import com.yxt.common.base.config.component.DocPdfComponent; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
@ -40,6 +47,7 @@ import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.xml.crypto.Data; |
|
|
|
import java.io.File; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
@ -81,10 +89,10 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
private DictCommonFeign dictCommonFeign; |
|
|
|
@Autowired |
|
|
|
private BusDepositFeign busDepositFeign; |
|
|
|
/* @Autowired |
|
|
|
private BusOrderFeign busOrderFeign; |
|
|
|
@Autowired |
|
|
|
private BusOrderDiscountFeign busOrderDiscountFeign;*/ |
|
|
|
/* @Autowired |
|
|
|
private BusOrderFeign busOrderFeign; |
|
|
|
@Autowired |
|
|
|
private BusOrderDiscountFeign busOrderDiscountFeign;*/ |
|
|
|
/* @Autowired |
|
|
|
private BusOrderModelFeign busOrderModelFeign; |
|
|
|
@Autowired |
|
|
@ -104,6 +112,8 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
@Autowired |
|
|
|
private SysFormLinkFeign sysFormLinkFeign; |
|
|
|
@Autowired |
|
|
|
private CrmCustomerFileFeign crmCustomerFileFeign; |
|
|
|
@Autowired |
|
|
|
private CrmCustomerFeign crmCustomerFeign; |
|
|
|
@Autowired |
|
|
|
private BaseModelSzconfigService baseModelSzconfigService; |
|
|
@ -933,6 +943,157 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
commonContractVo.setSceneSignUrlList(sceneSignUrlList); |
|
|
|
return rb.success().setData(commonContractVo); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 移动端-合同审核列表 |
|
|
|
* |
|
|
|
* @param pagerQuery |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public PagerVo<AppCommonContractPageVo> getContractList(PagerQuery<AppCommonContractQuery> pagerQuery) { |
|
|
|
AppCommonContractQuery query = pagerQuery.getParams(); |
|
|
|
String staffSid = sysUserFeign.getUserOrgInfoByUserSid(query.getUserSid()).getData().getStaffSid(); |
|
|
|
query.setStaffSid(staffSid); |
|
|
|
QueryWrapper<CommonContract> qw = appCreateQueryWrapper(query); |
|
|
|
IPage<CommonContract> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<AppCommonContractPageVo> iPage = baseMapper.getContractList(page, qw); |
|
|
|
PagerVo<AppCommonContractPageVo> p = PagerUtil.pageToVo(iPage, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<CommonContract> appCreateQueryWrapper(AppCommonContractQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
|
QueryWrapper<CommonContract> qw = new QueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getType())) { //合同类型
|
|
|
|
qw.eq("contractTypeKey", query.getType()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getNames())) { // 甲方名称
|
|
|
|
qw.like("partyA", query.getNames()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getNames())) { // 乙方名称
|
|
|
|
qw.like("partyB", query.getNames()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getNames())) { // 其他方名称
|
|
|
|
qw.like("partyC", query.getNames()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getStaffSid())) { // 业务员sid
|
|
|
|
qw.like("staffSid", query.getStaffSid()); |
|
|
|
} |
|
|
|
return qw; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 移动端-初始化合同审核 |
|
|
|
* |
|
|
|
* @param contractSid |
|
|
|
* @param userSid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public AppCommonContractInitVo getContractInfo(String contractSid, String userSid) { |
|
|
|
String staffSid = sysUserFeign.getUserOrgInfoByUserSid(userSid).getData().getStaffSid(); |
|
|
|
AppCommonContractInitVo vo = baseMapper.getContractInfo(contractSid, staffSid); |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
|
|
|
|
String[] split1 = vo.getAppdixUrl().split(","); |
|
|
|
List<String> contract = new ArrayList<>(); |
|
|
|
List<String> contractImages = Arrays.asList(split1); |
|
|
|
for (String contractImage : contractImages) { |
|
|
|
String contractImageUrl = urlPrefix + contractImage; |
|
|
|
contract.add(contractImageUrl); |
|
|
|
} |
|
|
|
vo.setContractImages(contract); |
|
|
|
|
|
|
|
String[] split2 = vo.getSceneSignUrl().split(","); |
|
|
|
List<String> siteSig = new ArrayList<>(); |
|
|
|
List<String> siteSigImages = Arrays.asList(split2); |
|
|
|
for (String siteSigImage : siteSigImages) { |
|
|
|
String siteSigImagesUrl = urlPrefix + siteSigImage; |
|
|
|
siteSig.add(siteSigImagesUrl); |
|
|
|
} |
|
|
|
vo.setSiteSigImages(siteSig); |
|
|
|
|
|
|
|
if (vo.getCustomerKey().equals("1")) { |
|
|
|
vo.setIdCardArchives(false); |
|
|
|
if (StringUtils.isNotBlank(vo.getSceneSignUrl())) { |
|
|
|
|
|
|
|
String[] split3 = vo.getSceneSignUrl().split(","); |
|
|
|
List<String> idCard = new ArrayList<>(); |
|
|
|
List<String> idCardImages = Arrays.asList(split3); |
|
|
|
for (String idCardImage : idCardImages) { |
|
|
|
String idCardImagesUrl = urlPrefix + idCardImage; |
|
|
|
idCard.add(idCardImagesUrl); |
|
|
|
} |
|
|
|
vo.setIdCardImages(idCard); |
|
|
|
} else { |
|
|
|
vo.setIdCardImages(new ArrayList<>()); |
|
|
|
} |
|
|
|
} else if (vo.getCustomerKey().equals("2")) { |
|
|
|
vo.setIdCardArchives(true); |
|
|
|
// 往里添加客户档案里的身份证信息
|
|
|
|
} |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 合同审核保存接口 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveContractInfo(AppCrmCustomerFileDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(dto.getUserSid()).getData(); |
|
|
|
CommonContract commonContract = new CommonContract(); |
|
|
|
commonContract.setContractNo(dto.getContractId()); |
|
|
|
commonContract.setPrice(dto.getPrice()); |
|
|
|
commonContract.setNum(Integer.valueOf(dto.getNumber())); |
|
|
|
commonContract.setModelName(dto.getModel()); |
|
|
|
commonContract.setPartyB(dto.getPartyB()); |
|
|
|
commonContract.setContractAmount(dto.getContractPrice()); |
|
|
|
commonContract.setCustomerSid(dto.getCustomerSid()); |
|
|
|
commonContract.setStaffSid(data.getStaffSid()); |
|
|
|
commonContract.setStaffName(data.getStaffName()); |
|
|
|
commonContract.setOrgSid(data.getOrgSid()); |
|
|
|
String s1 = ""; |
|
|
|
String s2 = ""; |
|
|
|
String s3 = ""; |
|
|
|
if (dto.getContractImages().size() > 0) { |
|
|
|
for (String contractImage : dto.getContractImages()) { |
|
|
|
if (contractImage.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
contractImage = contractImage.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
s1 += contractImage + ","; |
|
|
|
} |
|
|
|
commonContract.setAppdixUrl(s1.substring(0, s1.length() - 1)); |
|
|
|
} |
|
|
|
|
|
|
|
if (dto.getContractImages().size() > 0) { |
|
|
|
for (String siteSigImages : dto.getSiteSigImages()) { |
|
|
|
if (siteSigImages.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
siteSigImages = siteSigImages.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
s2 += siteSigImages + ","; |
|
|
|
} |
|
|
|
commonContract.setSceneSignUrl(s2.substring(0, s2.length() - 1)); |
|
|
|
} |
|
|
|
|
|
|
|
if (dto.getContractImages().size() > 0) { |
|
|
|
for (String idCardImage : dto.getIdCardImages()) { |
|
|
|
if (idCardImage.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
idCardImage = idCardImage.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
s3 += idCardImage + ","; |
|
|
|
} |
|
|
|
commonContract.setIdImagesUrl(s3.substring(0, s3.length() - 1)); |
|
|
|
} |
|
|
|
save(commonContract); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
//ToDo:
|
|
|
|
/** |
|
|
|
* 合同信息数据 |
|
|
@ -942,22 +1103,22 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
*/ |
|
|
|
/* public Map<String, Object> getMap(Map<String, Object> map, PrintConfirmDto dto) { |
|
|
|
Map<String, Object> commonContractMap = map;*/ |
|
|
|
/** |
|
|
|
* 车辆登记合同参数: |
|
|
|
* 甲方:${partyA} |
|
|
|
* 乙方:${partyB} |
|
|
|
* 签订时间:${createDate} |
|
|
|
* 车辆出售方:${partyA} |
|
|
|
* 车辆信息List: |
|
|
|
* { |
|
|
|
* 序号: |
|
|
|
* 品牌:${item.brandName} |
|
|
|
* 车架号:${item.VINNo} |
|
|
|
* 发动机号:${item.engineNo} |
|
|
|
* } |
|
|
|
*/ |
|
|
|
//甲方为卖方,即xxx公司,即根据销售订单的单位sid查询单位的名称
|
|
|
|
//乙方为受卖方,即销售订单的客户名称
|
|
|
|
/** |
|
|
|
* 车辆登记合同参数: |
|
|
|
* 甲方:${partyA} |
|
|
|
* 乙方:${partyB} |
|
|
|
* 签订时间:${createDate} |
|
|
|
* 车辆出售方:${partyA} |
|
|
|
* 车辆信息List: |
|
|
|
* { |
|
|
|
* 序号: |
|
|
|
* 品牌:${item.brandName} |
|
|
|
* 车架号:${item.VINNo} |
|
|
|
* 发动机号:${item.engineNo} |
|
|
|
* } |
|
|
|
*/ |
|
|
|
//甲方为卖方,即xxx公司,即根据销售订单的单位sid查询单位的名称
|
|
|
|
//乙方为受卖方,即销售订单的客户名称
|
|
|
|
/* ResultBean<BusOrderVo> busOrderVoResultBean = busOrderFeign.fetchSid(dto.getBusSid()); |
|
|
|
if (busOrderVoResultBean.getSuccess() && busOrderVoResultBean.getData() != null) { |
|
|
|
BusOrderVo orderVo = busOrderVoResultBean.getData(); |
|
|
@ -968,7 +1129,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
} |
|
|
|
return commonContractMap;*/ |
|
|
|
|
|
|
|
/* }*/ |
|
|
|
/* }*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 涉及高低开票的,需要打印两套合同: |
|
|
|