|
|
@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.basedistributor.BaseDistributorExportVo; |
|
|
|
import com.yxt.anrui.base.api.basemiddleman.BaseMiddleman; |
|
|
|
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchaseSystemDetailsVo; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.BaseTrailer; |
|
|
@ -1122,11 +1123,61 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public List<BaseVehicleOutVoExecl> listExcel(BaseVehicleOutQuery baseVehicleOutQuery) { |
|
|
|
List<BaseVehicleOutVoExecl> baseVehicleOutVoExecls = new ArrayList<>(); |
|
|
|
/*BaseVehicleOutVoExecl baseVehicleOutVoExecl = baseMapper.selByExcel(baseVehicleOutQuery); |
|
|
|
baseVehicleOutVoExecl.setRankNo(id); |
|
|
|
baseVehicleOutVoExecls.add(baseVehicleOutVoExecl);*/ |
|
|
|
public List<BaseVehicleOutVoExecl> listExcel(BaseVehicleOutQuery params) { |
|
|
|
QueryWrapper<BaseVehicleOutVoExecl> qw = new QueryWrapper<>(); |
|
|
|
if (params != null) { |
|
|
|
String orgSidPath = params.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("bvo.createOrgSid", params.getCreateOrgSid()); |
|
|
|
} |
|
|
|
//车架号
|
|
|
|
if (StringUtils.isNotBlank(params.getVinNo())) { |
|
|
|
qw.like("bvo.vinNo", params.getVinNo()); |
|
|
|
} |
|
|
|
//销售类型
|
|
|
|
if (StringUtils.isNotBlank(params.getTypeKey())) { |
|
|
|
qw.eq("bvo.typeKey", params.getTypeKey()); |
|
|
|
} |
|
|
|
//销售日期开始-销售日期结束
|
|
|
|
qw.apply(StringUtils.isNotBlank(params.getSaleDateStart()), "date_format (bvo.saleDate,'%Y-%m-%d') >= date_format('" + params.getSaleDateStart() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(params.getSaleDateEnd()), "date_format (bvo.saleDate,'%Y-%m-%d') <= date_format('" + params.getSaleDateEnd() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
//合同编号
|
|
|
|
if (StringUtils.isNotBlank(params.getConcatNo())) { |
|
|
|
qw.like("bvo.concatNo", params.getConcatNo()); |
|
|
|
} |
|
|
|
//客户名称
|
|
|
|
if (StringUtils.isNotBlank(params.getCustomerName())) { |
|
|
|
qw.like("bvo.customerName", params.getCustomerName()); |
|
|
|
} |
|
|
|
//销售部门
|
|
|
|
if (StringUtils.isNotBlank(params.getOrgDeptSid())) { |
|
|
|
qw.eq("bvo.orgSid", params.getOrgDeptSid()); |
|
|
|
} |
|
|
|
//销售人员
|
|
|
|
if (StringUtils.isNotBlank(params.getStaffSid())) { |
|
|
|
qw.eq("bvo.staffSid", params.getStaffSid()); |
|
|
|
} |
|
|
|
//内部编码
|
|
|
|
if (StringUtils.isNotBlank(params.getInsideCode())) { |
|
|
|
qw.like("bv.insideCode", params.getInsideCode()); |
|
|
|
} |
|
|
|
//分公司
|
|
|
|
if (StringUtils.isNotBlank(params.getOrgSid())) { |
|
|
|
qw.eq("bvo.createOrgSid", params.getOrgSid()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<BaseVehicleOutVoExecl> baseVehicleOutVoExecls = baseMapper.selByExcel(qw); |
|
|
|
int id = 1; |
|
|
|
for (BaseVehicleOutVoExecl baseVehicleOutVoExecl : baseVehicleOutVoExecls) { |
|
|
|
baseVehicleOutVoExecl.setRankNo(id); |
|
|
|
id = id + 1; |
|
|
|
} |
|
|
|
return baseVehicleOutVoExecls; |
|
|
|
} |
|
|
|
} |
|
|
|