增加查看哪些产品没有
This commit is contained in:
+15
@@ -91,6 +91,21 @@ public class TabOrderMonitorController extends BaseController
|
||||
return success(data);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:orderSource:list')")
|
||||
@PostMapping("/checkProducts/orders")
|
||||
public AjaxResult listOrdersByProduct(@RequestBody TabOrderMonitorQuery query)
|
||||
{
|
||||
if (!hasRequiredFilters(query))
|
||||
{
|
||||
return error("customerCodes and pickup time required");
|
||||
}
|
||||
if (StringUtils.isEmpty(query.getProductCode()))
|
||||
{
|
||||
return error("productCode required");
|
||||
}
|
||||
return success(tabOrderMonitorService.selectOrderIdsByProduct(query));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('monitor:orderSource:sync')")
|
||||
@Log(title = "order source sync filter", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/syncByFilter")
|
||||
|
||||
@@ -25,6 +25,8 @@ public class TabOrderMonitorQuery implements Serializable
|
||||
private String orgOrderId;
|
||||
/** 转单号 TRANSFER_ORDER_ID */
|
||||
private String transferOrderId;
|
||||
/** 上游产品代码 PRODUCT_CODE(产品比对点进订单号时使用) */
|
||||
private String productCode;
|
||||
/** 分批同步计费每批条数 */
|
||||
private Integer batchSize;
|
||||
}
|
||||
|
||||
@@ -32,4 +32,9 @@ public interface OracleUpstreamOrderMapper
|
||||
List<Map<String, Object>> selectTabOrderProductCodes(
|
||||
@Param("orderTable") String orderTable,
|
||||
@Param("query") TabOrderMonitorQuery query);
|
||||
|
||||
/** Order ids for one product code under the same filters (no pagination). */
|
||||
List<Map<String, Object>> selectTabOrderIdsByProduct(
|
||||
@Param("orderTable") String orderTable,
|
||||
@Param("query") TabOrderMonitorQuery query);
|
||||
}
|
||||
|
||||
@@ -81,6 +81,38 @@ public class TabOrderMonitorService
|
||||
}
|
||||
}
|
||||
|
||||
@DataSource(DataSourceType.SLAVE)
|
||||
public List<Map<String, Object>> selectOrderIdsByProduct(TabOrderMonitorQuery query)
|
||||
{
|
||||
validate(query);
|
||||
if (StringUtils.isEmpty(query.getProductCode()))
|
||||
{
|
||||
throw new ServiceException("productCode required");
|
||||
}
|
||||
query.setProductCode(query.getProductCode().trim());
|
||||
String table = resolveTable();
|
||||
try
|
||||
{
|
||||
PageHelper.clearPage();
|
||||
long t0 = System.currentTimeMillis();
|
||||
List<Map<String, Object>> rows = oracleUpstreamOrderMapper.selectTabOrderIdsByProduct(table, query);
|
||||
log.info("oracle tab_order ids by product code={} customerSize={} begin={} end={} rows={} costMs={}",
|
||||
query.getProductCode(),
|
||||
query.getCustomerCodes() == null ? 0 : query.getCustomerCodes().size(),
|
||||
query.getBeginTime(), query.getEndTime(),
|
||||
rows == null ? 0 : rows.size(), System.currentTimeMillis() - t0);
|
||||
return rows == null ? Collections.emptyList() : rows;
|
||||
}
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
throw new ServiceException("Oracle TAB_ORDER ids by product failed: " + e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
PageHelper.clearPage();
|
||||
}
|
||||
}
|
||||
|
||||
@DataSource(DataSourceType.SLAVE)
|
||||
public List<TabOrderMonitorVo> selectPage(TabOrderMonitorQuery query, int pageNum, int pageSize)
|
||||
{
|
||||
|
||||
@@ -121,4 +121,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ORDER BY o.CUSTOMER_CODE, o.PRODUCT_CODE
|
||||
</select>
|
||||
|
||||
<!-- Order numbers for one upstream product under the same filters. -->
|
||||
<select id="selectTabOrderIdsByProduct" resultType="java.util.HashMap">
|
||||
SELECT o.ORDER_ID AS ORDER_ID,
|
||||
o.ORG_ORDER_ID AS ORG_ORDER_ID,
|
||||
o.TRANSFER_ORDER_ID AS TRANSFER_ORDER_ID,
|
||||
o.CUSTOMER_CODE AS CUSTOMER_CODE,
|
||||
o.PRODUCT_CODE AS PRODUCT_CODE,
|
||||
o.PRODUCT_NAME AS PRODUCT_NAME,
|
||||
o.PICKUP_DATE AS PICKUP_DATE
|
||||
FROM ${orderTable} o
|
||||
WHERE
|
||||
<include refid="tabOrderMonitorWhere"/>
|
||||
AND o.PRODUCT_CODE = #{query.productCode}
|
||||
ORDER BY o.PICKUP_DATE DESC, o.ORDER_ID DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -57,3 +57,12 @@ export function checkOrderSourceProducts(data) {
|
||||
timeout: 180000
|
||||
})
|
||||
}
|
||||
|
||||
export function listOrderSourceOrdersByProduct(data) {
|
||||
return request({
|
||||
url: '/monitor/orderSource/checkProducts/orders',
|
||||
method: 'post',
|
||||
data,
|
||||
timeout: 120000
|
||||
})
|
||||
}
|
||||
|
||||
+61
-5
@@ -33,9 +33,10 @@
|
||||
<el-table-column prop="mappedCode" label="映射后代码" min-width="120" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.mappedCode || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderCount" label="订单数" width="90" align="center" />
|
||||
<el-table-column label="示例订单" min-width="180" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ (row.sampleOrderIds || []).join(', ') || '-' }}</template>
|
||||
<el-table-column prop="orderCount" label="订单数" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" :title="'点击查订单号'" @click="openOrders(row)">{{ row.orderCount ?? 0 }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-empty v-if="!(result.missingProducts || []).length" description="未发现缺失产品" />
|
||||
@@ -57,7 +58,11 @@
|
||||
<el-table-column label="命中方式" min-width="140" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ hitText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderCount" label="订单数" width="90" align="center" />
|
||||
<el-table-column prop="orderCount" label="订单数" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" :title="'点击查订单号'" @click="openOrders(row)">{{ row.orderCount ?? 0 }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="packageTabLabel" name="package">
|
||||
@@ -71,17 +76,33 @@
|
||||
</el-tabs>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="orderDialogVisible" :title="orderDialogTitle" width="820px" append-to-body destroy-on-close>
|
||||
<el-table v-loading="orderLoading" :data="orderRows" border size="small" max-height="480">
|
||||
<el-table-column prop="ORDER_ID" label="客户订单号" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="ORG_ORDER_ID" label="运单号" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="TRANSFER_ORDER_ID" label="转单号" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="PICKUP_DATE" label="提货时间" width="170" align="center" />
|
||||
</el-table>
|
||||
<el-empty v-if="!orderLoading && !orderRows.length" description="未查到订单" />
|
||||
</el-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { checkOrderSourceProducts } from '@/api/monitor/orderSource'
|
||||
import { checkOrderSourceProducts, listOrderSourceOrdersByProduct } from '@/api/monitor/orderSource'
|
||||
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const result = ref(null)
|
||||
const activeTab = ref('missing')
|
||||
const lastQuery = ref(null)
|
||||
|
||||
const orderDialogVisible = ref(false)
|
||||
const orderLoading = ref(false)
|
||||
const orderRows = ref([])
|
||||
const orderDialogTitle = ref('产品订单号')
|
||||
|
||||
const missingTabLabel = computed(() => {
|
||||
const n = result.value?.missingCount ?? 0
|
||||
@@ -100,11 +121,46 @@ function hitText(row) {
|
||||
return '无映射'
|
||||
}
|
||||
|
||||
function normalizeRow(row) {
|
||||
if (!row || typeof row !== 'object') return row
|
||||
const out = { ...row }
|
||||
Object.keys(row).forEach(k => {
|
||||
if (!k) return
|
||||
out[k.toUpperCase()] = row[k]
|
||||
})
|
||||
return out
|
||||
}
|
||||
|
||||
function openOrders(row) {
|
||||
if (!row || !row.upstreamCode || !lastQuery.value) {
|
||||
ElMessage.warning('请先选择客户和提货时间')
|
||||
return
|
||||
}
|
||||
const q = {
|
||||
...lastQuery.value,
|
||||
customerCodes: row.customerCode ? [row.customerCode] : lastQuery.value.customerCodes,
|
||||
productCode: row.upstreamCode
|
||||
}
|
||||
orderDialogTitle.value = '产品订单号: ' + row.upstreamCode
|
||||
orderDialogVisible.value = true
|
||||
orderRows.value = []
|
||||
orderLoading.value = true
|
||||
listOrderSourceOrdersByProduct(q).then(res => {
|
||||
const list = Array.isArray(res.data) ? res.data : []
|
||||
orderRows.value = list.map(normalizeRow)
|
||||
}).catch(() => {
|
||||
orderRows.value = []
|
||||
}).finally(() => {
|
||||
orderLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function open(query) {
|
||||
if (!query || !query.customerCodes || !query.beginTime || !query.endTime) {
|
||||
ElMessage.warning('请先选择客户和提货时间')
|
||||
return
|
||||
}
|
||||
lastQuery.value = { ...query }
|
||||
visible.value = true
|
||||
activeTab.value = 'missing'
|
||||
result.value = null
|
||||
|
||||
Reference in New Issue
Block a user