|
|
@ -50,6 +50,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
@ -128,32 +129,71 @@ public class InvoicedService { |
|
|
|
public ResultBean<PagerVo<SelBillVinNoPageVo>> getSelectVinsList(PagerQuery<SelBillVinNoQuery> pagerQuery) { |
|
|
|
ResultBean<PagerVo<SelBillVinNoPageVo>> rb = ResultBean.fireFail(); |
|
|
|
SelBillVinNoQuery params = pagerQuery.getParams(); |
|
|
|
FinBillApplicationQuery finBillApplicationQuery = new FinBillApplicationQuery(); |
|
|
|
finBillApplicationQuery.setCreateBySid(params.getUserSid()); |
|
|
|
finBillApplicationQuery.setName(params.getName()); |
|
|
|
finBillApplicationQuery.setOrgPath(params.getOrgPath()); |
|
|
|
//finBillApplicationQuery.setType(params.getType());
|
|
|
|
//finBillApplicationQuery.setMenuSid(params.getMenuSid());
|
|
|
|
PagerQuery<FinBillApplicationQuery> pcq = new PagerQuery<>(); |
|
|
|
pcq.setParams(finBillApplicationQuery); |
|
|
|
ResultBean<PagerVo<FinBillApplicationVo>> resultBean = finBillApplicationFeign.listPage(pcq); |
|
|
|
List<FinBillApplicationVo> records = resultBean.getData().getRecords(); |
|
|
|
List<SelBillVinNoPageVo> billApplicationPageVos = new ArrayList<>(); |
|
|
|
PcSelBillVinNoQuery pcSelBillVinNoQuery = new PcSelBillVinNoQuery(); |
|
|
|
pcSelBillVinNoQuery.setUserSid(params.getUserSid()); |
|
|
|
pcSelBillVinNoQuery.setName(params.getName()); |
|
|
|
pcSelBillVinNoQuery.setOrgPath(params.getOrgPath()); |
|
|
|
pcSelBillVinNoQuery.setContractId(params.getContractId()); |
|
|
|
pcSelBillVinNoQuery.setVinNos(params.getVins()); |
|
|
|
PagerQuery<PcSelBillVinNoQuery> pcq = new PagerQuery<>(); |
|
|
|
pcq.setParams(pcSelBillVinNoQuery); |
|
|
|
PagerVo<PcSelBillVinNoPageVo> data = finBillApplicationFeign.getSelectVinsList(pcq).getData(); |
|
|
|
List<SelBillVinNoPageVo> selBillVinNoPageVos = new ArrayList<>(); |
|
|
|
List<SelBillZcVo> selBillZcVos = new ArrayList<>(); |
|
|
|
PagerVo<SelBillVinNoPageVo> v = new PagerVo<>(); |
|
|
|
v.setRecords(billApplicationPageVos); |
|
|
|
for (PcSelBillVinNoPageVo record : data.getRecords()) { |
|
|
|
//第一层
|
|
|
|
SelBillVinNoPageVo selBillVinNoPageVo = new SelBillVinNoPageVo(); |
|
|
|
if (selBillVinNoPageVos.stream(). |
|
|
|
filter(item -> item.getContractId(). |
|
|
|
equals(record.getContractId())).findAny(). |
|
|
|
isPresent()) { |
|
|
|
} else { |
|
|
|
selBillZcVos = new ArrayList<>(); |
|
|
|
BeanUtil.copyProperties(record, selBillVinNoPageVo); |
|
|
|
selBillVinNoPageVo.setInvoiceMoney(record.getKpMoney()); |
|
|
|
selBillVinNoPageVos.add(selBillVinNoPageVo); |
|
|
|
} |
|
|
|
//第二层
|
|
|
|
if (selBillVinNoPageVos.stream(). |
|
|
|
filter(item -> item.getContractId(). |
|
|
|
equals(record.getContractId())).findAny(). |
|
|
|
isPresent()) { |
|
|
|
SelBillZcVo selBillZcVo = new SelBillZcVo(); |
|
|
|
BeanUtil.copyProperties(record, selBillZcVo); |
|
|
|
//第三层
|
|
|
|
List<PcSelBillGcVo> finBillTrailers = record.getFinBillTrailers(); |
|
|
|
List<SelBillGcVo> selBillGcVos = new ArrayList<>(); |
|
|
|
if (finBillTrailers != null && finBillTrailers.size() > 0) { |
|
|
|
for (PcSelBillGcVo finBillTrailer : finBillTrailers) { |
|
|
|
SelBillGcVo selBillGcVo = new SelBillGcVo(); |
|
|
|
BeanUtil.copyProperties(finBillTrailer, selBillGcVo); |
|
|
|
selBillGcVos.add(selBillGcVo); |
|
|
|
} |
|
|
|
} |
|
|
|
selBillZcVo.setFinBillTrailers(selBillGcVos); |
|
|
|
selBillZcVos.add(selBillZcVo); |
|
|
|
selBillVinNoPageVo.setCars(selBillZcVos); |
|
|
|
} |
|
|
|
} |
|
|
|
v.setRecords(selBillVinNoPageVos); |
|
|
|
return rb.success().setData(v); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<BillApplicationIInfoVo> getInvoicedApply(BillApplicationPageInfoQuery query) { |
|
|
|
ResultBean<BillApplicationIInfoVo> rb = ResultBean.fireFail(); |
|
|
|
BillApplicationIInfoVo vo = new BillApplicationIInfoVo(); |
|
|
|
if (StringUtils.isBlank(query.getSid())){ |
|
|
|
if (StringUtils.isBlank(query.getSid())) { |
|
|
|
String userSid = query.getUserSid(); |
|
|
|
String orgPath = query.getOrgPath(); |
|
|
|
SysUserVo sysUserVo = sysUserFeign.fetchBySid(userSid).getData(); |
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.selectByOrgSidPath(orgPath).getData(); |
|
|
|
vo.setPublishInfo(sysOrganizationVo.getName() + sysUserVo.getName()); |
|
|
|
vo.setPublishInfo(sysOrganizationVo.getName() + "-" + sysUserVo.getName()); |
|
|
|
vo.setShowBtn(true); |
|
|
|
vo.setInvoiceStateKey("001"); |
|
|
|
vo.setInvoiceState("正常开票"); |
|
|
|
vo.setDate(DateUtil.formatDate(new Date())); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
ResultBean<FinBillApplicationDetailsVo> resultBean = finBillApplicationFeign.fetchDetailsBySid(query.getSid()); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
@ -428,9 +468,9 @@ public class InvoicedService { |
|
|
|
FinBillApplicationDto finBillApplicationDto = new FinBillApplicationDto(); |
|
|
|
BeanUtil.copyProperties(dto, finBillApplicationDto, "carBuyContractImages"); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(dto.getOrgPath()).getData(); |
|
|
|
if (dto.getShowBtn()){ |
|
|
|
if (dto.getShowBtn()) { |
|
|
|
finBillApplicationDto.setShowBtnStr("1"); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
finBillApplicationDto.setShowBtnStr("0"); |
|
|
|
} |
|
|
|
finBillApplicationDto.setUseOrgSid(useOrgSid); |
|
|
@ -540,6 +580,7 @@ public class InvoicedService { |
|
|
|
finBillApplicationDto.setKpxxqrsApplicationAppendxs(kpxxqrsApplicationAppendxs); |
|
|
|
finBillApplicationDto.setCldjhtApplicationAppendxs(cldjhtApplicationAppendxs); |
|
|
|
finBillApplicationDto.setZjApplicationAppendxs(idCardImagesPC); |
|
|
|
finBillApplicationDto.setArrearsMoney("0"); |
|
|
|
ResultBean resultBean = finBillApplicationFeign.save(finBillApplicationDto); |
|
|
|
return resultBean; |
|
|
|
} |
|
|
@ -740,9 +781,9 @@ public class InvoicedService { |
|
|
|
|
|
|
|
public ResultBean submitInvoicedInfo(SubmitInvoicedInfoDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (dto.getShowBtn()){ |
|
|
|
if (dto.getShowBtn()) { |
|
|
|
List<VinListDto> vinList = dto.getVinList(); |
|
|
|
if (vinList == null || vinList.size() == 0){ |
|
|
|
if (vinList == null || vinList.size() == 0) { |
|
|
|
return rb.setMsg("车辆不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|