增加查看哪些产品没有
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user