Merge remote-tracking branch 'origin/master'

20230922-ljl-fixBug
qiushengjie 2 years ago
commit 724cb4d39a

@ -0,0 +1,15 @@
package com.ms.api.common;
import java.util.List;
import lombok.Data;
@Data
public class Pager<T> {
private int page;//分页起始页
private int pageSize;//每页记录数
private List<T> data;//返回的记录集合
private long total;//总记录条数
}

@ -0,0 +1,7 @@
package com.ms.api.dto.order;
import lombok.Data;
@Data
public class GetPurchaseSettingResponseDTO {
}

@ -0,0 +1,51 @@
package com.ms.api.dto.order;
import lombok.Data;
@Data
public class PurchaseSettingDTO {
/**
*
*/
private int isAppendShopRemark;
/**
*
*/
private String appendShopRemarkTpl;
/**
*
*/
private int isAppendShopNote;
/**
*
*/
private String appendShopNoteTpl;
/**
*
*/
private int shopRemarkFlag;
/**
*
*/
private int isAutoFillRemark;
/**
*
*/
private String autoFillRemarkTpl;
/**
*
*/
private int isAutoFillOrderMemo;
/**
*
*/
private String autoFillOrderMemoTpl;
}

@ -11,6 +11,7 @@ import lombok.Data;
@Data
public class SearchDsOrderFilterDTO {
private String authShopIds;
/*
*
*/
@ -77,4 +78,19 @@ public class SearchDsOrderFilterDTO {
private String dsSourcePlatform;
private String dsOrderRelateState;
private Date purchaseStartTime;
private Date purchaseEndTime;
private String hasBuyerRemark;
private String hasSellerRemark;
private String hasSellerNote;
private String hasNoRemarks;
private Boolean isShowSameReceiverOrder;
}

@ -106,7 +106,7 @@ public class SearchDsOrderListRequestDTO extends PageOption {
private Object sellerRemarkStars;
@JsonIgnore
private boolean checkParams() {
public boolean checkParams() {
return StringUtils.isEmpty(purchaseOrderTab)
|| StringUtils.isEmpty(orderStartTime)
|| StringUtils.isEmpty(orderEndTime);

@ -1,5 +1,8 @@
package com.ms.api.consts;
import java.util.Arrays;
import java.util.List;
public class AfterSaleConst {
public static final String TAB_ALL = "all";
@ -85,4 +88,8 @@ public class AfterSaleConst {
public static final String WARNING_SOURCE_PRINT = "print";
public static final String WARNING_SOURCE_PURCHASE = "purchase";
public static final String WARNING_SOURCE_DISTRIBUTION = "distribution";
public static List<Integer> getAfterSaleCloseOrCancelStatusList() {
return Arrays.asList(AFTERSALE_STATUS_CLOSE, AFTERSALE_STATUS_REFUSE_AFTER_SALE_APPLY);
}
}

@ -1,5 +1,8 @@
package com.ms.api.service;
import com.ms.api.common.Pager;
import com.ms.api.dto.order.SearchDsOrderFilterDTO;
import com.ms.dal.entity.OpOrder;
import com.ms.dal.entity.PurchaseOrder;
/**
@ -18,4 +21,6 @@ public interface PurchaseOrderService {
int updateByPrimaryKeySelective(PurchaseOrder record);
int updateByPrimaryKey(PurchaseOrder record);
Pager<OpOrder> searchDsOrderList(String shopId, Integer page, Integer pageSize, SearchDsOrderFilterDTO filter, Boolean isEnsconceString, Boolean needOutstorageResult);
}

@ -1,5 +1,7 @@
package com.ms.api.service;
import java.util.List;
import com.ms.dal.entity.Shop;
/**
@ -20,4 +22,6 @@ public interface ShopService {
int updateByPrimaryKeySelective(Shop record);
int updateByPrimaryKey(Shop record);
List<Shop> getShopByIds(List<String> shopIds);
}

@ -1,17 +1,33 @@
package com.ms.api.service.impl;
import java.util.HashMap;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ms.api.consts.DsOrderConst;
import com.ms.api.consts.TblConst;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.doudian.open.api.order_BatchSearchIndex.OrderBatchSearchIndexRequest;
import com.doudian.open.api.order_BatchSearchIndex.data.OrderBatchSearchIndexData;
import com.doudian.open.api.order_BatchSearchIndex.data.PlainToEncryptIndexListItem;
import com.doudian.open.api.order_BatchSearchIndex.param.OrderBatchSearchIndexParam;
import com.doudian.open.api.order_BatchSearchIndex.param.PlainTextListItem;
import com.ms.api.common.Pager;
import com.ms.api.consts.*;
import com.ms.api.dto.order.PurchaseSettingDTO;
import com.ms.api.dto.order.SearchDsOrderFilterDTO;
import com.ms.api.service.PurchaseOrderService;
import com.ms.dal.entity.PurchaseOrder;
import com.ms.dal.mapper.PurchaseOrderMapper;
import com.ms.api.service.ShopService;
import com.ms.api.tool.CommonTool;
import com.ms.api.tool.PurchaseTool;
import com.ms.api.util.DdRequestUtil;
import com.ms.dal.bo.PurchaseOrderBO;
import com.ms.dal.entity.*;
import com.ms.dal.mapper.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*/
@ -21,6 +37,26 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
@Autowired
private PurchaseOrderMapper purchaseOrderMapper;
@Autowired
private OpOrderChildMapper opOrderChildMapper;
@Autowired
private OpOrderMapper opOrderMapper;
@Autowired
private OpOrderEncryptIndexMapper opOrderEncryptIndexMapper;
@Autowired
private PurchaseOrderItemMapper purchaseOrderItemMapper;
@Autowired
private PurchaseOrderSettingMapper purchaseOrderSettingMapper;
@Autowired
private PurchaseSettingMapper purchaseSettingMapper;
@Autowired
private ShopService shopService;
@Override
public int deleteByPrimaryKey(Long id) {
return purchaseOrderMapper.deleteByPrimaryKey(id);
@ -51,15 +87,69 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
return purchaseOrderMapper.updateByPrimaryKey(record);
}
public void searchDsOrderList(SearchDsOrderFilterDTO params) {
@Override
public Pager<OpOrder> searchDsOrderList(String shopId, Integer page, Integer pageSize, SearchDsOrderFilterDTO filter, Boolean isEnsconceString, Boolean needOutstorageResult) {
List<String> shopIds = new ArrayList<>();
if (ObjectUtil.isNotEmpty(filter.getAuthShopIds())) {
shopIds = CommonTool.convertValToArray(filter.getAuthShopIds());
} else {
shopIds.add(shopId);
}
Pager<String> orderIdPage = searchDsOrderIds(filter, Collections.singletonList(shopId), page, pageSize);
Pager<OpOrder> resultPage = new Pager<OpOrder>();
resultPage.setPage(page);
resultPage.setPageSize(pageSize);
resultPage.setTotal(orderIdPage.getTotal());
if (ObjectUtil.isEmpty(orderIdPage.getData())) {
resultPage.setData(new ArrayList<>());
return resultPage;
}
List<OpOrder> orderList = opOrderMapper.selectById(shopIds, orderIdPage.getData());
if (ObjectUtil.isEmpty(orderList)) {
resultPage.setData(orderList);
return resultPage;
}
List<String> orderIds = orderList.stream().map(OpOrder::getOrderId).collect(Collectors.toList());
Map<String, List<PurchaseOrderBO>> orderIdAndPurchaseOrdersMap = getOrderIdAndPurchaseOrdersMap(shopIds, orderIds, filter, true, false);
Map<Long, Shop> shopMap = shopService.getShopByIds(shopIds).stream().collect(Collectors.toMap(Shop::getShopId, x -> x));
Map<String, String> orderIdAndSameOrderIdsMap = new HashMap<>();
// if (ObjectUtil.isNotNull(filter.getIsShowSameReceiverOrder()) && filter.getIsShowSameReceiverOrder()) {
// orderIdAndSameOrderIdsMap = getOrderIdAndSameOrderIdsMap(shopId, orderIds);
// }
// returnOrders = getOrderAndPurchaseOrdersMap(shopId, shopIds, orderIds, orderList,
// orderIdAndPurchaseOrdersMap, shopIdAndShopInfoMap, orderIdAndSameOrderIdsMap, isEnsconceString, true);
//
// if (needOutstorageResult) {
// appendOrderOutstorageResultToOrders(shopIds, returnOrders, true);
// }
resultPage.setData(orderList);
return resultPage;
}
public void searchDsOrderIds(SearchDsOrderFilterDTO params) {
public Pager<String> searchDsOrderIds(SearchDsOrderFilterDTO filter, List<String> shopIds, Integer page, Integer pageSize) {
String dsTbl = TblConst.op_order_ds;
JSONObject searchDsOrderListCondition = getSearchDsOrderListCondition(filter, dsTbl, shopIds);
String masterTbl = searchDsOrderListCondition.getString("masterTbl");
String masterTblAlias = searchDsOrderListCondition.getString("masterTblAlias");
String whereConditions = searchDsOrderListCondition.getString("whereConditions");
String distinctStr = searchDsOrderListCondition.getString("distinctStr");
String joinTables = searchDsOrderListCondition.getString("joinTables");
Integer total = purchaseOrderMapper.selectOrderIdsCount(distinctStr, masterTblAlias, masterTbl, joinTables, shopIds, whereConditions);
List<String> orderIdList = purchaseOrderMapper.selectOrderIds(distinctStr, masterTblAlias, masterTbl, joinTables, shopIds, whereConditions, (page - 1) * pageSize, pageSize);
Pager<String> pager = new Pager<String>();
pager.setPage(page);
pager.setPageSize(pageSize);
pager.setData(orderIdList);
pager.setTotal(total);
return pager;
}
public void getSearchDsOrderListCondition(SearchDsOrderFilterDTO filter, String dsTbl) {
public JSONObject getSearchDsOrderListCondition(SearchDsOrderFilterDTO filter, String dsTbl, List<String> shopIds) {
String opOrderExtTbl = TblConst.op_order_ext;
String purchaseOrderTbl = TblConst.purchase_order;
@ -75,31 +165,383 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
String masterTblAlias = "";
StringBuilder whereConditions = new StringBuilder();
HashMap<String, String> joinTables = new HashMap<>();
StringBuilder distinctStr = new StringBuilder();
String distinctStr = "";
List<String> orderIds = new ArrayList<>();
if (ObjectUtil.isNotEmpty(filter.getDsOrderRelateState())) {
filter.setDsPurchaseStatus(null);
masterTbl = ooahTbl;
masterTblAlias = "o";
whereConditions.append(String.format(" AND ol.`order_id` is null "));
joinTables.put(opOrderLtaoTbl, String.format("left join %s ol on o.order_id = ol.order_id", opOrderLtaoTbl));
masterTblAlias = " o";
whereConditions.append(" AND ol.`order_id` is null ");
joinTables.put(opOrderLtaoTbl, String.format(" left join %s ol on o.order_id = ol.order_id", opOrderLtaoTbl));
} else {
masterTbl = dsTbl;
masterTblAlias = "'ood'";
masterTblAlias = " ood";
}
if (DsOrderConst.DS_ORDER_RELATE_STATE_UNRELATED.equals(filter.getDsOrderRelateState())) {
whereConditions.append(String.format(" AND (ood.`order_id` is null or ood.ds_relation_source_status in (%s,%s )) ", DsOrderConst._DS_RELATION_SOURCE_STATUS_PART_PRODUCT, DsOrderConst._DS_RELATION_SOURCE_STATUS_NONE_PRODUCT));
}
if (ObjectUtil.isNotEmpty(filter.getOrderStartTime())) {
whereConditions.append(String.format("AND %s.`gmt_create_time` >= %s", masterTblAlias, filter.getOrderStartTime()));
whereConditions.append(String.format(" AND %s.`gmt_create_time` >= '%s'", masterTblAlias, DateUtil.formatDateTime(filter.getOrderStartTime())));
}
if (ObjectUtil.isNotEmpty(filter.getOrderEndTime())) {
whereConditions.append(String.format("AND %s.`gmt_create_time` <= %s", masterTblAlias, filter.getOrderEndTime()));
whereConditions.append(String.format(" AND %s.`gmt_create_time` <= '%s'", masterTblAlias, DateUtil.formatDateTime(filter.getOrderEndTime())));
}
if (ObjectUtil.isNotEmpty(filter.getOrderStatus())) {
whereConditions.append(String.format("AND %s.`gmt_create_time` <= %s", masterTblAlias, filter.getOrderEndTime()));
whereConditions.append(String.format(" AND %s.`order_status` IN (%s)", masterTblAlias, CommonTool.intToSQLIN(filter.getOrderStatus())));
}
if (ObjectUtil.isNotEmpty(filter.getDsWaitPayStatus())) {
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()))));
}
if (ObjectUtil.isNotEmpty(filter.getOrderIds())) {
whereConditions.append(String.format(" AND %s.`order_status` IN (%s)", masterTblAlias, CommonTool.stringToSQLIN(filter.getOrderIds())));
}
if (ObjectUtil.isNotEmpty(filter.getPurchaseOrderSn())) {
whereConditions.append(String.format(" AND po.`purchase_order_sn` IN (%s)", CommonTool.stringToSQLIN(filter.getPurchaseOrderSn())));
joinTables.put(purchaseOrderTbl, String.format(" inner join %s po on po.order_id = %s.order_id", purchaseOrderTbl, masterTblAlias));
}
if (ObjectUtil.isNotEmpty(filter.getPurchaseOrderStatus())) {
whereConditions.append(String.format(" AND po.`purchase_order_status` IN (%s)", filter.getPurchaseOrderStatus()));
joinTables.put(purchaseOrderTbl, String.format(" inner join %s po on po.order_id = %s.order_id", purchaseOrderTbl, masterTblAlias));
}
if (ObjectUtil.isNotEmpty(filter.getPurchaseStartTime())) {
whereConditions.append(String.format(" AND po.`purchase_order_start_time` >= '%s'", DateUtil.formatDateTime(filter.getPurchaseStartTime())));
joinTables.put(purchaseOrderTbl, String.format(" LEFT JOIN %s po ON po.`order_id` = %s.`order_id`", purchaseOrderTbl, masterTblAlias));
}
if (ObjectUtil.isNotEmpty(filter.getPurchaseEndTime())) {
whereConditions.append(String.format(" AND po.`purchase_order_start_time` <= '%s'", DateUtil.formatDateTime(filter.getPurchaseEndTime())));
joinTables.put(purchaseOrderTbl, String.format(" LEFT JOIN %s po ON po.`order_id` = %s.`order_id`", purchaseOrderTbl, masterTblAlias));
}
if (ObjectUtil.isNotEmpty(filter.getDelaySendStatus())) {
Date date = new Date();
if (filter.getDelaySendStatus().toString().equals(OrderConst.DELAY_SEND_STATUS_WILL_DELAY_SEND)) {
Date willDelayTime = DateUtil.offsetHour(date, 24);
whereConditions.append(String.format(" AND ooc.`gmt_exp_ship_time` > %s AND ooc.`gmt_exp_ship_time` < '%s'", date, DateUtil.formatDateTime(willDelayTime)));
joinTables.put(oocTbl, String.format(" LEFT JOIN %s ooc ON ooc.`order_id` = %s.`order_id`", oocTbl, masterTblAlias));
} else if (filter.getDelaySendStatus().toString().equals(OrderConst.DELAY_SEND_STATUS_HAS_DELAY_SEND)) {
whereConditions.append(String.format(" AND ooc.`gmt_exp_ship_time` < '%s'", DateUtil.formatDateTime(date)));
joinTables.put(oocTbl, String.format(" LEFT JOIN %s ooc ON ooc.`order_id` = %s.`order_id`", oocTbl, masterTblAlias));
}
}
if (ObjectUtil.isNotEmpty(filter.getPurchaseOrderSeller())) {
whereConditions.append(String.format(" AND po.`purchase_order_seller` = '%s' ", filter.getPurchaseOrderSeller()));
joinTables.put(purchaseOrderTbl, String.format(" LEFT JOIN %s po ON po.`order_id` = %s.`order_id`", purchaseOrderTbl, masterTblAlias));
}
if (ObjectUtil.isNotEmpty(filter.getPurchaseOrderStatus())) {
whereConditions.append(String.format(" AND po.`purchase_order_status` = '%s'", filter.getPurchaseOrderStatus()));
joinTables.put(purchaseOrderTbl, String.format(" LEFT JOIN %s po ON po.`order_id` = %s.`order_id`", purchaseOrderTbl, masterTblAlias));
}
if (StrUtil.isNotBlank(filter.getSkuName())) {
whereConditions.append(String.format(" AND ooc.`product_name` like %s", CommonTool.stringToSQLLike(filter.getSkuName())));
joinTables.put(oocTbl, String.format("JOIN %s ooc ON ooc.`order_id` = %s.`order_id`", oocTbl, masterTblAlias));
}
if (StrUtil.isNotBlank(filter.getSkuSubName())) {
whereConditions.append(String.format(" AND ooc.`spec_desc` like %s", CommonTool.stringToSQLLike(filter.getSkuSubName())));
joinTables.put(oocTbl, String.format("JOIN %s ooc ON ooc.`order_id` = %s.`order_id`", oocTbl, masterTblAlias));
}
if (StrUtil.isNotBlank(filter.getProductId())) {
whereConditions.append(String.format(" AND ooc.`product_id` = '%s'", filter.getProductId()));
joinTables.put(oocTbl, String.format("JOIN %s ooc ON ooc.`order_id` = %s.`order_id`", oocTbl, masterTblAlias));
}
if (StrUtil.isNotBlank(filter.getBuyerRemark())) {
whereConditions.append(String.format(" AND o.`buyer_words` LIKE %s ", CommonTool.stringToSQLLike(filter.getBuyerRemark())));
}
if (StrUtil.isNotBlank(filter.getSellerRemark())) {
whereConditions.append(String.format(" AND o.`seller_words` LIKE %s ", CommonTool.stringToSQLLike(filter.getSellerRemark())));
}
if (StrUtil.isNotBlank(filter.getSellerRemarkStars())) {
whereConditions.append(String.format(" AND o.`seller_remark_stars` IN (%s) ", CommonTool.stringToSQLIN(CommonTool.convertValToArray(filter.getSellerRemark()))));
}
if (StrUtil.isNotBlank(filter.getSellerNote())) {
whereConditions.append(String.format(" AND ooe.shop_note like %s ", CommonTool.stringToSQLLike(filter.getSellerNote())));
joinTables.put(opOrderExtTbl, String.format(" inner join %s ooe on ooe.order_id = %s.order_id", opOrderExtTbl, masterTblAlias));
}
if (StringUtils.isNumeric(filter.getHasBuyerRemark())) {
boolean index = Integer.parseInt(filter.getHasBuyerRemark()) != 0;
whereConditions.append(index ? " AND o.buyer_words != ''" : " AND o.buyer_words = ''");
}
if (StringUtils.isNumeric(filter.getHasSellerRemark())) {
boolean index = Integer.parseInt(filter.getHasSellerRemark()) != 0;
whereConditions.append(index ? " AND o.seller_words != ''" : " AND o.seller_words = ''");
}
if (StringUtils.isNumeric(filter.getHasSellerNote())) {
boolean index = Integer.parseInt(filter.getHasSellerNote()) != 0;
whereConditions.append(index ? " AND ooe.shop_note != ''" : " AND ooe.shop_note = ''");
joinTables.put(opOrderExtTbl, String.format(" inner join %s ooe on ooe.order_id = %s.order_id", opOrderExtTbl, masterTblAlias));
}
if (StrUtil.isNotBlank(filter.getHasNoRemarks())) {
whereConditions.append(" AND o.`buyer_words` = '' AND o.`seller_words` = ''");
}
if (StrUtil.isNotBlank(filter.getLogisticsCode())) {
String waybillCodeOrderIds = getOpOrderIdsByWaybillCode(shopIds, filter.getLogisticsCode());
orderIds.add(waybillCodeOrderIds);
}
if (StrUtil.isNotBlank(filter.getFullname())) {
List<String> fullnameOrderIds = getOpOrderIdByFullname(shopIds, filter.getFullname());
orderIds.addAll(fullnameOrderIds);
}
if (StrUtil.isNotBlank(filter.getMobile())) {
String mobileOrderIds = getOpOrderIdByMobile(shopIds, filter.getMobile());
orderIds.add(mobileOrderIds);
}
if (ObjectUtil.isNotEmpty(orderIds)) {
whereConditions.append(String.format(" AND %s.`order_id` in (%s)", masterTblAlias, CommonTool.stringToSQLIN(orderIds)));
}
if (joinTables.containsKey(purchaseOrderTbl)) {
whereConditions.append(String.format(" AND po.`status` = '%s' ", StatusConst.normal));
}
if (ObjectUtil.isNotEmpty(filter.getIsIsolation())) {
whereConditions.append(String.format(" AND ooe.is_isolation = %d ", filter.getIsIsolation()));
joinTables.put(opOrderExtTbl, String.format(" inner join %s ooe on ooe.order_id = %s.order_id", opOrderExtTbl, masterTblAlias));
}
if (ObjectUtil.isNotEmpty(filter.getIsPriorirtyDelivery())) {
whereConditions.append(String.format(" and exists(select 1 from %d oopd where oopd.order_id = o.order_id) ", filter.getIsPriorirtyDelivery()));
}
if (ObjectUtil.isNotEmpty(filter.getHasAfterSale())) {
if (Objects.equals(filter.getHasAfterSale(), "yes")) {
joinTables.put(afsTbl, String.format("JOIN %s afs ON afs.`order_id` = %s.`order_id` and afs.shop_id in (%s) and aftersale_status not in (%s)",
afsTbl,
masterTblAlias,
CommonTool.stringToSQLIN(shopIds),
CommonTool.intToSQLIN(AfterSaleConst.getAfterSaleCloseOrCancelStatusList())));
}
if (Objects.equals(filter.getHasAfterSale(), "no")) {
whereConditions.append(String.format(" AND NOT EXISTS (select 1 from %s afs WHERE afs.pid = %s.order_id and afs.shop_id in (%s) and aftersale_status not in (%s)) ",
afsTbl,
masterTblAlias,
CommonTool.stringToSQLIN(shopIds),
CommonTool.intToSQLIN(AfterSaleConst.getAfterSaleCloseOrCancelStatusList())
));
}
}
if (ObjectUtil.isNotEmpty(filter.getOrderTags()) && OrderConst.ORDER_TAG_RECEIVER_ADDRESS_CHANGED.equals(filter.getOrderTags())) {
whereConditions.append(String.format(" AND EXISTS(select 1 from %s ooah where ooah.order_id = %s.order_id and ooah.shop_id IN (%s)) ",
ooahTbl,
masterTblAlias,
CommonTool.stringToSQLIN(shopIds)));
}
if (ObjectUtil.isNotEmpty(filter.getAfterSaleStatus())) {
whereConditions.append(String.format(" AND oocas.after_sale_status IN (%s)) ", CommonTool.stringToSQLIN(CommonTool.convertValToArray(filter.getAfterSaleStatus()))));
joinTables.put(opOrderChildAfterSaleTbl, String.format(" inner join %s oocas on oocas.order_id = %s.order_id", opOrderChildAfterSaleTbl, masterTblAlias));
}
List<String> needDistinctJoinTbls = Arrays.asList(purchaseOrderTbl, oocTbl, opOrderChildAfterSaleTbl);
distinctStr = (joinTables.keySet().stream().anyMatch(needDistinctJoinTbls::contains)) ? "distinct" : "";
if (!Objects.equals(masterTbl, orderTbl) && whereConditions.indexOf("o.") > 0) {
joinTables.put(orderTbl, String.format(" JOIN %s o ON o.`order_id` = %s.`order_id`", orderTbl, masterTblAlias));
}
if (!Objects.equals(masterTbl, dsTbl) && whereConditions.indexOf("ood.") > 0) {
joinTables.put(dsTbl, String.format(" left join %s ood on ood.order_id = %s.order_id ", dsTbl, masterTblAlias));
}
JSONObject result = new JSONObject();
result.put("masterTbl", masterTbl);
result.put("masterTblAlias", masterTblAlias);
result.put("whereConditions", whereConditions.toString());
result.put("joinTables", String.join(" ", joinTables.values()));
result.put("distinctStr", distinctStr);
return result;
}
public String getOpOrderIdsByWaybillCode(List<String> shopIds, String waybillCode) {
return opOrderChildMapper.selectOrderIdByShopIdAndTrackingNo(shopIds, waybillCode);
}
public List<String> getOpOrderIdByFullname(List<String> shopIds, String fullname) {
List<String> list = new ArrayList<>();
if (ObjectUtil.isEmpty(shopIds) || ObjectUtil.isNull(fullname)) {
return list;
}
String fullnameOrderIds = opOrderMapper.selectOrderIdByShopIdAndFullname(shopIds, CommonTool.smd5Value(fullname));
String searchIndex = getOrderSearchIndexFromDd(fullname, OrderConst.SENSITIVE_TYPE_FULLNAME);
String encryptIndexOrderIds = opOrderEncryptIndexMapper.selectOrderIdByShopIdAndFullname(shopIds, searchIndex);
if (StrUtil.isNotBlank(fullnameOrderIds)) {
list.add(fullnameOrderIds);
}
if (StrUtil.isNotBlank(encryptIndexOrderIds)) {
list.add(encryptIndexOrderIds);
}
return list;
}
public String getOpOrderIdByMobile(List<String> shopIds, String waybillCode) {
return opOrderChildMapper.selectOrderIdByShopIdAndTrackingNo(shopIds, waybillCode);
}
public String getOrderSearchIndexFromDd(String plainText, Integer sensitiveType) {
if (StrUtil.isBlank(plainText) || ObjectUtil.isNull(sensitiveType)) {
throw new RuntimeException("参数错误");
}
List<PlainTextListItem> plainList = new ArrayList<PlainTextListItem>();
PlainTextListItem item = new PlainTextListItem();
item.setPlainText(plainText);
item.setEncryptType(sensitiveType);
plainList.add(item);
Map<String, String> plainTextAndSearchIndexMap = batchGetOrderSearchIndexFromDd(plainList);
if (!plainTextAndSearchIndexMap.containsKey(plainText)) {
throw new RuntimeException("获取索引失败");
}
return plainTextAndSearchIndexMap.get(plainText);
}
public Map<String, String> batchGetOrderSearchIndexFromDd(List<PlainTextListItem> plainList) {
OrderBatchSearchIndexRequest request = new OrderBatchSearchIndexRequest();
OrderBatchSearchIndexParam param = request.getParam();
param.setPlainTextList(plainList);
OrderBatchSearchIndexData data = DdRequestUtil.orderBatchSearchIndexRequest(param);
Map<String, String> plainTextAndSearchIndexMap = new HashMap<>();
for (PlainToEncryptIndexListItem item : data.getPlainToEncryptIndexList()) {
plainTextAndSearchIndexMap.put(item.getPlain(), item.getSearchIndex());
}
return plainTextAndSearchIndexMap;
}
public Map<String, List<PurchaseOrderBO>> getOrderIdAndPurchaseOrdersMap(List<String> shopIds,
List<String> orderIds,
SearchDsOrderFilterDTO filter,
boolean needItems,
boolean needPurchaseSetting) {
if (ObjectUtil.isEmpty(shopIds) || ObjectUtil.isEmpty(orderIds)) {
return new HashMap<>();
}
StringBuilder where = new StringBuilder();
if (ObjectUtil.isNotEmpty(filter.getPurchaseStartTime())) {
where.append(String.format(" and purchase_order_start_time >= '%s'", DateUtil.formatDateTime(filter.getPurchaseStartTime())));
}
if (ObjectUtil.isNotEmpty(filter.getPurchaseEndTime())) {
where.append(String.format(" and purchase_order_start_time <= '%s'", DateUtil.formatDateTime(filter.getPurchaseEndTime())));
}
List<PurchaseOrderBO> purchaseOrders = purchaseOrderMapper.selectPurchaseOrders(shopIds, orderIds, StatusConst.normal, where.toString());
if (ObjectUtil.isEmpty(purchaseOrders)) {
return new HashMap<>();
}
if (needItems) {
List<String> purchaseOrderIds = purchaseOrders.stream().map(x -> x.getPurchaseOrderId().toString()).collect(Collectors.toList());
Map<Integer, PurchaseOrderItem> purchaseOrderItemsMap = getPurchaseOrderItemsMapByPurchaseOrderIds(shopIds, purchaseOrderIds, StatusConst.normal).stream().collect(Collectors.toMap(PurchaseOrderItem::getPurchaseOrderId, x -> x));
for (PurchaseOrderBO purchaseOrder : purchaseOrders) {
if (purchaseOrderItemsMap.containsKey(purchaseOrder.getPurchaseOrderId().intValue())) {
purchaseOrder.setItem(purchaseOrderItemsMap.get(purchaseOrder.getPurchaseOrderId().intValue()));
}
}
}
if (needPurchaseSetting) {
List<String> purchaseOrderIds = purchaseOrders.stream().map(x -> x.getPurchaseOrderId().toString()).collect(Collectors.toList());
Map<Integer, PurchaseOrderSetting> purchaseOrderSettingsMap = getPurchaseOrderSettingsMapByPurchaseOrderIds(shopIds, purchaseOrderIds);
for (PurchaseOrderBO purchaseOrder : purchaseOrders) {
if (purchaseOrderSettingsMap.containsKey(purchaseOrder.getPurchaseOrderId().intValue())) {
purchaseOrder.setPurchaseSetting(purchaseOrderSettingsMap.get(purchaseOrder.getPurchaseOrderId().intValue()));
}
}
}
// todo 给的源码不包含 attachPurchaseOrderTransitAddressToPurchaseOrders 也没有对应的表 跳过
// if ($needPurchaseOrderTransitAddress) {
// $this->attachPurchaseOrderTransitAddressToPurchaseOrders($purchaseOrders, $shopIds);
// }
return purchaseOrders.stream().collect(Collectors.groupingBy(PurchaseOrderBO::getOrderId));
}
public List<PurchaseOrderItem> getPurchaseOrderItemsMapByPurchaseOrderIds(List<String> shopIds, List<String> purchaseOrderIds, String status) {
return purchaseOrderItemMapper.getPurchaseOrderItemsMapByPurchaseOrderIds(shopIds, purchaseOrderIds, status);
}
public Map<Integer, PurchaseOrderSetting> getPurchaseOrderSettingsMapByPurchaseOrderIds(List<String> shopIds, List<String> purchaseOrderIds) {
if (ObjectUtil.isEmpty(shopIds) || ObjectUtil.isEmpty(purchaseOrderIds)) {
return new HashMap<>();
}
List<PurchaseOrderSetting> rows = purchaseOrderSettingMapper.selectByPurchaseOrderIds(shopIds, purchaseOrderIds);
// TODO: 2023/8/28 java无法反序列化回来 只能抛给前端处理 跳过
// for (PurchaseOrderSetting orderSetting : rows) {
// if ($row['add_consignee_address_suffix_fields']) {
// $row['add_consignee_address_suffix_fields'] = unserialize($row['add_consignee_address_suffix_fields']);
// }
// if ($row['add_consignee_name_suffix_fields']) {
// $row['add_consignee_name_suffix_fields'] = unserialize($row['add_consignee_name_suffix_fields']);
// }
// }
return rows.stream().collect(Collectors.toMap(PurchaseOrderSetting::getPurchaseOrderId, x -> x));
}
public PurchaseSettingDTO getPurchaseSetting(Long shopId) {
PurchaseSetting purchaseSetting = purchaseSettingMapper.selectByShopId(shopId);
// boolean isNewestVersion = purchaseSetting.version = PurchaseOrderConst.CURRENT_PURCHASE_SETTING_VERSION;
Integer isAppendShopRemark;
Integer isAppendShopNote;
Integer isAutoFillRemark;
Integer isAutoFillOrderMemo;
String appendShopRemarkTpl;
String appendShopNoteTpl;
String autoFillRemarkTpl;
String autoFillOrderMemoTpl;
if (purchaseSetting == null) {
isAppendShopRemark = 1;
isAppendShopNote = 1;
isAutoFillRemark = 0;
isAutoFillOrderMemo = 0;
appendShopRemarkTpl = PurchaseTool.getDefaultAppendVenderRemarkTpl();
appendShopNoteTpl = PurchaseTool.getDefaultAppendVenderRemarkTpl();
autoFillRemarkTpl = null;
autoFillOrderMemoTpl = null;
} else {
isAppendShopRemark = purchaseSetting.getIsAppendShopRemark();
isAppendShopNote = purchaseSetting.getIsAppendShopNote();
isAutoFillRemark = purchaseSetting.getIsAutoFillRemark();
isAutoFillOrderMemo = purchaseSetting.getIsAutoFillOrderMemo();
appendShopRemarkTpl = PurchaseTool.removeRemarkMobileTplHashTag(purchaseSetting.getAppendShopRemarkTpl());
appendShopNoteTpl = PurchaseTool.removeRemarkMobileTplHashTag(purchaseSetting.getAppendShopNoteTpl());
autoFillRemarkTpl = purchaseSetting.getAutoFillRemarkTpl();
autoFillOrderMemoTpl = purchaseSetting.getAutoFillOrderMemoTpl();
}
PurchaseSettingDTO purchaseSettingDTO = new PurchaseSettingDTO();
purchaseSettingDTO.setIsAppendShopRemark(isAppendShopRemark);
purchaseSettingDTO.setIsAppendShopNote(isAppendShopNote);
purchaseSettingDTO.setIsAutoFillRemark(isAutoFillRemark);
purchaseSettingDTO.setIsAutoFillOrderMemo(isAutoFillOrderMemo);
purchaseSettingDTO.setAppendShopRemarkTpl(appendShopRemarkTpl);
purchaseSettingDTO.setAppendShopNoteTpl(appendShopNoteTpl);
purchaseSettingDTO.setAutoFillRemarkTpl(autoFillRemarkTpl);
purchaseSettingDTO.setAutoFillOrderMemoTpl(autoFillOrderMemoTpl);
if (purchaseSetting == null) {
savePurchaseSetting(shopId, purchaseSettingDTO);
}
return purchaseSettingDTO;
}
public boolean savePurchaseSetting(Long shopId, PurchaseSettingDTO purchaseSettingDTO) {
// todo:
return false;
}
}

@ -1,17 +1,21 @@
package com.ms.api.service.impl;
import com.ms.dal.entity.Shop;
import java.util.ArrayList;
import java.util.List;
import cn.hutool.core.util.ObjectUtil;
import com.ms.api.service.ShopService;
import com.ms.api.tool.CommonTool;
import com.ms.dal.entity.Shop;
import com.ms.dal.mapper.ShopMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
public class ShopServiceImpl implements ShopService{
public class ShopServiceImpl implements ShopService {
@Autowired
private ShopMapper shopMapper;
@ -51,6 +55,22 @@ public class ShopServiceImpl implements ShopService{
return shopMapper.updateByPrimaryKey(record);
}
@Override
public List<Shop> getShopByIds(List<String> shopIds) {
if (ObjectUtil.isEmpty(shopIds)) {
return new ArrayList<Shop>();
}
List<Shop> shopList = shopMapper.getShopByIds(shopIds);
if (ObjectUtil.isEmpty(shopList)) {
return new ArrayList<Shop>();
}
for (Shop shop : shopList) {
shop.setAccessToken(CommonTool.decrypt(shop.getAccessToken(), shop.getShopId()));
shop.setRefreshToken(CommonTool.decrypt(shop.getRefreshToken(), shop.getShopId()));
}
return shopList;
}
}

@ -0,0 +1,21 @@
package com.ms.api.spi.order;
import com.jinritemai.cloud.base.api.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.jinritemai.cloud.base.api.ExtensionService;
import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
import com.ms.api.common.SPIBaseService;
import com.ms.api.dto.order.GetPurchaseSettingResponseDTO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ExtensionService("getPurchaseSetting")
@Slf4j
@AllArgsConstructor
public class GetPurchaseSettingService extends SPIBaseService implements ExtensionServiceHandler<Void, GetPurchaseSettingResponseDTO> {
@Override
public BaseResponse<GetPurchaseSettingResponseDTO> handle(BaseRequest<Void> req) {
// GetPurchaseSettingRequestDTO requestDTO = req.getData();
return null;
}
}

@ -1,14 +1,34 @@
package com.ms.api.tool;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.setting.dialect.Props;
import com.doudian.open.core.DoudianOpResponse;
public class CommonTool {
private static final Props props;
static {
props = new Props("application.properties", CharsetUtil.CHARSET_UTF_8);
}
/*
* idA
*/
@ -44,12 +64,47 @@ public class CommonTool {
}
List<String> result = new ArrayList<>();
for (String temp : split) {
if (StrUtil.isNotBlank(temp.trim())){
if (StrUtil.isNotBlank(temp.trim())) {
result.add(temp.trim());
}
}
return result;
}
public static String encrypt(String plaintext, Long shopId) {
if (plaintext.isEmpty()) {
return plaintext;
}
String key = props.getProperty("shop.encrypt.key");
String password = String.format("%s*%s", key, (int) (shopId / 19));
try {
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
SecretKeySpec secretKey = new SecretKeySpec(password.getBytes(StandardCharsets.UTF_8), "AES");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
byte[] encryptedBytes = cipher.doFinal(plaintext.getBytes(StandardCharsets.UTF_8));
return Base64.getEncoder().encodeToString(encryptedBytes);
} catch (Exception ex) {
return null;
}
}
public static String decrypt(String encrypted, Long shopId) {
if (encrypted.isEmpty()) {
return encrypted;
}
String key = props.getProperty("shop.encrypt.key");
String password = String.format("%s*%s", key, (int) (shopId / 19));
try {
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
SecretKeySpec secretKey = new SecretKeySpec(password.getBytes(StandardCharsets.UTF_8), "AES");
cipher.init(Cipher.DECRYPT_MODE, secretKey);
byte[] decryptedBytes = cipher.doFinal(Base64.getDecoder().decode(encrypted));
return new String(decryptedBytes, StandardCharsets.UTF_8);
} catch (Exception ex) {
return null;
}
}
public static String[] toStrArray(String str) {
return toStrArray(",", str);
}
@ -66,7 +121,7 @@ public class CommonTool {
return Arrays.asList(toStrArray(split, str));
}
public static String getStrNow(){
public static String getStrNow() {
return DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now());
}
@ -108,4 +163,39 @@ public class CommonTool {
public static Date curDate() {
return new Date();
}
public static List<String> convertValToArray(Object val) {
if (val instanceof String) {
return splitWithComma(val.toString());
}
return new ArrayList<>();
}
public static String stringToSQLLike(String keyword) {
return "'%".concat(keyword).concat("%'");
}
public static String stringToSQLIN(List<String> list) {
return "'".concat(StrUtil.join("','", list)).concat("'");
}
public static String intToSQLIN(List<Integer> list) {
return StrUtil.join(",", list);
}
public static String smd5Value(String value) {
if (ObjectUtil.isNull(value)) {
return null;
}
if (StrUtil.isBlank(value)) {
return "";
}
String smd5Key1 = props.getProperty("smd5.key1");
String smd5Key2 = props.getProperty("smd5.key2");
return SecureUtil.md5(SecureUtil.md5(smd5Key1.concat(value)).concat(smd5Key2));
}
public static void main(String[] args) {
System.out.println(smd5Value("abc"));
}
}

@ -0,0 +1,31 @@
package com.ms.api.tool;
import com.ms.api.consts.PurchaseOrderConst;
public class PurchaseTool {
/**
*
* <span contenteditable="false" data-field="receiver_mobile">13366667777</span>
* @param tpl
* @return
*/
public static String removeRemarkMobileTplHashTag(String tpl) {
// String tpl = "asdasdas<span contenteditable=\"false\" data-field=\"receiver_mobile\">#+861222352531#</span>afafafafafafaf";
return tpl.replaceAll("<span contenteditable=\"false\" data-field=\"receiver_mobile\">#(?:[^#]+)#</span>", "");
}
/**
*
* @return
*/
public static String getDefaultAppendVenderRemarkTpl() {
String[] arr = {
String.format("<span contenteditable=\"false\" data-field=\"%s\">#%s#</span>", PurchaseOrderConst.PURCHASE_PLATFORM2_FIELD, "采购平台").toString(),
String.format("<span contenteditable=\"false\" data-field=\"%s\">#%s#</span>", PurchaseOrderConst.PURCHASE_ORDER_SN_FIELD, "采购单号").toString(),
String.format("<span contenteditable=\"false\" data-field=\"%s\">#%s#</span>", PurchaseOrderConst.LOGISTICS_INFO_FIELD, "快递及运单号").toString(),
String.format("<span contenteditable=\"false\" data-field=\"%s\">#%s#</span>", PurchaseOrderConst.PURCHASE_ORDER_BUYER, "采购账号").toString(),
};
return String.join("#", arr);
}
}

@ -1,6 +1,10 @@
package com.ms.api.util;
import com.alibaba.fastjson.JSONObject;
import com.doudian.open.api.order_BatchSearchIndex.OrderBatchSearchIndexRequest;
import com.doudian.open.api.order_BatchSearchIndex.OrderBatchSearchIndexResponse;
import com.doudian.open.api.order_BatchSearchIndex.data.OrderBatchSearchIndexData;
import com.doudian.open.api.order_BatchSearchIndex.param.OrderBatchSearchIndexParam;
import com.doudian.open.api.order_searchList.OrderSearchListRequest;
import com.doudian.open.api.order_searchList.OrderSearchListResponse;
import com.doudian.open.api.order_searchList.data.OrderSearchListData;
@ -28,6 +32,26 @@ public class DdRequestUtil {
log.info("=============Dd请求返回错误subCode:{}===================", response.getSubCode());
log.info("=============Dd请求返回错误subMsg:{}===================", response.getSubMsg());
log.info(JSONObject.toJSONString(response));
return null;
throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg()));
}
public static OrderBatchSearchIndexData orderBatchSearchIndexRequest(OrderBatchSearchIndexParam param) {
log.info("=============Dd请求参数===================");
log.info(JSONObject.toJSONString(param));
OrderBatchSearchIndexRequest request = new OrderBatchSearchIndexRequest();
request.setParam(param);
OrderBatchSearchIndexResponse response = request.execute();
log.info("=============Dd请求返回===================");
log.info(JSONObject.toJSONString(response));
boolean success = CommonTool.checkDdApiRequestIsSuccess(response);
if (success) {
return response.getData();
}
log.info("=============Dd请求返回错误msg:{}===================", response.getMsg());
log.info("=============Dd请求返回错误code:{}===================", response.getCode());
log.info("=============Dd请求返回错误subCode:{}===================", response.getSubCode());
log.info("=============Dd请求返回错误subMsg:{}===================", response.getSubMsg());
log.info(JSONObject.toJSONString(response));
throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg()));
}
}

