|
|
@ -515,9 +515,9 @@ public class BaseVehicleRest implements BaseVehicleFeign { |
|
|
|
scmApplyInboundQueryDto.setManPurOrderTypeKey(baseVehicleDto.getManPurOrderTypeKey()); |
|
|
|
scmApplyInboundQueryDto.setManPurOrderTypeValue(baseVehicleDto.getManPurOrderTypeValue()); |
|
|
|
Integer i = scmApplyInboundQueryFeign.fetchByApplicationCode(baseOutsourcingApplication.getApplicationCode()).getData(); |
|
|
|
if (i == 0){ |
|
|
|
if (i == 0) { |
|
|
|
scmApplyInboundQueryDto.setApplicationCode(baseOutsourcingApplication.getApplicationCode()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
String num = String.format("%02d", i); |
|
|
|
scmApplyInboundQueryDto.setApplicationCode(baseOutsourcingApplication.getApplicationCode() + "-" + num); |
|
|
|
} |
|
|
@ -754,7 +754,7 @@ public class BaseVehicleRest implements BaseVehicleFeign { |
|
|
|
//修改存放地点编码
|
|
|
|
String location = dto.getLocation(); |
|
|
|
ScmWarehouseVo scmWarehouseVo = scmWarehouseFeign.fetchBySid(location).getData(); |
|
|
|
if (scmWarehouseVo != null){ |
|
|
|
if (scmWarehouseVo != null) { |
|
|
|
baseVehicle.setLocationCode(scmWarehouseVo.getGressionCode()); |
|
|
|
} |
|
|
|
//锁定状态
|
|
|
@ -800,11 +800,30 @@ public class BaseVehicleRest implements BaseVehicleFeign { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void exportExcel(BaseVehicleExportQuery query) throws ParseException{ |
|
|
|
public void exportExcel(BaseVehicleExportQuery query) throws ParseException { |
|
|
|
//得到所有要导出的数据
|
|
|
|
List<BaseVehicleExportVo> baseVehicleExportVoList = baseVehicleService.listExcel(query); |
|
|
|
for (BaseVehicleExportVo baseVehicleExportVo : baseVehicleExportVoList) { |
|
|
|
String isProblemVeh = baseVehicleExportVo.getIsProblemVeh(); |
|
|
|
if (StringUtils.isNotBlank(isProblemVeh)) { |
|
|
|
if (isProblemVeh.equals("0")) { |
|
|
|
isProblemVeh = "无问题"; |
|
|
|
} else { |
|
|
|
isProblemVeh = "有问题"; |
|
|
|
} |
|
|
|
} |
|
|
|
baseVehicleExportVo.setIsProblemVeh(isProblemVeh); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if (StringUtils.isNotBlank(baseVehicleExportVo.getArrivalDate())) { |
|
|
|
String arrivalDate = baseVehicleExportVo.getArrivalDate(); |
|
|
|
Date parseArrivalDate = sdf.parse(arrivalDate); |
|
|
|
baseVehicleExportVo.setArrivalDate(sdf.format(parseArrivalDate)); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(baseVehicleExportVo.getReturnDate())) { |
|
|
|
String returnDate = baseVehicleExportVo.getReturnDate(); |
|
|
|
Date parseReturnDate = sdf.parse(returnDate); |
|
|
|
baseVehicleExportVo.setReturnDate(sdf.format(parseReturnDate)); |
|
|
|
} |
|
|
|
String manPurOrderTypeValue = baseVehicleExportVo.getManPurOrderTypeValue(); |
|
|
|
if (("外采").equals(manPurOrderTypeValue)) { |
|
|
|
baseVehicleExportVo.setLibraryAge(Long.parseLong("0")); |
|
|
@ -813,12 +832,13 @@ public class BaseVehicleRest implements BaseVehicleFeign { |
|
|
|
if (baseVehicleExportVo.getPriceDate() != null) { |
|
|
|
//厂家入库日期
|
|
|
|
Date priceDate = sdf.parse(baseVehicleExportVo.getPriceDate()); |
|
|
|
if (baseVehicleExportVo.getSolidDate() != null){ |
|
|
|
//买断日期
|
|
|
|
Date solidDate = sdf.parse(baseVehicleExportVo.getSolidDate()); |
|
|
|
if (baseVehicleExportVo.getSolidDate() != null) { |
|
|
|
//买断日期
|
|
|
|
Date solidDate = sdf.parse(baseVehicleExportVo.getSolidDate()); |
|
|
|
int i = priceDate.compareTo(solidDate); |
|
|
|
long betweenDay = DateUtil.between(priceDate, solidDate, DateUnit.DAY); |
|
|
|
baseVehicleExportVo.setLibraryAge(betweenDay * i * -1); |
|
|
|
baseVehicleExportVo.setSolidDate(sdf.format(solidDate)); |
|
|
|
} else { |
|
|
|
String today = DateUtil.today(); |
|
|
|
DateTime currentDate = DateUtil.parse(today); |
|
|
@ -826,6 +846,7 @@ public class BaseVehicleRest implements BaseVehicleFeign { |
|
|
|
long betweenDay = DateUtil.between(priceDate, currentDate, DateUnit.DAY); |
|
|
|
baseVehicleExportVo.setLibraryAge(betweenDay * i * -1); |
|
|
|
} |
|
|
|
baseVehicleExportVo.setPriceDate(sdf.format(priceDate)); |
|
|
|
} |
|
|
|
} |
|
|
|
//公司库龄
|
|
|
@ -838,6 +859,7 @@ public class BaseVehicleRest implements BaseVehicleFeign { |
|
|
|
int i = departureDate.compareTo(salesDate); |
|
|
|
long betweenDay = DateUtil.between(departureDate, salesDate, DateUnit.DAY); |
|
|
|
baseVehicleExportVo.setOrgLibraryAge(betweenDay * i * -1); |
|
|
|
baseVehicleExportVo.setSalesDate(sdf.format(salesDate)); |
|
|
|
} else { |
|
|
|
String today = DateUtil.today(); |
|
|
|
DateTime currentDate = DateUtil.parse(today); |
|
|
@ -845,12 +867,12 @@ public class BaseVehicleRest implements BaseVehicleFeign { |
|
|
|
long betweenDay = DateUtil.between(departureDate, currentDate, DateUnit.DAY); |
|
|
|
baseVehicleExportVo.setOrgLibraryAge(betweenDay * i * -1); |
|
|
|
} |
|
|
|
baseVehicleExportVo.setDepartureDate(sdf.format(departureDate)); |
|
|
|
} |
|
|
|
//买断库龄
|
|
|
|
if (baseVehicleExportVo.getSolidDate() != null) { |
|
|
|
//买断日期
|
|
|
|
Date solidDate = sdf.parse(baseVehicleExportVo.getSolidDate()); |
|
|
|
|
|
|
|
if (baseVehicleExportVo.getSalesDate() != null) { |
|
|
|
//销售日期
|
|
|
|
Date salesDate = sdf.parse(baseVehicleExportVo.getSalesDate()); |
|
|
@ -864,11 +886,13 @@ public class BaseVehicleRest implements BaseVehicleFeign { |
|
|
|
long betweenDay = DateUtil.between(solidDate, currentDate, DateUnit.DAY); |
|
|
|
baseVehicleExportVo.setSettlementLibraryAge(betweenDay * i * -1); |
|
|
|
} |
|
|
|
baseVehicleExportVo.setSolidDate(sdf.format(solidDate)); |
|
|
|
} |
|
|
|
String vinNo = baseVehicleExportVo.getVinNo(); |
|
|
|
if (StringUtils.isNotBlank(vinNo)) { |
|
|
|
baseVehicleExportVo.setLastVinNo(vinNo.substring(vinNo.length() - 8)); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//定义导出的excel名字
|
|
|
|
String excelName = "车辆台账列表"; |
|
|
|