Commit e0530246 authored by chew's avatar chew

增加用户关联

parent 2127d84e
......@@ -24,10 +24,7 @@ public interface ScanMapper {
* - 字段非空时按 INSTR 逗号包含匹配(兼容 SCAN_HEADER 单值 vs 偏好逗号分隔多值)
*/
List<CustomerScanDetailVo> selectCustomerScanDetail(@Param("customerAddr") String customerAddr,
@Param("scanUser") String scanUser,
@Param("orderType") String orderType,
@Param("reference5") String reference5,
@Param("temperatureclass") String temperatureclass);
@Param("scanUser") String scanUser);
/**
* 查询 T_DOC_OUTBOUND_SCAN_HEADER 中所有出现过的 ORDERTYPE distinct 值(按字典序 ASC)
......
......@@ -94,21 +94,20 @@ public class ScanServiceImpl implements ScanService {
public List<CustomerScanDetailVo> queryCustomerScanDetail(CustomerScanQueryReq req, String userId) {
// 默认按当前用户的偏好过滤(关联 TMP_OUTBOUND_SCAN_ORDERTYPE:orderType/reference5/temperatureclass)
// 显式传入 orderType 时优先使用(其余两个字段仍走偏好;如需全覆盖可手动改 XML)
String orderType = req.getOrderType();
String orderType = null;
String reference5 = null;
String temperatureclass = null;
if (orderType == null || orderType.isEmpty()) {
OrderTypeRecordVo myType = orderTypeRecordMapper.selectByScanUser(userId);
if (myType != null) {
orderType = myType.getOrderType();
reference5 = myType.getReference5();
temperatureclass = myType.getTemperatureclass();
log.debug("客户查询使用用户偏好 orderType={}, reference5={}, temperatureclass={}, userId={}",
orderType, reference5, temperatureclass, userId);
}
}
return scanMapper.selectCustomerScanDetail(req.getCustomerAddr(), userId,
orderType, reference5, temperatureclass);
// if (orderType == null || orderType.isEmpty()) {
// OrderTypeRecordVo myType = orderTypeRecordMapper.selectByScanUser(userId);
// if (myType != null) {
// orderType = myType.getOrderType();
// reference5 = myType.getReference5();
// temperatureclass = myType.getTemperatureclass();
// log.debug("客户查询使用用户偏好 orderType={}, reference5={}, temperatureclass={}, userId={}",
// orderType, reference5, temperatureclass, userId);
// }
// }
return scanMapper.selectCustomerScanDetail(req.getCustomerAddr(), userId);
}
@Override
......
......@@ -50,8 +50,11 @@ spring.rabbitmq.publisher-returns=true
# ???????
spring.rabbitmq.listener.simple.acknowledge-mode=manual
# ?????SQL?????
logging.level.com.tms.auth.mapper=debug
# ===================== SQL日志打印(XML mapper SQL + 参数 + 结果行数)=====================
logging.level.com.ekingwin.tms_app.aidispatch.dao=debug
logging.level.com.ekingwin.tms_app.module.admin.dao=debug
logging.level.com.ekingwin.tms_app.module.cargo.dao=debug
logging.level.com.ekingwin.tms_app.module.cargo.outbound.dao=debug
logging.level.org.apache.ibatis=warn
logging.level.org.springframework=warn
logging.level.com.baomidou.mybatisplus=warn
\ No newline at end of file
......@@ -85,18 +85,18 @@
-- AND h.scan_user = #{scanUser, jdbcType=VARCHAR}
AND NVL(d.TALLY_QTY, 0) <![CDATA[ < ]]> NVL(d.ORDER_QTY, 0)
<if test="orderType != null and orderType != ''">
AND (NVL(h.ORDERTYPE, '') = ''
OR INSTR(',' || #{orderType, jdbcType=VARCHAR} || ',', ',' || h.ORDERTYPE || ',') <![CDATA[ > ]]> 0)
</if>
<if test="reference5 != null and reference5 != ''">
AND (NVL(h.REFERENCE5, '') = ''
OR INSTR(',' || #{reference5, jdbcType=VARCHAR} || ',', ',' || h.REFERENCE5 || ',') <![CDATA[ > ]]> 0)
</if>
<if test="temperatureclass != null and temperatureclass != ''">
AND (NVL(h.TEMPERATURECLASS, '') = ''
OR INSTR(',' || #{temperatureclass, jdbcType=VARCHAR} || ',', ',' || h.TEMPERATURECLASS || ',') <![CDATA[ > ]]> 0)
</if>
<!-- <if test="orderType != null and orderType != ''">-->
<!-- AND (NVL(h.ORDERTYPE, '') = ''-->
<!-- OR INSTR(',' || #{orderType, jdbcType=VARCHAR} || ',', ',' || h.ORDERTYPE || ',') <![CDATA[ > ]]> 0)-->
<!-- </if>-->
<!-- <if test="reference5 != null and reference5 != ''">-->
<!-- AND (NVL(h.REFERENCE5, '') = ''-->
<!-- OR INSTR(',' || #{reference5, jdbcType=VARCHAR} || ',', ',' || h.REFERENCE5 || ',') <![CDATA[ > ]]> 0)-->
<!-- </if>-->
<!-- <if test="temperatureclass != null and temperatureclass != ''">-->
<!-- AND (NVL(h.TEMPERATURECLASS, '') = ''-->
<!-- OR INSTR(',' || #{temperatureclass, jdbcType=VARCHAR} || ',', ',' || h.TEMPERATURECLASS || ',') <![CDATA[ > ]]> 0)-->
<!-- </if>-->
AND EXISTS (SELECT 1 FROM TMP_OUTBOUND_SCAN_PERMISSION p
WHERE 1=1
<if test="scanUser != null and scanUser != ''">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment