|
|
@@ -11,6 +11,7 @@ import com.cyksj.common.annotation.NoSubmit;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.util.IoKit;
|
|
|
+import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.common.util.Xmls;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.BusinessType;
|
|
|
@@ -154,14 +155,14 @@ public class CmsOrderController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/get/mOrder")
|
|
|
- public Result<SearchResult<OrderMasterDonBackView>> getMOrder(Long channelId, String account, String showId, Long goodsDonType, Long goodsId, Long skuId, Boolean isNoBind, Integer dsType, List<String> status) {
|
|
|
+ public Result<SearchResult<OrderMasterDonBackView>> getMOrder(Long channelId, String account, String showId, Long goodsDonType, Long goodsId, Long skuId, Boolean isNoBind, Integer dsType, @RequestParam(value = "orderStatus", required = false) List<String> orderStatus) throws Exception {
|
|
|
StringBuilder conditionSb = new StringBuilder();
|
|
|
|
|
|
if (goodsId != null) {
|
|
|
conditionSb.append(String.format(" and goods_id = %s", goodsId));
|
|
|
}
|
|
|
if (skuId != null) {
|
|
|
- conditionSb.append(String.format(" and os.sku_id = %s"));
|
|
|
+ conditionSb.append(String.format(" and os.sku_id = %s", skuId));
|
|
|
}
|
|
|
if (goodsDonType != null) {
|
|
|
conditionSb.append(String.format(" and os.goods_id in (select id from goods_don where type = %s)", goodsDonType));
|
|
|
@@ -180,12 +181,12 @@ public class CmsOrderController {
|
|
|
}
|
|
|
conditionSb.append(String.format(" and os.%s != 0", dsTypeField));
|
|
|
}
|
|
|
- if (status != null) {
|
|
|
- conditionSb.append(String.format(" and os.status in %s", status.toString().replaceAll("\\[", "(").replaceAll("]", ")")));
|
|
|
+ if (orderStatus != null) {
|
|
|
+ conditionSb.append(String.format(" and os.status in %s", Jsons.toJson(orderStatus).replaceAll("\\[", "(").replaceAll("]", ")")));
|
|
|
}
|
|
|
String conditionSql = null;
|
|
|
if (conditionSb.length() > 0) {
|
|
|
- conditionSql = String.format(" exists (select count(*) from order_don os where os.m_oid = o.id %s) > 0", conditionSb.toString());
|
|
|
+ conditionSql = String.format(" (select count(*) from order_don os where os.m_oid = o.id %s) > 0", conditionSb.toString());
|
|
|
}
|
|
|
|
|
|
//主订单
|
|
|
@@ -211,7 +212,7 @@ public class CmsOrderController {
|
|
|
}
|
|
|
SearchResult<OrderMasterDonBackView> search1 = beanSearcher.search(OrderMasterDonBackView.class, builder.build());
|
|
|
search1.getDataList().forEach(mData -> {
|
|
|
- List<OrderDonBackView> orderDonBackViews = beanSearcher.searchAll(OrderDonBackView.class, MapUtils.builder().field(OrderDonBackView::getMOid).build());
|
|
|
+ List<OrderDonBackView> orderDonBackViews = beanSearcher.searchAll(OrderDonBackView.class, MapUtils.builder().field(OrderDonBackView::getMOid, mData.getMOid()).build());
|
|
|
mData.setOrderDonViews(orderDonBackViews);
|
|
|
mData.getOrderDonViews().forEach(data -> {
|
|
|
if (data.getPopularizeId() != null) {
|