|
|
@ -30,6 +30,7 @@ import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
|
import com.yxt.anrui.fin.api.fincollectionconfirmation.FinCollectionConfirmationFeign; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.bdcustomer.BdCustomer; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.bdempinfo.BDEmpinfo; |
|
|
@ -93,6 +94,8 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
@Autowired |
|
|
|
private BasePurchaseSystemService basePurchaseSystemService; |
|
|
|
@Autowired |
|
|
|
private FinCollectionConfirmationFeign finCollectionConfirmationFeign; |
|
|
|
@Autowired |
|
|
|
private BaseVehicleBrandService baseVehicleBrandService; |
|
|
|
|
|
|
|
public ResultBean<Boolean> vehicleOut(BaseVehicleOutDto dto) { |
|
|
@ -136,30 +139,46 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
String FNumber = HanZiConverterPinYin.getPinYinFirst(dto.getCustomerName()) + dto.getVinNo().substring(dto.getVinNo().length() - 8); |
|
|
|
Boolean aBoolean = finKingDeeFeign.customerExistState(FNumber).getData(); |
|
|
|
if (!aBoolean) { |
|
|
|
Boolean aBoolean1 = finKingDeeFeign.customerExistState(dto.getCustomerNo()).getData(); |
|
|
|
//查询合同编号和车辆sid客户的临时编码
|
|
|
|
ResultBean<String> stringResultBean = busSalesOrderFeign.selectTemporaryNo(dto.getCustomerNo(),dto.getVinSid()); |
|
|
|
if(!stringResultBean.getSuccess()){ |
|
|
|
return rb.setMsg("请检查合同是否审核"); |
|
|
|
} |
|
|
|
String temporaryNo = stringResultBean.getData(); |
|
|
|
// Boolean aBoolean1 = finKingDeeFeign.customerExistState(dto.getCustomerNo()).getData();
|
|
|
|
Boolean aBoolean1 = finKingDeeFeign.customerExistState(temporaryNo).getData(); |
|
|
|
if (!aBoolean1) { |
|
|
|
List<BdCustomer> bdCustomers = new ArrayList<>(); |
|
|
|
BasePurchaseSystemDetailsVo data = basePurchaseSystemService.fetchDetailsByDeptSid(baseVehicle.getPurchaseSystemSid()).getData(); |
|
|
|
if (data != null){ |
|
|
|
bdCustomer.setTOrgIds(data.getOrgCode()); |
|
|
|
}else { |
|
|
|
bdCustomer.setTOrgIds(sysOrganizationVo.getOrgCode()); |
|
|
|
} |
|
|
|
bdCustomer.setFName(dto.getCustomerName() + dto.getVinNo().substring(dto.getVinNo().length() - 8)); |
|
|
|
String FNumber1 = HanZiConverterPinYin.getPinYinFirst(dto.getCustomerName()) + dto.getVinNo().substring(dto.getVinNo().length() - 8); |
|
|
|
if (FNumber1.length() > 30) { |
|
|
|
FNumber1 = FNumber1.substring(0, 30); |
|
|
|
bdCustomer.setFNumber(FNumber1); |
|
|
|
} else { |
|
|
|
bdCustomer.setFNumber(FNumber1); |
|
|
|
Boolean aBoolean2 = finKingDeeFeign.customerExistState(dto.getCustomerNo()).getData(); |
|
|
|
if(!aBoolean2){ |
|
|
|
List<BdCustomer> bdCustomers = new ArrayList<>(); |
|
|
|
BasePurchaseSystemDetailsVo data = basePurchaseSystemService.fetchDetailsByDeptSid(baseVehicle.getPurchaseSystemSid()).getData(); |
|
|
|
if (data != null){ |
|
|
|
bdCustomer.setTOrgIds(data.getOrgCode()); |
|
|
|
}else { |
|
|
|
bdCustomer.setTOrgIds(sysOrganizationVo.getOrgCode()); |
|
|
|
} |
|
|
|
bdCustomer.setFName(dto.getCustomerName() + dto.getVinNo().substring(dto.getVinNo().length() - 8)); |
|
|
|
String FNumber1 = HanZiConverterPinYin.getPinYinFirst(dto.getCustomerName()) + dto.getVinNo().substring(dto.getVinNo().length() - 8); |
|
|
|
if (FNumber1.length() > 30) { |
|
|
|
FNumber1 = FNumber1.substring(0, 30); |
|
|
|
bdCustomer.setFNumber(FNumber1); |
|
|
|
} else { |
|
|
|
bdCustomer.setFNumber(FNumber1); |
|
|
|
} |
|
|
|
bdCustomer.setFShortName(dto.getConcatNo()); |
|
|
|
bdCustomers.add(bdCustomer); |
|
|
|
finKingDeeFeign.draftBdCustomers(bdCustomers); |
|
|
|
dto.setCwCustomerNo(bdCustomer.getFNumber()); |
|
|
|
}else{ |
|
|
|
b = true; |
|
|
|
return rb.success().setData(b); |
|
|
|
} |
|
|
|
bdCustomer.setFShortName(dto.getConcatNo()); |
|
|
|
bdCustomers.add(bdCustomer); |
|
|
|
finKingDeeFeign.draftBdCustomers(bdCustomers); |
|
|
|
dto.setCwCustomerNo(bdCustomer.getFNumber()); |
|
|
|
} else { |
|
|
|
b = true; |
|
|
|
return rb.success().setData(b); |
|
|
|
/* b = true; |
|
|
|
return rb.success().setData(b);*/ |
|
|
|
//查询已选择的收款单的车架号是否存在,若存在则修改,不存在则不用管
|
|
|
|
//临时号截取最后两位
|
|
|
|
ResultBean resultBean = finCollectionConfirmationFeign.updateVin(dto.getVinNo(),dto.getConcatNo(),temporaryNo.substring(temporaryNo.length()-2)); |
|
|
|
} |
|
|
|
} |
|
|
|
//修改客户简称为合同编号
|
|
|
@ -348,7 +367,7 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
BaseVehinstallDetailsVo baseVehinstallDetailsVo = baseVehinstallService.fetchByVinNoAndOrgSid(baseVehicle.getVinNo(), baseVehicle.getCreateOrgSid()); |
|
|
|
if (baseTrailerDetailsVo != null) { |
|
|
|
//单据编号
|
|
|
|
salOutStock.setFBillNo(dto.getBillNo()); |
|
|
|
salOutStock.setFBillNo(dto.getBillNo() + "-1"); |
|
|
|
//日期
|
|
|
|
salOutStock.setFDate(DateUtil.today()); |
|
|
|
//分公司id
|
|
|
@ -391,7 +410,7 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
} |
|
|
|
} else if (baseVehinstallDetailsVo != null) { |
|
|
|
//单据编号
|
|
|
|
salOutStock.setFBillNo(dto.getBillNo()); |
|
|
|
salOutStock.setFBillNo(dto.getBillNo() + "-1"); |
|
|
|
//日期
|
|
|
|
salOutStock.setFDate(DateUtil.today()); |
|
|
|
//分公司id
|
|
|
|