|
@@ -14,7 +14,6 @@ import com.fjhx.victoriatourist.mapper.abnormal.AbnormalInfoMapper;
|
|
|
import com.fjhx.victoriatourist.service.abnormal.AbnormalInfoService;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
-import com.ruoyi.common.utils.wrapper.SqlField;
|
|
|
import com.ruoyi.system.service.ISysRoleService;
|
|
|
import com.ruoyi.system.utils.UserUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -46,12 +45,19 @@ public class AbnormalInfoServiceImpl extends ServiceImpl<AbnormalInfoMapper, Abn
|
|
|
|
|
|
//采购人id过滤
|
|
|
wrapper.eq("p.create_user", dto.getPurchaseUserId());
|
|
|
- wrapper.keyword(dto.getKeyword(),
|
|
|
- new SqlField("ai", AbnormalInfo::getTitle),
|
|
|
- new SqlField("ai", AbnormalInfo::getLinkCode),
|
|
|
- new SqlField("pi.custom_code"),
|
|
|
- new SqlField("pi.name")
|
|
|
- );
|
|
|
+
|
|
|
+ if(ObjectUtil.isNotEmpty(dto.getKeyword())) {
|
|
|
+ wrapper.and(q -> q
|
|
|
+ .like("ai", AbnormalInfo::getTitle, dto.getKeyword()).or()
|
|
|
+ .like("ai", AbnormalInfo::getLinkCode, dto.getKeyword()).or()
|
|
|
+ //到货质检
|
|
|
+ .exists("select pd.purchase_id from bytesailing_purchase.purchase_detail pd LEFT JOIN bytesailing_item.product_info pi ON pd.bussiness_id = pi.id where pd.del_flag=0 and ( pi.`name` LIKE CONCAT( '%', {0}, '%' ) OR pi.custom_code LIKE CONCAT( '%', {0}, '%' ))", dto.getKeyword()).or()
|
|
|
+ //京东
|
|
|
+ .exists("select std.stock_transfer_id from stock_transfer_details std LEFT JOIN bytesailing_item.product_info pi ON std.product_id = pi.id where ( pi.`name` LIKE CONCAT( '%', {0}, '%' ) OR pi.custom_code LIKE CONCAT( '%', {0}, '%' ))", dto.getKeyword()).or()
|
|
|
+ //待入库
|
|
|
+ .exists("select arrd.arrival_id from bytesailing_purchase.arrival_detail arrd LEFT JOIN bytesailing_item.product_info pi ON arrd.bussiness_id = pi.id where arrd.del_flag=0 and ( pi.`name` LIKE CONCAT( '%', {0}, '%' ) OR pi.custom_code LIKE CONCAT( '%', {0}, '%' ))", dto.getKeyword()).or()
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
//添加权限过滤
|
|
|
DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|