@ -21,25 +21,18 @@ import com.ms.api.dto.order.SearchDsOrderFilterDTO;
import com.ms.api.dto.order.SearchDsOrderListRequestDTO;
import com.ms.api.tool.CommonTool;
public class PurchaseOrderUtil {
private OriginalAndCustomConsigneeInfoResponseDTO getOriginalAndCustomConsigneeInfo(OriginalAndCustomConsigneeInfoRequestDTO requestDTO) {
return new OriginalAndCustomConsigneeInfoResponseDTO();
}
public void searchDsOrderList(SearchDsOrderListRequestDTO dto) {
// WebUtil.getSessionVal()
BaseResponse response = this.searchDsOrderFilter(dto);
if (!response.getSuccess()) {
return;
}
}
/**
*
*/
public BaseResponse searchDsOrderFilter(SearchDsOrderListRequestDTO dto) {
public SearchDsOrderFilterDTO searchDsOrderFilter(SearchDsOrderListRequestDTO dto) {
List<String> authShopIds = ObjectUtil.isEmpty(dto.getAuthShopIds()) ? Collections.singletonList(WebUtil.getSessionVal(SessionConst.SHOP_ID)) : Collections.singletonList(dto.getAuthShopIds().toString());
SearchDsOrderFilterDTO params = new SearchDsOrderFilterDTO();
params.setIsIsolation(0);
@ -118,7 +111,7 @@ public class PurchaseOrderUtil {
if (StrUtil.isNotBlank(dto.getOrderIds())) {
params.setOrderIds(CommonTool.splitWithComma(dto.getOrderIds()));
if (params.getOrderIds().size() > 200) {
return R.fail("一次最多输入200个订单号查询");
throw new RuntimeException("一次最多输入200个订单号查询");
}
}
if (StrUtil.isNotBlank(dto.getPurchaseOrderSn())) {
@ -215,7 +208,11 @@ public class PurchaseOrderUtil {
params.setDsSourcePlatform(PurchaseOrderConst.getPurchasePlatformAndOrderDsTblMap().containsKey(dto.getDsSourcePlatform()) ? dto.getDsSourcePlatform() : PurchaseOrderConst.PURCHASE_PLATFORM1688_D_S);
}
return R.ok(params);
return params;
}
public int getPurchaseSetting(Long operateShopId) {
return 0;
}
}

@ -0,0 +1,53 @@
package com.ms.api.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEvent;
import org.springframework.lang.Nullable;
public class SpringUtil implements ApplicationContextAware {
private static final Logger log = LoggerFactory.getLogger(SpringUtil.class);
private static ApplicationContext context;
public SpringUtil() {
}
@Override
public void setApplicationContext(@Nullable ApplicationContext context) throws BeansException {
SpringUtil.context = context;
}
public static <T> T getBean(Class<T> clazz) {
return clazz == null ? null : context.getBean(clazz);
}
public static <T> T getBean(String beanId) {
return beanId == null ? null : (T) context.getBean(beanId);
}
public static <T> T getBean(String beanName, Class<T> clazz) {
if (null != beanName && !"".equals(beanName.trim())) {
return clazz == null ? null : context.getBean(beanName, clazz);
} else {
return null;
}
}
public static ApplicationContext getContext() {
return context == null ? null : context;
}
public static void publishEvent(ApplicationEvent event) {
if (context != null) {
try {
context.publishEvent(event);
} catch (Exception var2) {
log.error(var2.getMessage());
}
}
}
}

@ -0,0 +1,15 @@
package com.ms.dal.bo;
import com.ms.dal.entity.PurchaseOrder;
import com.ms.dal.entity.PurchaseOrderItem;
import com.ms.dal.entity.PurchaseOrderSetting;
import lombok.Data;
@Data
public class PurchaseOrderBO extends PurchaseOrder {
private PurchaseOrderItem item;
private PurchaseOrderSetting purchaseSetting;
}

@ -0,0 +1,59 @@
package com.ms.dal.entity;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 使
* @TableName purchase_order_setting
*/
@Data
public class PurchaseOrderSetting implements Serializable {
/**
*
*/
private Integer purchaseOrderSettingId;
/**
* ID
*/
private Integer purchaseOrderId;
/**
* id
*/
private Long shopId;
/**
*
*/
private Boolean isAddConsigneeSuffix;
/**
*
*/
private String addConsigneeAddressSuffixFields;
/**
*
*/
private String addConsigneeNameSuffixFields;
/**
* origin-,fix-,purchase_mobile_type-
*/
private String purchaseMobileType;
/**
*
*/
private Date gmtCreate;
/**
*
*/
private Date gmtModified;
private static final long serialVersionUID = 1L;
}

@ -1,7 +1,10 @@
package com.ms.dal.mapper;
import java.util.List;
import com.ms.dal.entity.OpOrderChild;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Entity com.ms.dal.entity.OpOrderChild
@ -21,4 +24,5 @@ public interface OpOrderChildMapper {
int updateByPrimaryKey(OpOrderChild record);
String selectOrderIdByShopIdAndTrackingNo(@Param("shopIds") List<String> shopIds,@Param("trackingNo") String trackingNo);
}

@ -2,6 +2,9 @@ package com.ms.dal.mapper;
import com.ms.dal.entity.OpOrderEncryptIndex;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Entity com.ms.dal.entity.OpOrderEncryptIndex
@ -21,4 +24,5 @@ public interface OpOrderEncryptIndexMapper {
int updateByPrimaryKey(OpOrderEncryptIndex record);
String selectOrderIdByShopIdAndFullname(@Param("shopIds") List<String> shopIds, @Param("searchIndex")String searchIndex);
}

@ -1,7 +1,10 @@
package com.ms.dal.mapper;
import java.util.List;
import com.ms.dal.entity.OpOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Entity com.ms.dal.entity.OpOrder
@ -22,4 +25,8 @@ public interface OpOrderMapper {
int updateByPrimaryKey(OpOrder record);
OpOrder selectByOrderId(String orderId);
String selectOrderIdByShopIdAndFullname(@Param("shopIds") List<String> shopIds, @Param("fullname") String fullname);
List<OpOrder> selectById(@Param("shopIds") List<String> shopIds, @Param("orderIdList") List<String> orderIdList);
}

@ -1,7 +1,11 @@
package com.ms.dal.mapper;
import java.util.List;
import com.ms.dal.entity.PurchaseOrder;
import com.ms.dal.entity.PurchaseOrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Entity com.ms.dal.entity.PurchaseOrderItem
@ -21,4 +25,5 @@ public interface PurchaseOrderItemMapper {
int updateByPrimaryKey(PurchaseOrderItem record);
List<PurchaseOrderItem> getPurchaseOrderItemsMapByPurchaseOrderIds(@Param("shopIds") List<String> shopIds, @Param("purchaseOrderIds") List<String> purchaseOrderIds, @Param("status") String status);
}

@ -1,7 +1,11 @@
package com.ms.dal.mapper;
import java.util.List;
import com.ms.dal.bo.PurchaseOrderBO;
import com.ms.dal.entity.PurchaseOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Entity com.ms.dal.entity.PurchaseOrder
@ -21,4 +25,25 @@ public interface PurchaseOrderMapper {
int updateByPrimaryKey(PurchaseOrder record);
List<String> selectOrderIds(@Param("distinctStr") String distinctStr,
@Param("masterTblAlias") String masterTblAlias,
@Param("masterTbl") String masterTbl,
@Param("joinTables") String joinTables,
@Param("shopIds") List<String> shopIds,
@Param("whereConditions") String whereConditions,
@Param("page") Integer page,
@Param("pageSize") Integer pageSize);
Integer selectOrderIdsCount(@Param("distinctStr") String distinctStr,
@Param("masterTblAlias") String masterTblAlias,
@Param("masterTbl") String masterTbl,
@Param("joinTables") String joinTables,
@Param("shopIds") List<String> shopIds,
@Param("whereConditions") String whereConditions);
List<PurchaseOrderBO> selectPurchaseOrders(@Param("shopIds") List<String> shopIds,
@Param("orderIds") List<String> orderIds,
@Param("status") String status,
@Param("whereConditions") String whereConditions);
}

@ -0,0 +1,28 @@
package com.ms.dal.mapper;
import java.util.List;
import com.ms.dal.entity.PurchaseOrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Entity com.ms.dal.entity.PurchaseOrderSetting
*/
@Mapper
public interface PurchaseOrderSettingMapper {
int deleteByPrimaryKey(Long id);
int insert(PurchaseOrderSetting record);
int insertSelective(PurchaseOrderSetting record);
PurchaseOrderSetting selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(PurchaseOrderSetting record);
int updateByPrimaryKey(PurchaseOrderSetting record);
List<PurchaseOrderSetting> selectByPurchaseOrderIds(@Param("shopIds") List<String> shopIds,@Param("purchaseOrderIds") List<String> purchaseOrderIds);
}

@ -1,5 +1,6 @@
package com.ms.dal.mapper;
import com.ms.dal.entity.OpOrder;
import com.ms.dal.entity.PurchaseSetting;
import org.apache.ibatis.annotations.Mapper;
@ -21,4 +22,5 @@ public interface PurchaseSettingMapper {
int updateByPrimaryKey(PurchaseSetting record);
PurchaseSetting selectByShopId(Long shopId);
}

@ -1,7 +1,10 @@
package com.ms.dal.mapper;
import java.util.List;
import com.ms.dal.entity.Shop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Entity com.ms.dal.entity.Shop
@ -21,4 +24,5 @@ public interface ShopMapper {
int updateByPrimaryKey(Shop record);
List<Shop> getShopByIds(@Param("shopIds") List<String> shopIds);
}

@ -0,0 +1,21 @@
package com.ms.dal.service;
import com.ms.dal.entity.PurchaseOrderSetting;
/**
*
*/
public interface PurchaseOrderSettingService {
int deleteByPrimaryKey(Long id);
int insert(PurchaseOrderSetting record);
int insertSelective(PurchaseOrderSetting record);
PurchaseOrderSetting selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(PurchaseOrderSetting record);
int updateByPrimaryKey(PurchaseOrderSetting record);
}

@ -0,0 +1,53 @@
package com.ms.dal.service.impl;
import com.ms.dal.entity.PurchaseOrderSetting;
import com.ms.dal.service.PurchaseOrderSettingService;
import com.ms.dal.mapper.PurchaseOrderSettingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
public class PurchaseOrderSettingServiceImpl implements PurchaseOrderSettingService{
@Autowired
private PurchaseOrderSettingMapper purchaseOrderSettingMapper;
@Override
public int deleteByPrimaryKey(Long id) {
return purchaseOrderSettingMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(PurchaseOrderSetting record) {
return purchaseOrderSettingMapper.insert(record);
}
@Override
public int insertSelective(PurchaseOrderSetting record) {
return purchaseOrderSettingMapper.insertSelective(record);
}
@Override
public PurchaseOrderSetting selectByPrimaryKey(Long id) {
return purchaseOrderSettingMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(PurchaseOrderSetting record) {
return purchaseOrderSettingMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(PurchaseOrderSetting record) {
return purchaseOrderSettingMapper.updateByPrimaryKey(record);
}
}

@ -18,3 +18,9 @@ jx.ds.host-test=https://acn-ds-test.chengji-inc.com/open
jx.ds.token-prod=dighgfghf^&)l3sedi&(.D@BC
jx.ds.token-test=dighgfghf^&)l3sedi&(.D@BC
smd5.key1=^w46a~!%$2djKDUuI)#@
smd5.key2=2gk2li3l>2OJG13*#(OQG*#@@)
shop.encrypt.key=

@ -71,6 +71,18 @@
from op_order_child
where op_order_child_id = #{opOrderChildId,jdbcType=BIGINT}
</select>
<select id="selectOrderIdByShopIdAndTrackingNo" resultType="java.lang.String">
select order_id from op_order_child
where 1=1
<if test="shopIds!=null and shopIds.size>0">
AND shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND express_no = #{trackingNo}
limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from op_order_child

@ -27,6 +27,18 @@
from op_order_encrypt_index
where op_order_encrypt_index_id = #{opOrderEncryptIndexId,jdbcType=BIGINT}
</select>
<select id="selectOrderIdByShopIdAndFullname" resultType="java.lang.String">
select order_id from op_order_encrypt_index
where 1=1
<if test="shopIds!=null and shopIds.size>0">
AND shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND `post_receiver_index` = #{fullname}
limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from op_order_encrypt_index

@ -73,6 +73,36 @@
<select id="selectByOrderId" resultType="com.ms.dal.entity.OpOrder">
select * from op_order where order_id = #{orderId}
</select>
<select id="selectOrderIdByShopIdAndFullname" resultType="java.lang.String">
select order_id from op_order
where 1=1
<if test="shopIds!=null and shopIds.size>0">
AND shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND `post_receiver_smd5` = #{fullname}
limit 1
</select>
<select id="selectById" resultType="com.ms.dal.entity.OpOrder">
select o.*
from op_order o
where 1=1
<if test="shopIds!=null and shopIds.size>0">
AND o.shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="orderIdList!=null and orderIdList.size>0">
AND o.order_id IN
<foreach collection="orderIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by o.gmt_create_time desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from op_order

@ -29,6 +29,25 @@
gmt_create,gmt_modified
</sql>
<select id="getPurchaseOrderItemsMapByPurchaseOrderIds" resultType="com.ms.dal.entity.PurchaseOrderItem">
select *
from purchase_order_item
where 1 = 1
<if test="shopIds!=null and shopIds.size>0">
AND shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="purchaseOrderIds!=null and purchaseOrderIds.size>0">
AND purchase_order_id IN
<foreach collection="purchaseOrderIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and status = #{status}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />

@ -54,6 +54,71 @@
from purchase_order
where purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT}
</select>
<select id="page" resultType="java.lang.String">
select ${distinctStr} ${masterTblAlias}.order_id
from ${masterTbl} as ${masterTblAlias}
${joinTables}
where 1=1
<if test="shopIds!=null and shopIds.size>0">
AND ${joinTables}.shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
${whereConditions}
order by ${masterTblAlias}.gmt_create_time desc
limit #{page},#{pageSize}
</select>
<select id="selectOrderIds" resultType="java.lang.String">
select ${distinctStr} ${masterTblAlias}.order_id
from ${masterTbl} as ${masterTblAlias}
${joinTables}
where 1=1
<if test="shopIds!=null and shopIds.size>0">
AND ${masterTblAlias}.shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
${whereConditions}
order by ${masterTblAlias}.gmt_create_time desc
limit #{page},#{pageSize}
</select>
<select id="selectOrderIdsCount" resultType="java.lang.Integer">
select COUNT(${distinctStr} ${masterTblAlias}.order_id)
from ${masterTbl} as ${masterTblAlias}
${joinTables}
where 1=1
<if test="shopIds!=null and shopIds.size>0">
AND ${masterTblAlias}.shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
${whereConditions}
order by ${masterTblAlias}.gmt_create_time desc
</select>
<select id="selectPurchaseOrders" resultType="com.ms.dal.bo.PurchaseOrderBO">
select po.*
from purchase_order po
where 1 = 1
<if test="shopIds!=null and shopIds.size>0">
AND po.shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="orderIds!=null and orderIds.size>0">
AND po.order_id IN
<foreach collection="orderIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and po.status = #{status}
${whereConditions}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from purchase_order

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ms.dal.mapper.PurchaseOrderSettingMapper">
<resultMap id="BaseResultMap" type="com.ms.dal.entity.PurchaseOrderSetting">
<id property="purchaseOrderSettingId" column="purchase_order_setting_id" jdbcType="INTEGER"/>
<result property="purchaseOrderId" column="purchase_order_id" jdbcType="INTEGER"/>
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
<result property="isAddConsigneeSuffix" column="is_add_consignee_suffix" jdbcType="BOOLEAN"/>
<result property="addConsigneeAddressSuffixFields" column="add_consignee_address_suffix_fields" jdbcType="VARCHAR"/>
<result property="addConsigneeNameSuffixFields" column="add_consignee_name_suffix_fields" jdbcType="VARCHAR"/>
<result property="purchaseMobileType" column="purchase_mobile_type" jdbcType="VARCHAR"/>
<result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/>
<result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
purchase_order_setting_id,purchase_order_id,shop_id,
is_add_consignee_suffix,add_consignee_address_suffix_fields,add_consignee_name_suffix_fields,
purchase_mobile_type,gmt_create,gmt_modified
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from purchase_order_setting
where purchase_order_setting_id = #{purchaseOrderSettingId,jdbcType=INTEGER}
</select>
<select id="selectByPurchaseOrderIds" resultType="com.ms.dal.entity.PurchaseOrderSetting">
select * from purchase_order_setting where 1 = 1
<if test="shopIds!=null and shopIds.size>0">
AND shop_id IN
<foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="purchaseOrderIds!=null and purchaseOrderIds.size>0">
AND purchase_order_id IN
<foreach collection="purchaseOrderIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from purchase_order_setting
where purchase_order_setting_id = #{purchaseOrderSettingId,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="purchase_order_setting_id" keyProperty="purchaseOrderSettingId" parameterType="com.ms.dal.entity.PurchaseOrderSetting" useGeneratedKeys="true">
insert into purchase_order_setting
( purchase_order_setting_id,purchase_order_id,shop_id
,is_add_consignee_suffix,add_consignee_address_suffix_fields,add_consignee_name_suffix_fields
,purchase_mobile_type,gmt_create,gmt_modified
)
values (#{purchaseOrderSettingId,jdbcType=INTEGER},#{purchaseOrderId,jdbcType=INTEGER},#{shopId,jdbcType=BIGINT}
,#{isAddConsigneeSuffix,jdbcType=BOOLEAN},#{addConsigneeAddressSuffixFields,jdbcType=VARCHAR},#{addConsigneeNameSuffixFields,jdbcType=VARCHAR}
,#{purchaseMobileType,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="purchase_order_setting_id" keyProperty="purchaseOrderSettingId" parameterType="com.ms.dal.entity.PurchaseOrderSetting" useGeneratedKeys="true">
insert into purchase_order_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderSettingId != null">purchaseOrderSettingId,</if>
<if test="purchaseOrderId != null">purchaseOrderId,</if>
<if test="shopId != null">shopId,</if>
<if test="isAddConsigneeSuffix != null">isAddConsigneeSuffix,</if>
<if test="addConsigneeAddressSuffixFields != null">addConsigneeAddressSuffixFields,</if>
<if test="addConsigneeNameSuffixFields != null">addConsigneeNameSuffixFields,</if>
<if test="purchaseMobileType != null">purchaseMobileType,</if>
<if test="gmtCreate != null">gmtCreate,</if>
<if test="gmtModified != null">gmtModified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderSettingId != null">purchase_order_setting_id = #{purchaseOrderSettingId,jdbcType=INTEGER},</if>
<if test="purchaseOrderId != null">purchase_order_id = #{purchaseOrderId,jdbcType=INTEGER},</if>
<if test="shopId != null">shop_id = #{shopId,jdbcType=BIGINT},</if>
<if test="isAddConsigneeSuffix != null">is_add_consignee_suffix = #{isAddConsigneeSuffix,jdbcType=BOOLEAN},</if>
<if test="addConsigneeAddressSuffixFields != null">add_consignee_address_suffix_fields = #{addConsigneeAddressSuffixFields,jdbcType=VARCHAR},</if>
<if test="addConsigneeNameSuffixFields != null">add_consignee_name_suffix_fields = #{addConsigneeNameSuffixFields,jdbcType=VARCHAR},</if>
<if test="purchaseMobileType != null">purchase_mobile_type = #{purchaseMobileType,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.PurchaseOrderSetting">
update purchase_order_setting
<set>
<if test="purchaseOrderId != null">
purchase_order_id = #{purchaseOrderId,jdbcType=INTEGER},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=BIGINT},
</if>
<if test="isAddConsigneeSuffix != null">
is_add_consignee_suffix = #{isAddConsigneeSuffix,jdbcType=BOOLEAN},
</if>
<if test="addConsigneeAddressSuffixFields != null">
add_consignee_address_suffix_fields = #{addConsigneeAddressSuffixFields,jdbcType=VARCHAR},
</if>
<if test="addConsigneeNameSuffixFields != null">
add_consignee_name_suffix_fields = #{addConsigneeNameSuffixFields,jdbcType=VARCHAR},
</if>
<if test="purchaseMobileType != null">
purchase_mobile_type = #{purchaseMobileType,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</set>
where purchase_order_setting_id = #{purchaseOrderSettingId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.PurchaseOrderSetting">
update purchase_order_setting
set
purchase_order_id = #{purchaseOrderId,jdbcType=INTEGER},
shop_id = #{shopId,jdbcType=BIGINT},
is_add_consignee_suffix = #{isAddConsigneeSuffix,jdbcType=BOOLEAN},
add_consignee_address_suffix_fields = #{addConsigneeAddressSuffixFields,jdbcType=VARCHAR},
add_consignee_name_suffix_fields = #{addConsigneeNameSuffixFields,jdbcType=VARCHAR},
purchase_mobile_type = #{purchaseMobileType,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where purchase_order_setting_id = #{purchaseOrderSettingId,jdbcType=INTEGER}
</update>
</mapper>

@ -32,12 +32,15 @@
select
<include refid="Base_Column_List" />
from purchase_setting
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
</select>
<select id="selectByShopId" resultType="com.ms.dal.entity.PurchaseSetting">
select * from purchase_setting where shop_id = #{shopId}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from purchase_setting
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="purchase_setting_id" keyProperty="purchaseSettingId" parameterType="com.ms.dal.entity.PurchaseSetting" useGeneratedKeys="true">
insert into purchase_setting
@ -125,11 +128,11 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</set>
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.PurchaseSetting">
update purchase_setting
set
set
shop_id = #{shopId,jdbcType=BIGINT},
is_append_shop_remark = #{isAppendShopRemark,jdbcType=BOOLEAN},
append_shop_remark_tpl = #{appendShopRemarkTpl,jdbcType=VARCHAR},
@ -142,6 +145,6 @@
auto_fill_order_memo_tpl = #{autoFillOrderMemoTpl,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
where purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT}
</update>
</mapper>

@ -34,6 +34,9 @@
from shop
where shop_id = #{shopId,jdbcType=BIGINT}
</select>
<select id="getShopByIds" resultType="com.ms.dal.entity.Shop">
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from shop

@ -0,0 +1,45 @@
package com.ms.web;
import javax.annotation.Resource;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.ms.api.common.Pager;
import com.ms.api.common.R;
import com.ms.api.dto.order.SearchDsOrderFilterDTO;
import com.ms.api.dto.order.SearchDsOrderListRequestDTO;
import com.ms.api.service.PurchaseOrderService;
import com.ms.api.util.PurchaseOrderUtil;
import com.ms.dal.entity.OpOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @description:
* @author: Miccke
* @date: 2020/5/15
*/
@Slf4j
@RestController
@RequestMapping("api/order/")
public class OrderTestController {
@Resource
private PurchaseOrderService purchaseOrderService;
@GetMapping("/searchDsOrderList")
public BaseResponse<Pager<OpOrder>> searchDsOrderList() {
String shopId = "1111";
SearchDsOrderListRequestDTO dto = new SearchDsOrderListRequestDTO();
dto.setPurchaseOrderTab("waitPurchase");
dto.setOrderStartTime("2023-07-01");
dto.setOrderEndTime("2023-08-01");
PurchaseOrderUtil purchaseOrderUtil = new PurchaseOrderUtil();
dto.checkParams();
SearchDsOrderFilterDTO filter = purchaseOrderUtil.searchDsOrderFilter(dto);
Pager<OpOrder> pager = purchaseOrderService.searchDsOrderList(shopId, dto.getPage(), dto.getPageSize(), filter, true, true);
return R.ok(pager);
}
}
Loading…
Cancel
Save