|
|
@ -33,11 +33,14 @@ import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.*; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.vin.VinListsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusVehicleQKKPQuery; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusVehicleQKKPVo; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomer.CrmCustomerFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomerfile.CrmCustomerFileFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerFileDDto; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempVo; |
|
|
|
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicleFeign; |
|
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingDetailsVo; |
|
|
|
import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingFeign; |
|
|
|
import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.FinUncollectedReceivablesDetailedFeign; |
|
|
@ -172,6 +175,8 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
private BaseModelConfigService baseModelConfigService; |
|
|
|
@Autowired |
|
|
|
private ScmWarehouseFeign scmWarehouseFeign; |
|
|
|
@Autowired |
|
|
|
private FinBillVehicleFeign finBillVehicleFeign; |
|
|
|
|
|
|
|
private QueryWrapper<CommonContract> createQueryWrapper(CommonContractQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
@ -2631,6 +2636,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(userSid).getData(); |
|
|
|
String staffSid = sysUserVo.getStaffSid(); |
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.selectByOrgSidPath(params.getOrgPath()).getData(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(params.getOrgPath()).getData(); |
|
|
|
qw.eq("staffSid", staffSid); |
|
|
|
qw.eq("orgSid", sysOrganizationVo.getSid()); |
|
|
|
ResultBean<List<String>> busList = busSalesOrderFeign.selectBusinessSidByQKKP(params.getUserSid(), params.getOrgPath()); |
|
|
@ -2646,7 +2652,9 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
qw.orderByDesc("createDate"); |
|
|
|
IPage<CommonContract> page = PagerUtil.queryToPage(query); |
|
|
|
IPage<CommonContractVo> pagging = baseMapper.selectByStaffSid(page, qw); |
|
|
|
for (CommonContractVo record : pagging.getRecords()) { |
|
|
|
List<CommonContractVo> records = pagging.getRecords(); |
|
|
|
List<CommonContractVo> recordsNew = new ArrayList<>(); |
|
|
|
for (CommonContractVo record : records) { |
|
|
|
String createDate = record.getCreateDate(); |
|
|
|
DateTime dateTime = DateUtil.parse(createDate, "yyyy-MM-dd"); |
|
|
|
createDate = DateUtil.formatDate(dateTime); |
|
|
@ -2654,7 +2662,17 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderFeign.selectOrderByContractNo(record.getContractNo()).getData(); |
|
|
|
record.setSaleTypeKey(busSalesOrder.getPayTypeKey()); |
|
|
|
record.setSaleTypeValue(busSalesOrder.getPayType()); |
|
|
|
BusVehicleQKKPQuery busVehicleQKKPQuery = new BusVehicleQKKPQuery(); |
|
|
|
busVehicleQKKPQuery.setContractNo(record.getContractNo()); |
|
|
|
List<BusVehicleQKKPVo> busVehicleQKKPVos = busSalesOrderVehicleFeign.appVehicleQKKPList(busVehicleQKKPQuery).getData(); |
|
|
|
if (busVehicleQKKPVos != null){ |
|
|
|
if (busVehicleQKKPVos.size() != 0){ |
|
|
|
recordsNew.add(record); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
pagging.setRecords(recordsNew); |
|
|
|
pagging.setTotal(recordsNew.size()); |
|
|
|
PagerVo<CommonContractVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
@ -2662,6 +2680,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
public IPage<ContractPageVo> getApprovalContractList(PagerQuery<ContractPageQuery> query) { |
|
|
|
ContractPageQuery params = query.getParams(); |
|
|
|
QueryWrapper<ContractPageVo> qw = new QueryWrapper<>(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(params.getOrgPath()).getData(); |
|
|
|
if (params.getStateType() == 2) { |
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(params.getUserSid()).getData(); |
|
|
|
String staffSid = sysUserVo.getStaffSid(); |
|
|
@ -2699,6 +2718,23 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp |
|
|
|
qw.orderByDesc("createDate"); |
|
|
|
IPage<ContractPageVo> page = PagerUtil.queryToPage(query); |
|
|
|
IPage<ContractPageVo> iPage = baseMapper.getApprovalContractList(page, qw); |
|
|
|
if (params.getStateType() == 2) { |
|
|
|
List<ContractPageVo> records = iPage.getRecords(); |
|
|
|
List<ContractPageVo> recordsNew = new ArrayList<>(); |
|
|
|
if (records != null){ |
|
|
|
for (ContractPageVo record : records) { |
|
|
|
BusVehicleQKKPQuery busVehicleQKKPQuery = new BusVehicleQKKPQuery(); |
|
|
|
busVehicleQKKPQuery.setContractNo(record.getContractId()); |
|
|
|
List<BusVehicleQKKPVo> busVehicleQKKPVos = busSalesOrderVehicleFeign.appVehicleQKKPList(busVehicleQKKPQuery).getData(); |
|
|
|
if (busVehicleQKKPVos != null){ |
|
|
|
if (busVehicleQKKPVos.size() != 0){ |
|
|
|
recordsNew.add(record); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
iPage.setRecords(recordsNew); |
|
|
|
} |
|
|
|
return iPage; |
|
|
|
} |
|
|
|
|
|
|
|