|
|
@ -22,7 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
@ -73,60 +75,59 @@ public class FinVehicleInvoiceService extends MybatisBaseService<FinVehicleInvoi |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
|
QueryWrapper<FinVehicleInvoice> qw = new QueryWrapper<>(); |
|
|
|
// ===========================================================
|
|
|
|
// String orgSidPath = query.getOrgSidPath();
|
|
|
|
// SysOrganizationVo data = sysOrganizationFeign.selectByOrgSidPath(orgSidPath).getData();
|
|
|
|
// String orgLevelKey = data.getOrgLevelKey();
|
|
|
|
// if ("2".equals(orgLevelKey)) {
|
|
|
|
// orgSidPath = orgSidPath.substring(0, 73);
|
|
|
|
// qw.like("so.orgSidPath", orgSidPath);
|
|
|
|
// } else if ("3".equals(orgLevelKey)) {
|
|
|
|
// qw.eq("saiq.createOrgSid", query.getCreateOrgSid());
|
|
|
|
// }
|
|
|
|
// =================================================================
|
|
|
|
qw.eq("isDelete", "0"); |
|
|
|
qw.eq("v.isDelete", "0"); |
|
|
|
//层级筛选
|
|
|
|
String orgSidPath = query.getOrgSidPath(); |
|
|
|
SysOrganizationVo data = sysOrganizationFeign.selectByOrgSidPath(orgSidPath).getData(); |
|
|
|
String orgLevelKey = data.getOrgLevelKey(); |
|
|
|
if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, 73); |
|
|
|
qw.like("so.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
qw.eq("v.useOrgSid", query.getCreateOrgSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getInvoiceTitle())) { |
|
|
|
qw.like("invoiceTitle", query.getInvoiceTitle()); |
|
|
|
qw.like("v.invoiceTitle", query.getInvoiceTitle()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getInvoiceTypeKey())) { |
|
|
|
qw.like("invoiceTypeKey", query.getInvoiceTypeKey()); |
|
|
|
qw.like("v.invoiceTypeKey", query.getInvoiceTypeKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getInvoiceType())) { |
|
|
|
qw.like("invoiceType", query.getInvoiceType()); |
|
|
|
qw.like("v.invoiceType", query.getInvoiceType()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getContractNo())) { |
|
|
|
qw.like("contractNo", query.getContractNo()); |
|
|
|
qw.like("v.contractNo", query.getContractNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
|
|
|
qw.like("customerName", query.getCustomerName()); |
|
|
|
qw.like("v.customerName", query.getCustomerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getVinNo())) { |
|
|
|
qw.like("VIN", query.getVinNo()); |
|
|
|
qw.like("v.VIN", query.getVinNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getTransferState())) { |
|
|
|
qw.eq("transferState", query.getTransferState()); |
|
|
|
qw.eq("v.transferState", query.getTransferState()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBillingState())) { |
|
|
|
qw.eq("billingState", query.getBillingState()); |
|
|
|
qw.eq("v.billingState", query.getBillingState()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getTransferStateKey())) { |
|
|
|
qw.eq("transferStateKey", query.getTransferStateKey()); |
|
|
|
qw.eq("v.transferStateKey", query.getTransferStateKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBillingStateKey())) { |
|
|
|
qw.eq("billingStateKey", query.getBillingStateKey()); |
|
|
|
qw.eq("v.billingStateKey", query.getBillingStateKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getInvoicingName())) { |
|
|
|
qw.like("invoicingName", query.getInvoicingName()); |
|
|
|
qw.like("v.invoicingName", query.getInvoicingName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getInvoiceCode())) { |
|
|
|
qw.like("invoiceCode", query.getInvoiceCode()); |
|
|
|
qw.like("v.invoiceCode", query.getInvoiceCode()); |
|
|
|
} |
|
|
|
String createStartTime = query.getCreateStartTime(); |
|
|
|
String createEndTime = query.getCreateEndTime(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createStartTime), "date_format (createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
|
|
|
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createEndTime), "date_format (createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createStartTime), "date_format (v.createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
|
|
|
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createEndTime), "date_format (v.createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
qw.orderByDesc("createTime"); |
|
|
|
qw.orderByDesc("v.createTime"); |
|
|
|
return qw; |
|
|
|
} |
|
|
|
|
|
|
@ -136,7 +137,6 @@ public class FinVehicleInvoiceService extends MybatisBaseService<FinVehicleInvoi |
|
|
|
IPage<FinVehicleInvoice> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<FinVehicleInvoiceVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<FinVehicleInvoiceVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
|
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
@ -264,9 +264,8 @@ public class FinVehicleInvoiceService extends MybatisBaseService<FinVehicleInvoi |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
if (null != dto.getFilePaths()) { |
|
|
|
for (String filePath : dto.getFilePaths()) { |
|
|
|
String[] split = filePath.split(urlPrefix); |
|
|
|
String s = split[1]; |
|
|
|
sb.append(s).append(","); |
|
|
|
String path = filePath.substring(urlPrefix.length() + 1); |
|
|
|
sb.append(path).append(","); |
|
|
|
} |
|
|
|
sb.delete(sb.length() - 1, sb.length()); |
|
|
|
dto.setFilePath(sb.toString()); |
|
|
@ -274,6 +273,7 @@ public class FinVehicleInvoiceService extends MybatisBaseService<FinVehicleInvoi |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(dto.getFilePath())) { |
|
|
|
dto.setBillingStateKey("002"); |
|
|
|
dto.setBillingState("已开票"); |
|
|
|
dto.setInvoiceDate((new Date())); |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotEmpty(dto.getVinNo())) { |
|
|
|
String VIN = dto.getVinNo(); |
|
|
@ -291,14 +291,14 @@ public class FinVehicleInvoiceService extends MybatisBaseService<FinVehicleInvoi |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
if (null != dto.getFilePaths()) { |
|
|
|
for (String filePath : dto.getFilePaths()) { |
|
|
|
String[] split = filePath.split(urlPrefix); |
|
|
|
String s = split[1]; |
|
|
|
sb.append(s).append(","); |
|
|
|
String path = filePath.substring(urlPrefix.length() + 1); |
|
|
|
sb.append(path).append(","); |
|
|
|
} |
|
|
|
sb.delete(sb.length() - 1, sb.length()); |
|
|
|
finVehicleInvoice.setFilePath(sb.toString()); |
|
|
|
finVehicleInvoice.setBillingStateKey("002"); |
|
|
|
finVehicleInvoice.setBillingState("已开票"); |
|
|
|
dto.setInvoiceDate((new Date())); |
|
|
|
} |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotEmpty(dto.getVinNo())) { |
|
|
|
String VIN = dto.getVinNo(); |
|
|
|