导出修改
parent
376c9a1c8e
commit
4816edf028
|
|
@ -7,6 +7,7 @@ import com.njzscloud.supervisory.biz.pojo.entity.BizCompanyEntity;
|
|||
import com.njzscloud.supervisory.biz.pojo.entity.BizTruckEntity;
|
||||
import com.njzscloud.supervisory.device.pojo.entity.DeviceLocalizerEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderExportDetailResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderExportResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.PaymentContextResult;
|
||||
|
|
@ -25,6 +26,8 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
|||
|
||||
List<OrderExportResult> exportList(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
List<OrderExportDetailResult> exportDetailList(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
OrderPagingResult detail(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
OrderPagingResult pendingOrder(@Param("ew") QueryWrapper<Object> ew);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package com.njzscloud.supervisory.order.pojo.result;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class OrderExportDetailResult {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String expenseItemName;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private BigDecimal settleMoney;
|
||||
|
||||
}
|
||||
|
|
@ -11,6 +11,11 @@ import lombok.experimental.Accessors;
|
|||
@Accessors(chain = true)
|
||||
public class OrderExportResult {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
|
|
@ -61,6 +66,10 @@ public class OrderExportResult {
|
|||
*/
|
||||
private String areaName;
|
||||
|
||||
private String townName;
|
||||
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 入场磅重(吨)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import cn.hutool.core.thread.ThreadUtil;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||
import cn.hutool.extra.qrcode.QrConfig;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
|
@ -1546,6 +1547,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
LocalDateTime startTime = searchParam.getStartTime();
|
||||
LocalDateTime endTime = searchParam.getEndTime();
|
||||
QueryWrapper<OrderPagingResult> ew = Wrappers.query();
|
||||
ew.eq(null != searchParam.getStationId() && searchParam.getStationId() > 0, "a.station_id", searchParam.getStationId());
|
||||
ew.like(StrUtil.isNotBlank(searchParam.getSn()), "a.sn", searchParam.getSn());
|
||||
ew.like(StrUtil.isNotBlank(searchParam.getLicensePlate()), "d.license_plate", searchParam.getLicensePlate());
|
||||
ew.like(StrUtil.isNotBlank(searchParam.getPhone()), "a.phone", searchParam.getPhone());
|
||||
|
|
@ -1555,6 +1557,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
ew.eq(null != searchParam.getTransCompanyId(), "a.trans_company_id", searchParam.getTransCompanyId());
|
||||
historyEW(searchParam, null, ew);
|
||||
List<OrderExportResult> list = baseMapper.exportList(ew);
|
||||
List<OrderExportDetailResult> detailResults = baseMapper.exportDetailList(ew);
|
||||
List<Map<String, Object>> downList = new ArrayList<>();
|
||||
int i = 1;
|
||||
for (OrderExportResult result : list) {
|
||||
|
|
@ -1569,10 +1572,24 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
map.put("进场时间", result.getInTime());
|
||||
map.put("产废单位", result.getCfCompanyName());
|
||||
map.put("所属区域", result.getAreaName());
|
||||
map.put("产废地址", result.getTownName() + result.getAddress());
|
||||
map.put("入场磅重(吨)", result.getRoughWeight());
|
||||
map.put("皮重(吨)", result.getTareWeight());
|
||||
map.put("净重(吨)", result.getSettleWeight());
|
||||
map.put("驾驶员", result.getDriverName());
|
||||
if (null != detailResults && detailResults.size() > 0) {
|
||||
List<OrderExportDetailResult> details = detailResults.stream().filter(t -> t.getOrderId()
|
||||
.equals(result.getId())).collect(Collectors.toList());
|
||||
List<String> detailList = new ArrayList<>();
|
||||
if (details.size() > 0) {
|
||||
for (OrderExportDetailResult detailResult: details) {
|
||||
detailList.add(detailResult.getExpenseItemName() + detailResult.getSettleMoney() + "元");
|
||||
}
|
||||
map.put("明细", JSONObject.toJSONString(detailList));
|
||||
} else {
|
||||
map.put("明细", "");
|
||||
}
|
||||
}
|
||||
map.put("备注", result.getCheckerMemo());
|
||||
downList.add(map);
|
||||
i++;
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@
|
|||
</resultMap>
|
||||
|
||||
<resultMap id="OrderExportResultMap" type="com.njzscloud.supervisory.order.pojo.result.OrderExportResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="transTime" column="trans_time"/>
|
||||
<result property="stationName" column="station_name"/>
|
||||
<result property="transCompanyName" column="trans_company_name"/>
|
||||
|
|
@ -216,6 +217,12 @@
|
|||
<result property="checkerMemo" column="checker_memo"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="OrderExportDetailResultMap" type="com.njzscloud.supervisory.order.pojo.result.OrderExportDetailResult">
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="expenseItemName" column="expense_item_name"/>
|
||||
<result property="settleMoney" column="settle_money"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="paging" resultMap="OrderPagingResultMap">
|
||||
<include refid="base_select"/>
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
|
|
@ -225,37 +232,58 @@
|
|||
|
||||
<select id="exportList" resultMap="OrderExportResultMap">
|
||||
SELECT
|
||||
a.id,
|
||||
DATE_FORMAT( a.trans_time, '%Y-%m-%d' ) AS trans_time,
|
||||
b.station_name,
|
||||
c.company_name AS trans_company_name,
|
||||
g.company_name AS trans_company_name,
|
||||
d.license_plate,
|
||||
e.txt AS truck_category,
|
||||
a.estimated_quantity,
|
||||
TIME_FORMAT( f.in_time, '%H:%i' ) AS in_time,
|
||||
g.nickname AS cf_company_name,
|
||||
TIME_FORMAT( ocio.in_time, '%H:%i' ) AS in_time,
|
||||
su.nickname AS cf_company_name,
|
||||
h.area_name,
|
||||
ROUND( f.rough_weight / 1000, 2 ) AS rough_weight,
|
||||
ROUND( f.tare_weight / 1000, 2 ) AS tare_weight,
|
||||
ROUND( f.settle_weight / 1000, 2 ) AS settle_weight,
|
||||
i.driver_name,
|
||||
h.town_name,
|
||||
h.address,
|
||||
ROUND( ocio.rough_weight / 1000, 2 ) AS rough_weight,
|
||||
ROUND( ocio.tare_weight / 1000, 2 ) AS tare_weight,
|
||||
ROUND( ocio.settle_weight / 1000, 2 ) AS settle_weight,
|
||||
f.driver_name,
|
||||
a.checker_memo
|
||||
FROM
|
||||
order_info a
|
||||
LEFT JOIN biz_company b ON b.id = a.station_id
|
||||
LEFT JOIN biz_company c ON c.id = a.trans_company_id
|
||||
LEFT JOIN biz_company g ON g.id = a.trans_company_id
|
||||
LEFT JOIN biz_truck d ON d.id = a.truck_id
|
||||
LEFT JOIN sys_dict_item e ON d.truck_category = e.val
|
||||
AND e.dict_key = 'vehicle_type'
|
||||
LEFT JOIN order_car_in_out f ON f.id = a.car_in_out_id
|
||||
LEFT JOIN sys_user g ON a.user_id = g.id
|
||||
LEFT JOIN order_car_in_out ocio ON ocio.id = a.car_in_out_id
|
||||
LEFT JOIN sys_user su ON a.user_id = su.id
|
||||
LEFT JOIN order_cargo_place h ON h.id = a.cargo_place_id
|
||||
LEFT JOIN biz_driver i ON i.id = a.driver_id
|
||||
LEFT JOIN biz_driver f ON f.id = a.driver_id
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
ORDER BY
|
||||
a.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="exportDetailList" resultMap="OrderExportDetailResultMap">
|
||||
SELECT
|
||||
oei.order_id,
|
||||
oei.expense_item_name,
|
||||
oei.settle_money
|
||||
FROM
|
||||
order_expense_items oei
|
||||
LEFT JOIN order_info a ON a.id = oei.order_id
|
||||
LEFT JOIN biz_company g ON g.id = a.trans_company_id
|
||||
LEFT JOIN biz_truck d ON d.id = a.truck_id
|
||||
LEFT JOIN biz_driver f ON f.id = a.driver_id
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
ORDER BY
|
||||
oei.create_time DESC
|
||||
</select>
|
||||
<select id="detail" resultMap="OrderPagingResultMap">
|
||||
<include refid="base_select"/>
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
|
|
|
|||
Loading…
Reference in New Issue