diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java index 64e447ee..fdf1f063 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/PurchaseOrderServiceImpl.java @@ -375,7 +375,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { whereConditions.append(String.format(" AND ood.ds_wait_pay_status IN (%s)", CommonTool.intToSQLIN(filter.getDsWaitPayStatus()))); } if (ObjectUtil.isNotEmpty(filter.getPurchaseOrderStatus())) { - whereConditions.append(String.format(" AND ood.ds_purchase_status IN (%s)", CommonTool.stringToSQLIN(CommonTool.convertValToArray(filter.getPurchaseOrderStatus())))); + whereConditions.append(String.format(" AND ood.ds_purchase_status IN (%s)", CommonTool.stringToSQLIN(CommonTool.splitWithComma(filter.getPurchaseOrderStatus())))); } if (ObjectUtil.isNotEmpty(filter.getOrderIds())) { whereConditions.append(String.format(" AND %s.`order_status` IN (%s)", masterTblAlias, CommonTool.stringToSQLIN(filter.getOrderIds()))); @@ -442,7 +442,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { } if (StrUtil.isNotBlank(filter.getSellerRemarkStars())) { - whereConditions.append(String.format(" AND o.`seller_remark_stars` IN (%s) ", CommonTool.stringToSQLIN(CommonTool.convertValToArray(filter.getSellerRemark())))); + whereConditions.append(String.format(" AND o.`seller_remark_stars` IN (%s) ", CommonTool.stringToSQLIN(CommonTool.splitWithComma(filter.getSellerRemark())))); } if (StrUtil.isNotBlank(filter.getSellerNote())) { @@ -521,7 +521,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { } if (ObjectUtil.isNotEmpty(filter.getAfterSaleStatus())) { - whereConditions.append(String.format(" AND oocas.after_sale_status IN (%s)) ", CommonTool.stringToSQLIN(CommonTool.convertValToArray(filter.getAfterSaleStatus())))); + whereConditions.append(String.format(" AND oocas.after_sale_status IN (%s) ", CommonTool.intToSQLIN(filter.getAfterSaleStatus()))); joinTables.put(opOrderChildAfterSaleTbl, String.format(" inner join %s oocas on oocas.order_id = %s.order_id", opOrderChildAfterSaleTbl, masterTblAlias)); } @@ -1823,8 +1823,9 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { String whereStr = searchDsOrderListCondition.getString("whereConditions"); String countFieldStr = String.format("distinct %s.order_id",masterTblAlias); String joinStr = searchDsOrderListCondition.getString("joinTables"); + log.info("=================filter:{}====",JSON.toJSONString(filter)); Integer total = purchaseOrderMapper.getDsOrderCount(countFieldStr, masterTblAlias, masterTbl, joinStr, shopIds, whereStr); - log.info("===========dsDebugCount:{}======filter:{}====",total,JSON.toJSONString(filter)); + log.info("===========dsDebugCount:{}==========",total); return total; } } diff --git a/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsOrderListService.java b/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsOrderListService.java index ea04db21..540ea8ce 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsOrderListService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsOrderListService.java @@ -1,5 +1,7 @@ package com.ms.api.spi.order; +import javax.annotation.Resource; + import com.alibaba.fastjson.JSONObject; import com.jinritemai.cloud.base.api.BaseRequest; import com.jinritemai.cloud.base.api.BaseResponse; @@ -22,6 +24,9 @@ public class SearchDsOrderListService implements ExtensionServiceHandler handle(BaseRequest req) { String shopId = req.getAuthId(); @@ -30,7 +35,6 @@ public class SearchDsOrderListService implements ExtensionServiceHandler pager = purchaseOrderService.searchDsOrderList(shopId, dto.getPage(), dto.getPageSize(), filter, true, true); diff --git a/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsTabOrderTotalCountService.java b/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsTabOrderTotalCountService.java index cc12366a..5e6bcd02 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsTabOrderTotalCountService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsTabOrderTotalCountService.java @@ -1,8 +1,11 @@ package com.ms.api.spi.order; import java.util.Arrays; +import java.util.HashMap; import java.util.Map; +import javax.annotation.Resource; + import com.alibaba.fastjson.JSONObject; import com.jinritemai.cloud.base.api.BaseRequest; import com.jinritemai.cloud.base.api.BaseResponse; @@ -26,16 +29,19 @@ public class SearchDsTabOrderTotalCountService implements ExtensionServiceHandle @Autowired private PurchaseOrderService purchaseOrderService; + @Resource + private PurchaseOrderUtil purchaseOrderUtil; + @Override public BaseResponse handle(BaseRequest req) { String shopId = req.getAuthId(); SearchDsOrderListRequestDTO dto = req.getData(); - PurchaseOrderUtil purchaseOrderUtil = new PurchaseOrderUtil(); Map counts = purchaseOrderUtil.getDsTabAndOrderCountMap(dto); dto.setIsReceiverAddressChanged(true); SearchDsOrderFilterDTO filterRet = purchaseOrderUtil.searchDsOrderFilter(dto); dto.setIsReceiverAddressChanged(null); + filterRet.setAuthShopIds(shopId); Integer receiverAddressChangedOrderCount = purchaseOrderService.getDsOrderCount(Integer.valueOf(filterRet.getAuthShopIds()), filterRet); Integer priorityDeliveryOrderCount = 0; @@ -44,7 +50,7 @@ public class SearchDsTabOrderTotalCountService implements ExtensionServiceHandle filterRet = purchaseOrderUtil.searchDsOrderFilter(dto); priorityDeliveryOrderCount = purchaseOrderService.getDsOrderCount(Integer.valueOf(filterRet.getAuthShopIds()), filterRet); } - JSONObject result = new JSONObject(); + Map result = new HashMap<>(); result.put("waitPurchaseOrderCount", counts.getOrDefault(DsOrderConst.PURCHASE_TAB_WAIT_PURCHASE, 0)); result.put("waitPayOrderCount", counts.getOrDefault(DsOrderConst.PURCHASE_TAB_WAIT_PAY, 0)); result.put("waitSendOrderCount", counts.getOrDefault(DsOrderConst.PURCHASE_TAB_WAIT_SEND, 0)); diff --git a/ms-dal/src/main/resources/mapper/PurchaseOrderMapper.xml b/ms-dal/src/main/resources/mapper/PurchaseOrderMapper.xml index e337d520..73bfa802 100644 --- a/ms-dal/src/main/resources/mapper/PurchaseOrderMapper.xml +++ b/ms-dal/src/main/resources/mapper/PurchaseOrderMapper.xml @@ -438,7 +438,7 @@