提交 07a8dfa7 作者: zhangqiliang

墙盒品牌名称和墙盒导出优化

父级 3fca8360
......@@ -101,5 +101,5 @@ public class Contants {
public static final String export_wallBox_title = "序号,申请团队,安装订单号,安装单最近状态,区域,是否特殊申请,审核状态,物流状态,剩余时间,超时类型,数量,申请时间";
public static final String export_wallBox_field =
"no,supplierTeam,orderId,installStatus,regionName,ifEmergency,checkStatus,logisticsStatus,timeRemaining,ifTimeout,number,createdTime";
"id,supplierTeam,orderId,installStatus,regionName,ifEmergency,checkStatus,logisticsStatus,timeRemaining,ifTimeout,number,createdTime";
}
package com.boco.nbd.wios.export.impl;
import com.boco.nbd.wios.export.Export;
import com.boco.nbd.wios.manage.convert.WallboxApplyConvert;
import com.boco.nbd.wios.manage.entity.bo.SupplierBo;
import com.boco.nbd.wios.manage.entity.bo.SupplierVo;
import com.boco.nbd.wios.manage.entity.bo.WallboxApply;
import com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO;
import com.boco.nbd.wios.manage.entity.vo.WallboxApplyReqVO;
import com.boco.nbd.wios.manage.mapper.def.WallboxApplyMapper;
import com.boco.nbd.wios.manage.service.impl.SupplierService;
import com.boco.nbd.wios.manage.service.impl.WallboxApplyService;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.List;
/**
......@@ -25,14 +32,30 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
@Autowired
private WallboxApplyMapper wallboxApplyMapper;
@Autowired
private WallboxApplyService wallboxApplyService;
@Override
public List<WallboxApplyInstallListVO> getExportList(String json) throws Exception {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
WallboxApply condition = mapper.readValue(json, WallboxApply.class);
List<WallboxApplyInstallListVO> list =
wallboxApplyMapper.selectWallboxApplyListFromOrder(condition);
WallboxApplyReqVO condition = mapper.readValue(json, WallboxApplyReqVO.class);
List<WallboxApplyInstallListVO> list = wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(condition));
LocalDateTime currentTime = LocalDateTime.now();
for (WallboxApplyInstallListVO apply : list) {
Date createdDate = apply.getCreatedTime();
LocalDateTime createdTime = LocalDateTime.ofInstant(createdDate.toInstant(), ZoneId.systemDefault());
LocalDateTime endTime = createdTime.plusHours(24);
long remainingHours = currentTime.until(endTime, ChronoUnit.HOURS);
remainingHours = Math.max(remainingHours, 0); // 将剩余小时数限制在0-24之间
if (remainingHours == 0) {
apply.setIfTimeout(1L);
} else {
apply.setIfTimeout(0L);
}
apply.setTimeRemaining(Long.toString(remainingHours));
}
Long no = 1L;
for (WallboxApplyInstallListVO vo : list) {
vo.setId(no++);
......
......@@ -134,4 +134,11 @@ public class WallboxApplyInstallListVO {
*/
@ApiModelProperty(value = "所属区域")
private String areaName;
/**
* 墙盒品牌名称
*
* @mbg.generated
*/
@ApiModelProperty(value = "墙盒品牌名称")
private String wallboxModelName;
}
......@@ -123,11 +123,13 @@
t_wallbox_apply.area_name,
t_order.shipno as tracking_number,
t_order.status as install_status,
td.logistic_order deliveryLogisticOrder,td.logistic_company logisticCompany,td.sender sender,td.sender_phone senderPhone,td.receiver receiver
td.logistic_order deliveryLogisticOrder,td.logistic_company logisticCompany,td.sender sender,td.sender_phone senderPhone,td.receiver receiver,
tc.name wallboxModelName
FROM t_wallbox_apply
LEFT JOIN t_order ON t_wallbox_apply.order_id = t_order.id
left join t_region reg on reg.id=t_wallbox_apply.region_id
left join t_delivery td on td.install_order = t_wallbox_apply.order_id
left join t_oem_cascade tc on tc.id = t_wallbox_apply.wallbox_model
<where>
<if test="supplierTeam != null and supplierTeam != ''">and t_wallbox_apply.supplier_team like concat('%',
#{supplierTeam},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论