Merge branch 'master' of codeup.aliyun.com:64d9c5feeceb191898f636d7/honor-dd-light-ds-java

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
commit 097ade4171

@ -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;
}
}

@ -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<SearchD
@Autowired
private PurchaseOrderService purchaseOrderService;
@Resource
private PurchaseOrderUtil purchaseOrderUtil;
@Override
public BaseResponse<Ret> handle(BaseRequest<SearchDsOrderListRequestDTO> req) {
String shopId = req.getAuthId();
@ -30,7 +35,6 @@ public class SearchDsOrderListService implements ExtensionServiceHandler<SearchD
return R.ok(Ret.fail("参数不合法"));
}
PurchaseOrderUtil purchaseOrderUtil = new PurchaseOrderUtil();
dto.checkParams();
SearchDsOrderFilterDTO filter = purchaseOrderUtil.searchDsOrderFilter(dto);
Pager<JSONObject> pager = purchaseOrderService.searchDsOrderList(shopId, dto.getPage(), dto.getPageSize(), filter, true, true);

@ -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<Ret> handle(BaseRequest<SearchDsOrderListRequestDTO> req) {
String shopId = req.getAuthId();
SearchDsOrderListRequestDTO dto = req.getData();
PurchaseOrderUtil purchaseOrderUtil = new PurchaseOrderUtil();
Map<String, Integer> 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<String,Integer> 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));

@ -438,7 +438,7 @@
<select id="getDsOrderCount" resultType="java.lang.Integer">
SELECT count(${countFieldStr})
FROM ${masterTbl} ${masterTblAlias}
${joinStr}
${joinTables}
WHERE
${masterTblAlias}.shop_id in
<foreach collection="shopIds" item="item" index="index" open="(" close=")" separator=",">

@ -2,6 +2,7 @@ package com.ms.web;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -52,6 +53,9 @@ public class OrderTestController {
@Resource
private OrderUtil orderUtil;
@Resource
private PurchaseOrderUtil purchaseOrderUtil;
@GetMapping("/searchDsOrderList")
public BaseResponse<Pager<JSONObject>> searchDsOrderList() {
String shopId = AppConst.TEST_SHOP_ID;
@ -59,7 +63,6 @@ public class OrderTestController {
dto.setPurchaseOrderTab("waitPurchase");
dto.setOrderStartTime("2023-08-01");
dto.setOrderEndTime("2023-09-01");
PurchaseOrderUtil purchaseOrderUtil = new PurchaseOrderUtil();
dto.checkParams();
SearchDsOrderFilterDTO filter = purchaseOrderUtil.searchDsOrderFilter(dto);
Pager<JSONObject> pager = purchaseOrderService.searchDsOrderList(shopId, dto.getPage(), dto.getPageSize(), filter, true, true);
@ -67,15 +70,16 @@ public class OrderTestController {
}
@GetMapping("/getDsOrderCount")
public BaseResponse<JSONObject> getDsOrderCount() {
public BaseResponse<Ret> getDsOrderCount() {
String shopId = AppConst.TEST_SHOP_ID;
SearchDsOrderListRequestDTO dto = new SearchDsOrderListRequestDTO();
PurchaseOrderUtil purchaseOrderUtil = new PurchaseOrderUtil();
dto.setAuthShopIds(Integer.valueOf(shopId));
Map<String, Integer> 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;
@ -84,7 +88,7 @@ public class OrderTestController {
filterRet = purchaseOrderUtil.searchDsOrderFilter(dto);
priorityDeliveryOrderCount = purchaseOrderService.getDsOrderCount(Integer.valueOf(filterRet.getAuthShopIds()), filterRet);
}
JSONObject result = new JSONObject();
Map<String,Integer> 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));
@ -95,7 +99,7 @@ public class OrderTestController {
result.put("isolationOrderCount", counts.getOrDefault(DsOrderConst.PURCHASE_TAB_ISOLATION, 0));
result.put("receiverAddressChangedOrderCount", receiverAddressChangedOrderCount);
result.put("priorityDeliveryOrderCount", priorityDeliveryOrderCount);
return R.ok(result);
return R.ok(Ret.success(result));
}
@GetMapping("/testSql")

Loading…
Cancel
Save