Merge remote-tracking branch 'gitee/0.8.X' into 0.8.X
This commit is contained in:
@@ -65,8 +65,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<!-- <el-table-column label="逻辑库位" align="center" prop="warehouseName" /> -->
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="250">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
@@ -75,17 +75,32 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip /> -->
|
||||
<el-table-column label="发货时间" align="center" prop="exportTime" />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<!-- <el-table-column label="出库状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
<el-table-column label="车牌号" align="center" prop="bindLicensePlate" />
|
||||
<el-table-column label="目标客户" align="center" prop="bindConsigneeUnit" />
|
||||
<el-table-column label="发货单位" align="center" prop="bindSenderUnit" />
|
||||
<el-table-column label="负责人" align="center" prop="bindPrincipal">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" width="200">
|
||||
<template slot="reference">
|
||||
<span style="color: #409eff;">{{ scope.row.bindPrincipal }}</span>
|
||||
</template>
|
||||
<el-descriptions :column="2">
|
||||
<el-descriptions-item label="负责人">{{ scope.row.bindPrincipal }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号">{{ scope.row.bindPrincipalPhone }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
@@ -148,6 +163,7 @@ export default {
|
||||
itemSpecification: '',
|
||||
itemMaterial: '',
|
||||
itemManufacturer: '',
|
||||
includeBindInfo: true,
|
||||
},
|
||||
loading: false,
|
||||
}
|
||||
@@ -177,8 +193,9 @@ export default {
|
||||
},
|
||||
// 导出
|
||||
exportData() {
|
||||
this.download('wms/materialCoil/export', {
|
||||
this.download('wms/materialCoil/exportDelivery', {
|
||||
coilIds: this.list.map(item => item.coilId).join(','),
|
||||
// 传了status为1则会使用发货时间作为筛选条件查询,且导出后的excel会包含发货时间和发货人
|
||||
status: 1
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -16,16 +18,49 @@ public class WmsCoilBindInfoVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 钢卷ID */
|
||||
private Long coilId;
|
||||
|
||||
/** 发货单明细ID */
|
||||
private Long detailId;
|
||||
|
||||
// -------------------- 发货计划(plan) --------------------
|
||||
private Long planId;
|
||||
|
||||
private String planName;
|
||||
|
||||
private Date planDate;
|
||||
|
||||
// -------------------- 发货单主表(waybill) --------------------
|
||||
private Long waybillId;
|
||||
|
||||
private String waybillNo;
|
||||
|
||||
private String waybillName;
|
||||
|
||||
private Long planId;
|
||||
private String planName;
|
||||
private Date planDate;
|
||||
private String licensePlate;
|
||||
|
||||
private String consigneeUnit;
|
||||
|
||||
private String senderUnit;
|
||||
|
||||
private Date deliveryTime;
|
||||
|
||||
private String weighbridge;
|
||||
|
||||
private String salesPerson;
|
||||
|
||||
private String principal;
|
||||
|
||||
private String principalPhone;
|
||||
|
||||
private Long waybillStatus;
|
||||
|
||||
private String waybillRemark;
|
||||
|
||||
// -------------------- 发货单明细补充字段(detail) --------------------
|
||||
private String detailSettlementType;
|
||||
|
||||
private BigDecimal detailUnitPrice;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@ public class WmsMaterialCoilDeliveryExportVo extends WmsMaterialCoilExportVo {
|
||||
*/
|
||||
private Long coilId;
|
||||
|
||||
// 发货人
|
||||
@ExcelProperty(value = "发货人")
|
||||
private String exportBy;
|
||||
|
||||
// -------------------- 发货计划(plan) --------------------
|
||||
private Long planId;
|
||||
|
||||
|
||||
@@ -353,8 +353,69 @@ public class WmsMaterialCoilVo extends BaseEntity {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date bindPlanDate;
|
||||
|
||||
|
||||
// 父钢卷id
|
||||
private String parentCoilId;
|
||||
|
||||
// ========== 补充的发货绑定信息字段 ==========
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String bindLicensePlate;
|
||||
|
||||
/**
|
||||
* 收货单位
|
||||
*/
|
||||
private String bindConsigneeUnit;
|
||||
|
||||
/**
|
||||
* 发货单位
|
||||
*/
|
||||
private String bindSenderUnit;
|
||||
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date bindDeliveryTime;
|
||||
|
||||
/**
|
||||
* 地磅
|
||||
*/
|
||||
private String bindWeighbridge;
|
||||
|
||||
/**
|
||||
* 销售人员
|
||||
*/
|
||||
private String bindSalesPerson;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String bindPrincipal;
|
||||
|
||||
/**
|
||||
* 负责人电话
|
||||
*/
|
||||
private String bindPrincipalPhone;
|
||||
|
||||
/**
|
||||
* 运单状态
|
||||
*/
|
||||
private Long bindWaybillStatus;
|
||||
|
||||
/**
|
||||
* 运单备注
|
||||
*/
|
||||
private String bindWaybillRemark;
|
||||
|
||||
/**
|
||||
* 明细结算类型
|
||||
*/
|
||||
private String bindDetailSettlementType;
|
||||
|
||||
/**
|
||||
* 明细单价
|
||||
*/
|
||||
private BigDecimal bindDetailUnitPrice;
|
||||
}
|
||||
|
||||
|
||||
@@ -338,6 +338,20 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
vo.setBindPlanId(bind.getPlanId());
|
||||
vo.setBindPlanName(bind.getPlanName());
|
||||
vo.setBindPlanDate(bind.getPlanDate());
|
||||
|
||||
// 补充设置更多的绑定信息字段
|
||||
vo.setBindLicensePlate(bind.getLicensePlate());
|
||||
vo.setBindConsigneeUnit(bind.getConsigneeUnit());
|
||||
vo.setBindSenderUnit(bind.getSenderUnit());
|
||||
vo.setBindDeliveryTime(bind.getDeliveryTime());
|
||||
vo.setBindWeighbridge(bind.getWeighbridge());
|
||||
vo.setBindSalesPerson(bind.getSalesPerson());
|
||||
vo.setBindPrincipal(bind.getPrincipal());
|
||||
vo.setBindPrincipalPhone(bind.getPrincipalPhone());
|
||||
vo.setBindWaybillStatus(bind.getWaybillStatus());
|
||||
vo.setBindWaybillRemark(bind.getWaybillRemark());
|
||||
vo.setBindDetailSettlementType(bind.getDetailSettlementType());
|
||||
vo.setBindDetailUnitPrice(bind.getDetailUnitPrice());
|
||||
} else {
|
||||
vo.setBound(Boolean.FALSE);
|
||||
}
|
||||
@@ -616,7 +630,6 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.apply("COALESCE(ca.abnormal_count, 0) >= {0}", bo.getMinAbnormalCount());
|
||||
}
|
||||
// 排序:
|
||||
// - 当前端需要绑定信息(includeBindInfo=true)时:优先展示“已绑定实际库位”的钢卷(actual_warehouse_id 非空在前)
|
||||
// 再按实际库位ID升序(库位ID为自增,升序即可满足“先生成的库位在前”)
|
||||
// - 否则:保持原有创建时间倒序
|
||||
if (Boolean.TRUE.equals(bo.getOrderBy())) {
|
||||
@@ -2375,7 +2388,35 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
if (coilIds.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return baseMapper.selectDeliveryExportListByCoilIds(coilIds);
|
||||
List<WmsMaterialCoilDeliveryExportVo> wmsMaterialCoilDeliveryExportVos = baseMapper.selectDeliveryExportListByCoilIds(coilIds);
|
||||
// 遍历数据,根据状态替换日期字段,并处理空值兜底
|
||||
wmsMaterialCoilDeliveryExportVos.stream().forEach(vo -> {
|
||||
// 判断查询条件中的status是否为1(已发货)
|
||||
if (bo.getStatus() != null && bo.getStatus() == 1) {
|
||||
Date finalDate = null;
|
||||
// 1. 优先使用发货时间
|
||||
if (vo.getExportTime() != null) {
|
||||
finalDate = vo.getExportTime();
|
||||
}
|
||||
// 2. 发货时间为空时,使用更新时间兜底
|
||||
else if (vo.getUpdateTime() != null) {
|
||||
finalDate = vo.getUpdateTime();
|
||||
}
|
||||
// 3. 若更新时间也为空,保留原有createTime(避免日期字段为空)
|
||||
else {
|
||||
finalDate = vo.getCreateTime();
|
||||
}
|
||||
// 赋值最终的日期
|
||||
vo.setCreateTime(finalDate);
|
||||
}
|
||||
// 非1的情况,保持原有create_time不变
|
||||
|
||||
// 如果是dataType=0的历史数据,将实际库区设置为null
|
||||
if (vo.getDataType() != null && vo.getDataType() == 0) {
|
||||
vo.setActualWarehouseName(null);
|
||||
}
|
||||
});
|
||||
return wmsMaterialCoilDeliveryExportVos;
|
||||
}
|
||||
|
||||
private List<Long> parseCsvLongs(String csv) {
|
||||
|
||||
@@ -30,27 +30,63 @@
|
||||
<resultMap type="com.klp.domain.vo.WmsCoilBindInfoVo" id="WmsCoilBindInfoResult">
|
||||
<result property="coilId" column="coil_id"/>
|
||||
<result property="detailId" column="detail_id"/>
|
||||
<result property="waybillId" column="waybill_id"/>
|
||||
<result property="waybillNo" column="waybill_no"/>
|
||||
<result property="waybillName" column="waybill_name"/>
|
||||
|
||||
<!-- 发货计划 -->
|
||||
<result property="planId" column="plan_id"/>
|
||||
<result property="planName" column="plan_name"/>
|
||||
<result property="planDate" column="plan_date"/>
|
||||
|
||||
<!-- 发货单主表 -->
|
||||
<result property="waybillId" column="waybill_id"/>
|
||||
<result property="waybillNo" column="waybill_no"/>
|
||||
<result property="waybillName" column="waybill_name"/>
|
||||
<result property="licensePlate" column="license_plate"/>
|
||||
<result property="consigneeUnit" column="consignee_unit"/>
|
||||
<result property="senderUnit" column="sender_unit"/>
|
||||
<result property="deliveryTime" column="delivery_time"/>
|
||||
<result property="weighbridge" column="weighbridge"/>
|
||||
<result property="salesPerson" column="sales_person"/>
|
||||
<result property="principal" column="principal"/>
|
||||
<result property="principalPhone" column="principal_phone"/>
|
||||
<result property="waybillStatus" column="status"/>
|
||||
<result property="waybillRemark" column="remark"/>
|
||||
|
||||
<!-- 发货单明细补充字段 -->
|
||||
<result property="detailSettlementType" column="settlement_type"/>
|
||||
<result property="detailUnitPrice" column="unit_price"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectBindInfoByCoilIds" resultMap="WmsCoilBindInfoResult">
|
||||
SELECT
|
||||
d.coil_id,
|
||||
d.detail_id,
|
||||
|
||||
-- 发货单主表
|
||||
w.waybill_id,
|
||||
w.waybill_no,
|
||||
w.waybill_name,
|
||||
w.license_plate,
|
||||
w.consignee_unit,
|
||||
w.sender_unit,
|
||||
w.delivery_time,
|
||||
w.weighbridge,
|
||||
w.sales_person,
|
||||
w.principal,
|
||||
w.principal_phone,
|
||||
w.status,
|
||||
w.remark,
|
||||
|
||||
-- 发货计划
|
||||
p.plan_id,
|
||||
p.plan_name,
|
||||
p.plan_date
|
||||
p.plan_date,
|
||||
|
||||
-- 发货单明细补充字段
|
||||
d.settlement_type,
|
||||
d.unit_price
|
||||
FROM wms_delivery_waybill_detail d
|
||||
INNER JOIN wms_delivery_waybill w ON w.waybill_id = d.waybill_id AND w.del_flag = 0
|
||||
INNER JOIN wms_delivery_plan p ON p.plan_id = w.plan_id AND p.del_flag = 0
|
||||
LEFT JOIN wms_delivery_waybill w ON w.waybill_id = d.waybill_id AND w.del_flag = 0
|
||||
LEFT JOIN wms_delivery_plan p ON p.plan_id = w.plan_id AND p.del_flag = 0
|
||||
WHERE d.del_flag = 0
|
||||
AND d.coil_id IN
|
||||
<foreach collection="coilIds" item="id" open="(" close=")" separator=",">
|
||||
@@ -62,12 +98,30 @@
|
||||
SELECT
|
||||
d.coil_id,
|
||||
d.detail_id,
|
||||
|
||||
-- 发货单主表
|
||||
w.waybill_id,
|
||||
w.waybill_no,
|
||||
w.waybill_name,
|
||||
w.license_plate,
|
||||
w.consignee_unit,
|
||||
w.sender_unit,
|
||||
w.delivery_time,
|
||||
w.weighbridge,
|
||||
w.sales_person,
|
||||
w.principal,
|
||||
w.principal_phone,
|
||||
w.status,
|
||||
w.remark,
|
||||
|
||||
-- 发货计划
|
||||
p.plan_id,
|
||||
p.plan_name,
|
||||
p.plan_date
|
||||
p.plan_date,
|
||||
|
||||
-- 发货单明细补充字段
|
||||
d.settlement_type,
|
||||
d.unit_price
|
||||
FROM wms_delivery_waybill_detail d
|
||||
INNER JOIN wms_delivery_waybill w ON w.waybill_id = d.waybill_id AND w.del_flag = 0
|
||||
INNER JOIN wms_delivery_plan p ON p.plan_id = w.plan_id AND p.del_flag = 0
|
||||
|
||||
@@ -448,6 +448,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
-- 钢卷ID
|
||||
mc.coil_id AS coilId,
|
||||
-- 发货人
|
||||
mc.export_by AS exportBy,
|
||||
-- 类型(中文显示)
|
||||
CASE
|
||||
WHEN mc.item_type = 'product' THEN '成品'
|
||||
|
||||
Reference in New Issue
Block a user