|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.yxt.anrui.base.biz.commoncontract; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -17,10 +18,8 @@ import com.yxt.anrui.base.biz.basetrailer.BaseTrailerService; |
|
|
|
import com.yxt.anrui.base.biz.basevehiclebrand.BaseVehicleBrandService; |
|
|
|
import com.yxt.anrui.base.biz.basevehiclemodel.BaseVehicleModelService; |
|
|
|
import com.yxt.anrui.base.biz.commonappendix.CommonAppendixService; |
|
|
|
import com.yxt.anrui.base.common.enums.BillTypeEnum; |
|
|
|
import com.yxt.anrui.base.common.enums.CommonContractEnum; |
|
|
|
import com.yxt.anrui.base.common.utils.Rule; |
|
|
|
import com.yxt.anrui.base.common.utils.domain.BillNo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeposit.BusDepositFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositfictitious.BusDepositFictitiousDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositfictitious.BusDepositFictitiousFeign; |
|
|
@ -1322,7 +1321,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
map.put("depositTotal", depositTotal); |
|
|
|
map.put("address", address); |
|
|
|
//生成合同编号
|
|
|
|
String contractNo = getApplyCode(dto.getUserSid()); |
|
|
|
String contractNo = getApplyCode(dto.getUserSid(),appOrderModelInfoVo.getModelSid()); |
|
|
|
map.put("contractNo", contractNo); |
|
|
|
String url = ""; |
|
|
|
try { |
|
|
@ -1460,15 +1459,20 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
return rb.success().setData(list); |
|
|
|
} |
|
|
|
|
|
|
|
public String getApplyCode(String userSid) { |
|
|
|
public String getApplyCode(String userSid,String modelSid) { |
|
|
|
//获取分公司sid
|
|
|
|
ResultBean<String> resultBean = sysStaffOrgFeign.getPathSidByUserSid(userSid); |
|
|
|
ResultBean<SysOrganizationVo> resultBean1 = sysOrganizationFeign.fetchBySid(resultBean.getData()); |
|
|
|
String orgCode = resultBean1.getData().getOrgCode(); |
|
|
|
BillNo b = new BillNo(); |
|
|
|
// String orgCode = resultBean1.getData().getOrgCode();
|
|
|
|
String orgCode = resultBean1.getData().getOrgAbbre(); |
|
|
|
//根据车型sid查询品牌简称
|
|
|
|
String brandCode = baseVehicleBrandService.selectShortName(modelSid); |
|
|
|
String date = DateUtil.format(DateUtil.date(), "yyyyMM"); |
|
|
|
String bill = brandCode+orgCode+date; |
|
|
|
/* BillNo b = new BillNo(); |
|
|
|
b.setOrgCode(orgCode); |
|
|
|
b.setBillType(BillTypeEnum.XSDD.getBillType()); |
|
|
|
String bill = Rule.getBill(b); |
|
|
|
String bill = Rule.getBill(b);*/ |
|
|
|
int i = baseMapper.selectNum(bill); |
|
|
|
String billNo = Rule.getBillNo(bill, i); |
|
|
|
return billNo; |
|
|
@ -1656,7 +1660,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
public ResultBean<CommonContract> getContractByBusSid(String sid) { |
|
|
|
ResultBean<CommonContract> rb = ResultBean.fireFail(); |
|
|
|
CommonContract commonContract = baseMapper.getContractByBusSid(sid); |
|
|
|
if(commonContract == null){ |
|
|
|
if (commonContract == null) { |
|
|
|
return rb.setData(new CommonContract()); |
|
|
|
} |
|
|
|
return rb.success().setData(commonContract); |
|
|
|