|
@ -57,6 +57,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -93,19 +94,24 @@ public class BaseTrailerService extends MybatisBaseService<BaseTrailerMapper, Ba |
|
|
private QueryWrapper<BaseTrailer> createQueryWrapper(BaseTrailerQuery query) { |
|
|
private QueryWrapper<BaseTrailer> createQueryWrapper(BaseTrailerQuery query) { |
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
QueryWrapper<BaseTrailer> qw = new QueryWrapper<>(); |
|
|
QueryWrapper<BaseTrailer> qw = new QueryWrapper<>(); |
|
|
qw.eq("useOrgSid",query.getUseOrgSid()); |
|
|
qw.eq("bt.useOrgSid",query.getUseOrgSid()); |
|
|
if (StringUtils.isNotBlank(query.getVinNo())) { |
|
|
if (StringUtils.isNotBlank(query.getVinNo())) { |
|
|
qw.eq("vinNo", query.getVinNo()); |
|
|
qw.like("bt.vinNo", query.getVinNo()); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(query.getCarBrand())) { |
|
|
if (StringUtils.isNotBlank(query.getCarBrand())) { |
|
|
qw.eq("carBrand", query.getCarBrand()); |
|
|
qw.eq("btm.brandSid", query.getCarBrand()); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(query.getSettlementSid())) { |
|
|
if (StringUtils.isNotBlank(query.getSettlementSid())) { |
|
|
qw.eq("settlementSid", query.getSettlementSid()); |
|
|
qw.eq("btm.manufacturerSid", query.getSettlementSid()); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(query.getCarModelSid())) { |
|
|
if (StringUtils.isNotBlank(query.getCarModelName())) { |
|
|
qw.like("carModelSid", query.getCarModelSid()); |
|
|
qw.like("btm.carModelName", query.getCarModelName()); |
|
|
} |
|
|
} |
|
|
|
|
|
String warehousingStartDate = query.getWarehousingStartDate(); |
|
|
|
|
|
String warehousingEndDate = query.getWarehousingEndDate(); |
|
|
|
|
|
qw.apply(StringUtils.isNotEmpty(warehousingStartDate), "date_format (bt.warehousingDate,'%Y-%m-%d') >= date_format('" + warehousingStartDate + "','%Y-%m-%d')"). |
|
|
|
|
|
apply(StringUtils.isNotEmpty(warehousingEndDate), "date_format (bt.warehousingDate,'%Y-%m-%d') <= date_format('" + warehousingEndDate + "','%Y-%m-%d')" |
|
|
|
|
|
); |
|
|
return qw; |
|
|
return qw; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -114,6 +120,18 @@ public class BaseTrailerService extends MybatisBaseService<BaseTrailerMapper, Ba |
|
|
QueryWrapper<BaseTrailer> qw = createQueryWrapper(query); |
|
|
QueryWrapper<BaseTrailer> qw = createQueryWrapper(query); |
|
|
IPage<BaseTrailer> page = PagerUtil.queryToPage(pq); |
|
|
IPage<BaseTrailer> page = PagerUtil.queryToPage(pq); |
|
|
IPage<BaseTrailerVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
IPage<BaseTrailerVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
|
|
for (BaseTrailerVo record : pagging.getRecords()) { |
|
|
|
|
|
String trailerModelSid = record.getTrailerModelSid(); |
|
|
|
|
|
BaseTrailerModel baseTrailerModel = baseTrailerModelService.fetchBySid(trailerModelSid); |
|
|
|
|
|
String appearanceSizeLong = baseTrailerModel.getAppearanceSizeLong(); |
|
|
|
|
|
String appearanceSizeWide = baseTrailerModel.getAppearanceSizeWide(); |
|
|
|
|
|
String appearanceSizeHigh = baseTrailerModel.getAppearanceSizeHigh(); |
|
|
|
|
|
String appearanceSizeTotalHigh = baseTrailerModel.getAppearanceSizeTotalHigh(); |
|
|
|
|
|
String trailerTypeValue = baseTrailerModel.getTrailerTypeValue(); |
|
|
|
|
|
StringBuilder trailerModel = new StringBuilder(); |
|
|
|
|
|
trailerModel.append(trailerTypeValue).append("(").append("长").append(appearanceSizeLong).append("mm,").append("宽").append(appearanceSizeWide).append("mm,").append("高").append(appearanceSizeHigh).append("mm,").append("总高").append(appearanceSizeTotalHigh).append("mm").append(")"); |
|
|
|
|
|
record.setTrailerModel(trailerModel.toString()); |
|
|
|
|
|
} |
|
|
PagerVo<BaseTrailerVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
PagerVo<BaseTrailerVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
return p; |
|
|
return p; |
|
|
} |
|
|
} |
|
@ -154,21 +172,25 @@ public class BaseTrailerService extends MybatisBaseService<BaseTrailerMapper, Ba |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
List<CommonAppendixVo> commonAppendixVos = commonAppendixService.selByLinkSid(sid); |
|
|
List<CommonAppendixVo> commonAppendixVos = commonAppendixService.selByLinkSid(sid); |
|
|
|
|
|
List<CommonAppendixVo> invoicePic = new ArrayList<>(); |
|
|
|
|
|
List<CommonAppendixVo> certificatePic = new ArrayList<>(); |
|
|
for (CommonAppendixVo commonAppendixVo : commonAppendixVos) { |
|
|
for (CommonAppendixVo commonAppendixVo : commonAppendixVos) { |
|
|
if (commonAppendixVo.getAttachType().equals("挂车发票照片")){ |
|
|
if (commonAppendixVo.getAttachType().equals("挂车发票照片")){ |
|
|
String filePath = commonAppendixVo.getFilePath(); |
|
|
String filePath = commonAppendixVo.getFilePath(); |
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
filePath = urlPrefix + filePath; |
|
|
filePath = urlPrefix + filePath; |
|
|
commonAppendixVo.setFilePath(filePath); |
|
|
commonAppendixVo.setFilePath(filePath); |
|
|
baseTrailerDetailsVo.setInvoicePic(commonAppendixVo); |
|
|
invoicePic.add(commonAppendixVo); |
|
|
}else if (commonAppendixVo.getAttachType().equals("挂车合格证照片")){ |
|
|
}else if (commonAppendixVo.getAttachType().equals("挂车合格证照片")){ |
|
|
String filePath = commonAppendixVo.getFilePath(); |
|
|
String filePath = commonAppendixVo.getFilePath(); |
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
filePath = urlPrefix + filePath; |
|
|
filePath = urlPrefix + filePath; |
|
|
commonAppendixVo.setFilePath(filePath); |
|
|
commonAppendixVo.setFilePath(filePath); |
|
|
baseTrailerDetailsVo.setCertificatePic(commonAppendixVo); |
|
|
certificatePic.add(commonAppendixVo); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
baseTrailerDetailsVo.setInvoicePic(invoicePic); |
|
|
|
|
|
baseTrailerDetailsVo.setCertificatePic(certificatePic); |
|
|
return rb.success().setData(baseTrailerDetailsVo); |
|
|
return rb.success().setData(baseTrailerDetailsVo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -226,6 +248,29 @@ public class BaseTrailerService extends MybatisBaseService<BaseTrailerMapper, Ba |
|
|
public ResultBean updateTrailer(BaseTrailerDto dto, String sid) { |
|
|
public ResultBean updateTrailer(BaseTrailerDto dto, String sid) { |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
int count = updateBySid(dto, sid); |
|
|
int count = updateBySid(dto, sid); |
|
|
|
|
|
commonAppendixService.deleteFiles(sid); |
|
|
|
|
|
List<CommonAppendixDto> invoicePics = dto.getInvoicePic(); |
|
|
|
|
|
List<CommonAppendixDto> certificatePics = dto.getCertificatePic(); |
|
|
|
|
|
for (CommonAppendixDto invoicePic : invoicePics) { |
|
|
|
|
|
invoicePic.setLinkSid(sid); |
|
|
|
|
|
String invoiceFilePath = invoicePic.getFilePath(); |
|
|
|
|
|
if (invoiceFilePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
|
|
invoiceFilePath = invoiceFilePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
|
|
} |
|
|
|
|
|
invoicePic.setFilePath(invoiceFilePath); |
|
|
|
|
|
invoicePic.setAttachType("挂车发票照片"); |
|
|
|
|
|
commonAppendixService.saveOrUpdateDto(invoicePic); |
|
|
|
|
|
} |
|
|
|
|
|
for (CommonAppendixDto certificatePic : certificatePics) { |
|
|
|
|
|
certificatePic.setLinkSid(sid); |
|
|
|
|
|
String certificateFilePath = certificatePic.getFilePath(); |
|
|
|
|
|
if (certificateFilePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
|
|
certificateFilePath = certificateFilePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
|
|
} |
|
|
|
|
|
certificatePic.setFilePath(certificateFilePath); |
|
|
|
|
|
certificatePic.setAttachType("挂车合格证照片"); |
|
|
|
|
|
commonAppendixService.saveOrUpdateDto(certificatePic); |
|
|
|
|
|
} |
|
|
if (count == 0) { |
|
|
if (count == 0) { |
|
|
return rb.setMsg("修改失败"); |
|
|
return rb.setMsg("修改失败"); |
|
|
} |
|
|
} |
|
|