Merge branch 'master' of codeup.aliyun.com:64d9c5feeceb191898f636d7/honor-dd-light-ds-java into ljl-dsPurchaseOrder
commit
743b75a7a7
@ -0,0 +1,201 @@
|
||||
<?php
|
||||
|
||||
class QueueService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @var QueueDao
|
||||
*/
|
||||
private $queueDao;
|
||||
|
||||
private $db;
|
||||
private $solidRedis;
|
||||
|
||||
public function __construct() {
|
||||
$this->queueDao = Zc::singleton('QueueDao');
|
||||
|
||||
$this->db = Zc::getDb();
|
||||
$this->solidRedis = RedisExt::factory('solidCache');
|
||||
}
|
||||
|
||||
public function getQueueMsgList($queueName, $shopId) {
|
||||
return $this->queueDao->getQueueMsgList($queueName, $shopId);
|
||||
}
|
||||
|
||||
public function getQueueMsg($queueName, $queueId) {
|
||||
return $this->queueDao->getQueueMsg($queueName, $queueId);
|
||||
}
|
||||
|
||||
public function addQueueMsg($queueName, $shopId, $app, $accessToken) {
|
||||
return $this->queueDao->addQueueMsg($queueName, $shopId, $app, $accessToken);
|
||||
}
|
||||
|
||||
public function lockQueueMsg($timerLockId, $filter) {
|
||||
return $this->queueDao->lockQueueMsg($timerLockId, $filter);
|
||||
}
|
||||
|
||||
public function unlockTimeoutQueue($queueName, $expiredSeconds = 300, $status = null) {
|
||||
return $this->queueDao->unlockTimeoutQueue($queueName, $expiredSeconds, $status);
|
||||
}
|
||||
|
||||
public function unlockTimeoutSolidRedisQueue($queueName, $heartbeatExpiredSeconds = 300, $status = null) {
|
||||
$c1 = $this->queueDao->unlockSolidRedisDeadQueue($queueName, $heartbeatExpiredSeconds, $status);
|
||||
$c2 = $this->queueDao->unlockSolidRedisSkipQueue($queueName, $status);
|
||||
return $c1 + $c2;
|
||||
}
|
||||
|
||||
public function deleteQueueMsg($queueName, $row) {
|
||||
return $this->queueDao->deleteQueueMsg($queueName, $row);
|
||||
}
|
||||
|
||||
public function lockPriorityQueue($timerLockId, $queueName, $filter) {
|
||||
return $this->queueDao->lockPriorityQueue($timerLockId, $queueName, $filter);
|
||||
}
|
||||
|
||||
public function lockFifoQueue($timerLockId, $queueName, $filter) {
|
||||
return $this->queueDao->lockFifoQueue($timerLockId, $queueName, $filter);
|
||||
}
|
||||
|
||||
public function lockVenderAvgQueue($timerLockId, $queueName, $filter) {
|
||||
return $this->queueDao->lockVenderAvgQueue($timerLockId, $queueName, $filter);
|
||||
}
|
||||
|
||||
public function lockSolidRedisQueue($timerLockId, $queueName, $isAdminSelf) {
|
||||
return $this->queueDao->lockSolidRedisQueue($timerLockId, $queueName, $isAdminSelf);
|
||||
}
|
||||
|
||||
public function batchLockSolidRedisQueue($timerLockId, $queueName, $isAdminSelf, $lockCount) {
|
||||
return $this->queueDao->batchLockSolidRedisQueue($timerLockId, $queueName, $isAdminSelf, $lockCount);
|
||||
}
|
||||
|
||||
public function lockSolidRedisQueueByBufferId($timerLockId, $queueName, $isAdminSelf, $bufferPrimaryColumn) {
|
||||
return $this->queueDao->lockSolidRedisQueueByBufferId($timerLockId, $queueName, $isAdminSelf, $bufferPrimaryColumn);
|
||||
}
|
||||
|
||||
public function allocBufferToQueueByShopAvg($bufferName, $queueName, $filter, $maxQueueCount = 300, $shopLimit = null) {
|
||||
return $this->queueDao->allocBufferToQueueByShopAvg($bufferName, $queueName, $filter, $maxQueueCount, $shopLimit);
|
||||
}
|
||||
|
||||
public function moveBufferToSolidRedisQueue($bufferTableName, $queueTableName, $filter, $maxQueueCount = 2000) {
|
||||
list($realDbId, $bufferTbl) = DbRoute::getDbAndTbl($bufferTableName);
|
||||
list($realDbId, $queueTbl) = DbRoute::getDbAndTbl($queueTableName);
|
||||
|
||||
$wheres = [];
|
||||
if ($filter['gmtExec']) {
|
||||
$wheres[] = $this->db->prepare('and (gmt_exec is null or gmt_exec <= %s)', $filter['gmtExec']);
|
||||
}
|
||||
if ($filter['includeShopIds']) {
|
||||
$wheres[] = $this->db->prepare('AND shop_id IN %li', $filter['includeShopIds']);
|
||||
}
|
||||
|
||||
$queueCount = $this->db->useDbIdOnce($realDbId)->queryFirstField('select count(*) from %b', $queueTbl);
|
||||
if ($queueCount > $maxQueueCount) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$needMoveQueueCount = $maxQueueCount - $queueCount;
|
||||
$limit = 100;
|
||||
$stopFilePath = Zc::C(ZcConfigConst::LogDir) . "stop_do_move_{$bufferTableName}_to_queue";
|
||||
$bufferPrimaryField = QueueConst::getQueueIdColumnName($bufferTbl);
|
||||
$startBufferId = 0;
|
||||
while (true) {
|
||||
if (file_exists($stopFilePath)) {
|
||||
break;
|
||||
}
|
||||
if ($needMoveQueueCount <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
$loopWheres = $wheres;
|
||||
$loopWheres[] = $this->db->prepare('AND %l > %i', $bufferPrimaryField, $startBufferId);
|
||||
$whereStr = implode(' ', $loopWheres);
|
||||
|
||||
$loopLimit = $needMoveQueueCount > $limit ? $limit : $needMoveQueueCount;
|
||||
$bufferList = $this->db->useDbIdOnce($realDbId)->query('select * from %b where 1=1 %l order by %l asc limit %i', $bufferTbl, $whereStr, $bufferPrimaryField, $loopLimit);
|
||||
if (empty($bufferList)) {
|
||||
break;
|
||||
}
|
||||
$deleteBufferIds = [];
|
||||
$queueDatas = [];
|
||||
foreach ($bufferList as $bufferData) {
|
||||
$startBufferId = $bufferData[$bufferPrimaryField];
|
||||
if (!$filter['includeShopIds'] && CommonTool::isCurrAdminSelfShop($bufferData['shop_id'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$deleteBufferIds[] = $bufferData[$bufferPrimaryField];
|
||||
|
||||
$tmpBufferData = $bufferData;
|
||||
unset($tmpBufferData['gmt_exec']);
|
||||
unset($tmpBufferData[$bufferPrimaryField]);
|
||||
$tmpBufferData['locked'] = 0;
|
||||
$tmpBufferData['gmt_create'] = ZcDbEval::now();
|
||||
$tmpBufferData['gmt_modified'] = ZcDbEval::now();
|
||||
$queueDatas[] = $tmpBufferData;
|
||||
}
|
||||
|
||||
$oldErrorMode = $this->db->setErrorMode(ZcDb::ERROR_MODE_EXCEPTION);
|
||||
$transStatus = $this->db->useDbIdOnce($realDbId)->startTransaction();
|
||||
try {
|
||||
if ($queueDatas) {
|
||||
$this->db->useDbIdOnce($realDbId)->insert($queueTbl, $queueDatas);
|
||||
$startQueueId = $this->db->lastInsertId();
|
||||
}
|
||||
|
||||
if ($deleteBufferIds) {
|
||||
$this->db->useDbIdOnce($realDbId)->delete($bufferTbl, '%l IN %li', $bufferPrimaryField, $deleteBufferIds);
|
||||
}
|
||||
|
||||
$this->db->useDbIdOnce($realDbId)->commit($transStatus);
|
||||
$this->db->setErrorMode($oldErrorMode);
|
||||
} catch (Exception $e) {
|
||||
$this->db->useDbIdOnce($realDbId)->rollback($transStatus);
|
||||
$this->db->setErrorMode($oldErrorMode);
|
||||
break;
|
||||
}
|
||||
|
||||
$selfQueueIds = $notSelfQueueIds = [];
|
||||
if (!empty($startQueueId)) {
|
||||
$queueCount = count($queueDatas);
|
||||
$queueIdLoop = 0;
|
||||
for ($queueId = $startQueueId; $queueId < ($queueCount + $startQueueId); $queueId ++) {
|
||||
$loopQueueData = $queueDatas[$queueIdLoop];
|
||||
|
||||
if (CommonTool::isCurrAdminSelfShop($loopQueueData['shop_id'])) {
|
||||
$selfQueueIds[] = $queueId;
|
||||
} else {
|
||||
$notSelfQueueIds[] = $queueId;
|
||||
}
|
||||
$queueIdLoop ++;
|
||||
}
|
||||
}
|
||||
Zc::getLog('timer/common/move_buffer_to_queue/move_buffer')->info("loop startBufferId[{$startBufferId}]");
|
||||
if ($selfQueueIds) {
|
||||
$queueRedisKey = RedisKeyConst::getQueueRedisKey($queueTbl, true);
|
||||
$redisRet = $this->solidRedis->lPush($queueRedisKey, ...$selfQueueIds);
|
||||
if (false === $redisRet) {
|
||||
/** @var Exception $ex */
|
||||
$ex = $this->solidRedis->lastException();
|
||||
$reason = $ex ? $ex->getMessage() : "emptyEx";
|
||||
Zc::getLog('timer/common/move_buffer_to_queue/move_buffer')->info("addQueueIdsToSolidRedisQueue[$queueRedisKey] -> reason : " . $reason);
|
||||
}
|
||||
}
|
||||
if ($notSelfQueueIds) {
|
||||
$queueRedisKey = RedisKeyConst::getQueueRedisKey($queueTbl, false);
|
||||
$redisRet = $this->solidRedis->lPush($queueRedisKey, ...$notSelfQueueIds);
|
||||
if (false === $redisRet) {
|
||||
/** @var Exception $ex */
|
||||
$ex = $this->solidRedis->lastException();
|
||||
$reason = $ex ? $ex->getMessage() : "emptyEx";
|
||||
Zc::getLog('timer/common/move_buffer_to_queue/move_buffer')->info("addQueueIdsToSolidRedisQueue[$queueRedisKey] -> reason : " . $reason);
|
||||
}
|
||||
}
|
||||
|
||||
$needMoveQueueCount -= count($deleteBufferIds);
|
||||
if ($needMoveQueueCount <= 0 || count($bufferList) < $limit) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,47 +1,48 @@
|
||||
package com.ms.api;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.R;
|
||||
import com.ms.api.common.Ret;
|
||||
import com.ms.api.common.SPIBaseService;
|
||||
import com.ms.api.dto.ItemDTO;
|
||||
import com.ms.api.tool.DsJsonRequestTemplate;
|
||||
import com.ms.api.tool.SecurityTool;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@ExtensionService("testSpi")
|
||||
@Slf4j
|
||||
public class TestSpiService implements ExtensionServiceHandler<ItemDTO, Ret> {
|
||||
|
||||
public class TestSpiService extends SPIBaseService implements ExtensionServiceHandler<ItemDTO, JSONObject> {
|
||||
@Autowired
|
||||
private DsJsonRequestTemplate dsJsonRequestTemplate;
|
||||
@Override
|
||||
public BaseResponse<Ret> handle(BaseRequest<ItemDTO> req) {
|
||||
|
||||
String resourceFileName = "/getProductCatTree.txt"; // 注意路径的开头是一个斜杠
|
||||
String lines = null;
|
||||
try (InputStream is = InputStream.class.getResourceAsStream(resourceFileName);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
System.out.println(line);
|
||||
log.info(line);
|
||||
lines = lines + line;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
public BaseResponse<JSONObject> handle(BaseRequest<ItemDTO> req) {
|
||||
initHandle(req);
|
||||
getAuthCode();
|
||||
String res = null;
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("platformItemId", SecurityTool.encodeByAES("1"));
|
||||
params.put("sourceItemId", "33");
|
||||
params.put("authCode", authCode);
|
||||
try {
|
||||
res = dsJsonRequestTemplate.execute("/micro_move/add_platform_item_to_source_item_relation", params);
|
||||
log.info("rrrr"+res);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("line", lines);
|
||||
|
||||
return R.ok(Ret.success(result));
|
||||
return R.ok(JSON.parseObject(res));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.ms.api.consts;
|
||||
public class QueueConst {
|
||||
|
||||
public static final String orderCareRsyncQueue = "order_care_rsync_queue";
|
||||
public static final String orderFullRsyncQueue = "order_full_rsync_queue";
|
||||
public static final String orderQuickRsyncQueue = "order_quick_rsync_queue";
|
||||
|
||||
public static final String wareQuickRsyncQueue = "ware_quick_rsync_queue";
|
||||
public static final String wareFullRsyncQueue = "ware_full_rsync_queue";
|
||||
|
||||
public static final String crmMemberFullRsyncQueue = "crm_member_full_rsync_queue";
|
||||
public static final String crmMemberQuickRsyncQueue = "crm_member_quick_rsync_queue";
|
||||
|
||||
public static final String titleKeywordRsyncQueue = "title_keyword_rsync_queue";
|
||||
|
||||
public static final String statusProcessing = "processing";
|
||||
public static final String statusWait = "wait";
|
||||
public static final String statusFinish = "finish";
|
||||
|
||||
public static final Integer maxMoveImportTaskQueueCount = 1000;
|
||||
public static final Integer maxMoveImportTaskQueueCountSelf = 50;
|
||||
|
||||
public static String getQueueIdColumnName(String queueName) {
|
||||
return queueName.concat("_id");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.ms.api.service;
|
||||
|
||||
import com.ms.dal.entity.PurchaseOrderCustom;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface PurchaseOrderCustomService {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(PurchaseOrderCustom record);
|
||||
|
||||
int insertSelective(PurchaseOrderCustom record);
|
||||
|
||||
PurchaseOrderCustom selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(PurchaseOrderCustom record);
|
||||
|
||||
int updateByPrimaryKey(PurchaseOrderCustom record);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.ms.api.service;
|
||||
|
||||
import com.ms.dal.entity.PurchaseOrderDsEncrypt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface PurchaseOrderDsEncryptService {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(PurchaseOrderDsEncrypt record);
|
||||
|
||||
int insertSelective(PurchaseOrderDsEncrypt record);
|
||||
|
||||
PurchaseOrderDsEncrypt selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(PurchaseOrderDsEncrypt record);
|
||||
|
||||
int updateByPrimaryKey(PurchaseOrderDsEncrypt record);
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.ms.api.service;
|
||||
|
||||
public interface QueueService {
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.ms.api.service.impl;
|
||||
|
||||
import com.ms.dal.entity.PurchaseOrderCustom;
|
||||
import com.ms.api.service.PurchaseOrderCustomService;
|
||||
import com.ms.dal.mapper.PurchaseOrderCustomMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class PurchaseOrderCustomServiceImpl implements PurchaseOrderCustomService{
|
||||
|
||||
@Autowired
|
||||
private PurchaseOrderCustomMapper purchaseOrderCustomMapper;
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Long id) {
|
||||
return purchaseOrderCustomMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(PurchaseOrderCustom record) {
|
||||
return purchaseOrderCustomMapper.insert(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(PurchaseOrderCustom record) {
|
||||
return purchaseOrderCustomMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchaseOrderCustom selectByPrimaryKey(Long id) {
|
||||
return purchaseOrderCustomMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKeySelective(PurchaseOrderCustom record) {
|
||||
return purchaseOrderCustomMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKey(PurchaseOrderCustom record) {
|
||||
return purchaseOrderCustomMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,53 @@
|
||||
package com.ms.api.service.impl;
|
||||
|
||||
import com.ms.dal.entity.PurchaseOrderDsEncrypt;
|
||||
import com.ms.api.service.PurchaseOrderDsEncryptService;
|
||||
import com.ms.dal.mapper.PurchaseOrderDsEncryptMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class PurchaseOrderDsEncryptServiceImpl implements PurchaseOrderDsEncryptService{
|
||||
|
||||
@Autowired
|
||||
private PurchaseOrderDsEncryptMapper purchaseOrderDsEncryptMapper;
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Long id) {
|
||||
return purchaseOrderDsEncryptMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(PurchaseOrderDsEncrypt record) {
|
||||
return purchaseOrderDsEncryptMapper.insert(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(PurchaseOrderDsEncrypt record) {
|
||||
return purchaseOrderDsEncryptMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchaseOrderDsEncrypt selectByPrimaryKey(Long id) {
|
||||
return purchaseOrderDsEncryptMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKeySelective(PurchaseOrderDsEncrypt record) {
|
||||
return purchaseOrderDsEncryptMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKey(PurchaseOrderDsEncrypt record) {
|
||||
return purchaseOrderDsEncryptMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.ms.api.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ms.api.consts.QueueConst;
|
||||
import com.ms.api.consts.RedisKeyConst;
|
||||
import com.ms.api.service.QueueService;
|
||||
import com.ms.dal.mapper.QueueMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QueueServiceImpl implements QueueService {
|
||||
|
||||
private final RedisTemplate<String, String> redisTemplate;
|
||||
|
||||
private final QueueMapper queueMapper;
|
||||
|
||||
// public void lockSolidRedisQueue(Integer timerLockId, String queueName, boolean isAdminSelf) {
|
||||
// String queueRedisKey = RedisKeyConst.getQueueRedisKey(queueName, isAdminSelf);
|
||||
// String queueId = redisTemplate.opsForList().rightPop(queueRedisKey);
|
||||
// if (StrUtil.isBlank(queueId)) {
|
||||
// return;
|
||||
// }
|
||||
// String primaryColumn = QueueConst.getQueueIdColumnName(queueName);
|
||||
// queueMapper.queryFirstRow("select * from %b where `locked` = 0 and %b = %i");
|
||||
//
|
||||
// }
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.ms.api.spi.move;
|
||||
|
||||
import com.doudian.open.api.freightTemplate_list.data.FreightTemplateListData;
|
||||
import com.doudian.open.api.freightTemplate_list.param.FreightTemplateListParam;
|
||||
import com.doudian.open.api.product_isv_getClueList.data.ProductIsvGetClueListData;
|
||||
import com.doudian.open.api.product_isv_getClueList.param.ProductIsvGetClueListParam;
|
||||
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.R;
|
||||
import com.ms.api.common.Ret;
|
||||
import com.ms.api.common.SPIBaseService;
|
||||
import com.ms.api.dto.move.GetFreightTemplateListRequestDTO;
|
||||
import com.ms.api.dto.move.GetShopCloudHotProductsRequestDTO;
|
||||
import com.ms.api.tool.DsJsonRequestTemplate;
|
||||
import com.ms.api.util.DdRequestUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 获取店铺模板列表
|
||||
*/
|
||||
@ExtensionService("getFreightTemplateList")
|
||||
@Slf4j
|
||||
public class GetFreightTemplateList extends SPIBaseService implements ExtensionServiceHandler<GetFreightTemplateListRequestDTO, Ret> {
|
||||
@Override
|
||||
public BaseResponse<Ret> handle(BaseRequest<GetFreightTemplateListRequestDTO> req) {
|
||||
initHandle(req);
|
||||
// ----参数校验----
|
||||
GetFreightTemplateListRequestDTO fields = req.getData();
|
||||
|
||||
// ----逻辑校验----
|
||||
|
||||
// ----业务处理----
|
||||
FreightTemplateListParam param = new FreightTemplateListParam();
|
||||
param.setSize(fields.getSize());
|
||||
FreightTemplateListData data = DdRequestUtil.FreightTemplateListDataRequest(param);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("data", data.getList());
|
||||
result.put("total", data.getCount());
|
||||
|
||||
// ----结果返回----
|
||||
return R.ok(Ret.success(result));
|
||||
}
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package com.ms.api.task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ms.api.common.StrObjMap;
|
||||
import com.ms.api.common.TaskBaseService;
|
||||
import com.ms.api.consts.RedisKeyConst;
|
||||
import com.ms.api.service.MoveProductPublishQueueService;
|
||||
import com.ms.api.service.OpOrderRsyncQueueService;
|
||||
import com.ms.api.tool.CommonTool;
|
||||
import com.ms.dal.entity.MoveProductPublishBuffer;
|
||||
import com.ms.dal.entity.MoveProductPublishQueue;
|
||||
import com.ms.dal.entity.MoveShopConfig;
|
||||
import com.ms.dal.entity.OpOrderRsyncQueue;
|
||||
import com.ms.dal.mapper.OpOrderRsyncQueueMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 将move_product_publish_buffer中的数据
|
||||
* 移到move_product_publish_queue中的操作
|
||||
*/
|
||||
@Configuration
|
||||
@Component
|
||||
@Slf4j
|
||||
public class RsyncOpTaskService extends TaskBaseService {
|
||||
|
||||
private static final String TASK_NAME = "RsyncOp";
|
||||
|
||||
@Autowired
|
||||
private OpOrderRsyncQueueService opOrderRsyncQueueService;
|
||||
|
||||
|
||||
/**
|
||||
* 同时开启任务处理数量
|
||||
*/
|
||||
@Override
|
||||
public int getCorePoolSiz() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务管理器名称
|
||||
*/
|
||||
@Override
|
||||
public String getTaskExecutorName() {
|
||||
return "rsyncOpTaskPool";
|
||||
}
|
||||
|
||||
@Bean(name = "rsyncOpTaskPool")
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
return super.getAsyncExecutor();
|
||||
}
|
||||
|
||||
@Resource(name = "rsyncOpTaskPool")
|
||||
protected Executor taskPool;
|
||||
|
||||
@Override
|
||||
protected Executor getTaskPool() {
|
||||
return taskPool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTask() {
|
||||
super.runTask();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务
|
||||
*/
|
||||
@Override
|
||||
public Object getTask() {
|
||||
return getBuffer(500);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理任务
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object processTask(Object params) {
|
||||
Map<Long, Integer> selectMap = (Map<Long, Integer>) params;
|
||||
log.info("start moveProductPublishBufferToQueue");
|
||||
Map<Long, Integer> bufferCountMap = bufferToQueue(selectMap);
|
||||
log.info("end moveProductPublishBufferToQueue ret: " + bufferCountMap.toString());
|
||||
return bufferCountMap;
|
||||
}
|
||||
|
||||
private Map<Long, Integer> bufferToQueue(Map<Long, Integer> selectMap) {
|
||||
return new HashMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理任务
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
@Override
|
||||
public void clearTask(Object params) {
|
||||
}
|
||||
private Map<Long, Integer> getBuffer(int maxQueueCount) {
|
||||
log.info("handle {}",TASK_NAME);
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
private void lockRsyncOpQueue(Long timerLockId){
|
||||
opOrderRsyncQueueService.lockSolidRedisQueue(timerLockId,false);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.ms.dal.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName purchase_order_custom
|
||||
*/
|
||||
@Data
|
||||
public class PurchaseOrderCustom implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long purchaseOrderCustomId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long purchaseOrderId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private BigDecimal customPurchaseOrderPayment;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String customPurchaseOrderBuyer;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String customPurchaseOrderSeller;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long operateShopId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String operateIp;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String lastPayFailReason;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date gmtCreate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date gmtModified;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ms.dal.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName purchase_order_ds_encrypt
|
||||
*/
|
||||
@Data
|
||||
public class PurchaseOrderDsEncrypt implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long purchaseOrderDsEncryptId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String purchaseOrderSn;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Boolean isSupportEncryptOrder;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Byte isEncryptOrder;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String result;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date gmtCreate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date gmtModified;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.ms.dal.mapper;
|
||||
|
||||
import com.ms.dal.entity.PurchaseOrderCustom;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Entity com.ms.dal.entity.PurchaseOrderCustom
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaseOrderCustomMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(PurchaseOrderCustom record);
|
||||
|
||||
int insertOrUpdate(PurchaseOrderCustom record);
|
||||
|
||||
int insertSelective(PurchaseOrderCustom record);
|
||||
|
||||
PurchaseOrderCustom selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(PurchaseOrderCustom record);
|
||||
|
||||
int updateByPrimaryKey(PurchaseOrderCustom record);
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.ms.dal.mapper;
|
||||
|
||||
import com.ms.dal.entity.PurchaseOrderDsEncrypt;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Entity com.ms.dal.entity.PurchaseOrderDsEncrypt
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaseOrderDsEncryptMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(PurchaseOrderDsEncrypt record);
|
||||
|
||||
int insertOrUpdate(PurchaseOrderDsEncrypt record);
|
||||
|
||||
int insertSelective(PurchaseOrderDsEncrypt record);
|
||||
|
||||
PurchaseOrderDsEncrypt selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(PurchaseOrderDsEncrypt record);
|
||||
|
||||
int updateByPrimaryKey(PurchaseOrderDsEncrypt record);
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.ms.dal.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface QueueMapper {
|
||||
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
<?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.PurchaseOrderCustomMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ms.dal.entity.PurchaseOrderCustom">
|
||||
<id property="purchaseOrderCustomId" column="purchase_order_custom_id" jdbcType="BIGINT"/>
|
||||
<result property="purchaseOrderId" column="purchase_order_id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
|
||||
<result property="customPurchaseOrderPayment" column="custom_purchase_order_payment" jdbcType="DECIMAL"/>
|
||||
<result property="customPurchaseOrderBuyer" column="custom_purchase_order_buyer" jdbcType="VARCHAR"/>
|
||||
<result property="customPurchaseOrderSeller" column="custom_purchase_order_seller" jdbcType="VARCHAR"/>
|
||||
<result property="operateShopId" column="operate_shop_id" jdbcType="BIGINT"/>
|
||||
<result property="operateIp" column="operate_ip" jdbcType="VARCHAR"/>
|
||||
<result property="lastPayFailReason" column="last_pay_fail_reason" 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_custom_id,purchase_order_id,shop_id,
|
||||
custom_purchase_order_payment,custom_purchase_order_buyer,custom_purchase_order_seller,
|
||||
operate_shop_id,operate_ip,last_pay_fail_reason,
|
||||
gmt_create,gmt_modified
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from purchase_order_custom
|
||||
where purchase_order_custom_id = #{purchaseOrderCustomId,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from purchase_order_custom
|
||||
where purchase_order_custom_id = #{purchaseOrderCustomId,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="purchase_order_custom_id" keyProperty="purchaseOrderCustomId" parameterType="com.ms.dal.entity.PurchaseOrderCustom" useGeneratedKeys="true">
|
||||
insert into purchase_order_custom
|
||||
( purchase_order_custom_id,purchase_order_id,shop_id
|
||||
,custom_purchase_order_payment,custom_purchase_order_buyer,custom_purchase_order_seller
|
||||
,operate_shop_id,operate_ip,last_pay_fail_reason
|
||||
,gmt_create,gmt_modified)
|
||||
values (#{purchaseOrderCustomId,jdbcType=BIGINT},#{purchaseOrderId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT}
|
||||
,#{customPurchaseOrderPayment,jdbcType=DECIMAL},#{customPurchaseOrderBuyer,jdbcType=VARCHAR},#{customPurchaseOrderSeller,jdbcType=VARCHAR}
|
||||
,#{operateShopId,jdbcType=BIGINT},#{operateIp,jdbcType=VARCHAR},#{lastPayFailReason,jdbcType=VARCHAR}
|
||||
,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<update id="insertOrUpdate" keyColumn="purchase_order_custom_id" keyProperty="purchaseOrderCustomId" parameterType="com.ms.dal.entity.PurchaseOrderCustom"
|
||||
useGeneratedKeys="true">
|
||||
insert into purchase_order_custom
|
||||
( purchase_order_custom_id,purchase_order_id,shop_id
|
||||
,custom_purchase_order_payment,custom_purchase_order_buyer,custom_purchase_order_seller
|
||||
,operate_shop_id,operate_ip,last_pay_fail_reason
|
||||
,gmt_create,gmt_modified)
|
||||
values (#{purchaseOrderCustomId,jdbcType=BIGINT},#{purchaseOrderId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT}
|
||||
,#{customPurchaseOrderPayment,jdbcType=DECIMAL},#{customPurchaseOrderBuyer,jdbcType=VARCHAR},#{customPurchaseOrderSeller,jdbcType=VARCHAR}
|
||||
,#{operateShopId,jdbcType=BIGINT},#{operateIp,jdbcType=VARCHAR},#{lastPayFailReason,jdbcType=VARCHAR}
|
||||
,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP})
|
||||
ON DUPLICATE KEY UPDATE
|
||||
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT}, shop_id = #{shopId,jdbcType=BIGINT}, custom_purchase_order_payment = #{customPurchaseOrderPayment,jdbcType=DECIMAL}, custom_purchase_order_buyer = #{customPurchaseOrderBuyer,jdbcType=VARCHAR}, custom_purchase_order_seller = #{customPurchaseOrderSeller,jdbcType=VARCHAR}, operate_shop_id = #{operateShopId,jdbcType=BIGINT}, operate_ip = #{operateIp,jdbcType=VARCHAR}, last_pay_fail_reason = #{lastPayFailReason,jdbcType=VARCHAR}, gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
|
||||
</update>
|
||||
<insert id="insertSelective" keyColumn="purchase_order_custom_id" keyProperty="purchaseOrderCustomId" parameterType="com.ms.dal.entity.PurchaseOrderCustom" useGeneratedKeys="true">
|
||||
insert into purchase_order_custom
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="purchaseOrderCustomId != null">purchase_order_custom_id,</if>
|
||||
<if test="purchaseOrderId != null">purchase_order_id,</if>
|
||||
<if test="shopId != null">shop_id,</if>
|
||||
<if test="customPurchaseOrderPayment != null">custom_purchase_order_payment,</if>
|
||||
<if test="customPurchaseOrderBuyer != null">custom_purchase_order_buyer,</if>
|
||||
<if test="customPurchaseOrderSeller != null">custom_purchase_order_seller,</if>
|
||||
<if test="operateShopId != null">operate_shop_id,</if>
|
||||
<if test="operateIp != null">operate_ip,</if>
|
||||
<if test="lastPayFailReason != null">last_pay_fail_reason,</if>
|
||||
<if test="gmtCreate != null">gmt_create,</if>
|
||||
<if test="gmtModified != null">gmt_modified,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="purchaseOrderCustomId != null">#{purchaseOrderCustomId,jdbcType=BIGINT},</if>
|
||||
<if test="purchaseOrderId != null">#{purchaseOrderId,jdbcType=BIGINT},</if>
|
||||
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
|
||||
<if test="customPurchaseOrderPayment != null">#{customPurchaseOrderPayment,jdbcType=DECIMAL},</if>
|
||||
<if test="customPurchaseOrderBuyer != null">#{customPurchaseOrderBuyer,jdbcType=VARCHAR},</if>
|
||||
<if test="customPurchaseOrderSeller != null">#{customPurchaseOrderSeller,jdbcType=VARCHAR},</if>
|
||||
<if test="operateShopId != null">#{operateShopId,jdbcType=BIGINT},</if>
|
||||
<if test="operateIp != null">#{operateIp,jdbcType=VARCHAR},</if>
|
||||
<if test="lastPayFailReason != null">#{lastPayFailReason,jdbcType=VARCHAR},</if>
|
||||
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
|
||||
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.PurchaseOrderCustom">
|
||||
update purchase_order_custom
|
||||
<set>
|
||||
<if test="purchaseOrderId != null">
|
||||
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="customPurchaseOrderPayment != null">
|
||||
custom_purchase_order_payment = #{customPurchaseOrderPayment,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="customPurchaseOrderBuyer != null">
|
||||
custom_purchase_order_buyer = #{customPurchaseOrderBuyer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="customPurchaseOrderSeller != null">
|
||||
custom_purchase_order_seller = #{customPurchaseOrderSeller,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="operateShopId != null">
|
||||
operate_shop_id = #{operateShopId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="operateIp != null">
|
||||
operate_ip = #{operateIp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="lastPayFailReason != null">
|
||||
last_pay_fail_reason = #{lastPayFailReason,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_custom_id = #{purchaseOrderCustomId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.PurchaseOrderCustom">
|
||||
update purchase_order_custom
|
||||
set
|
||||
purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT},
|
||||
shop_id = #{shopId,jdbcType=BIGINT},
|
||||
custom_purchase_order_payment = #{customPurchaseOrderPayment,jdbcType=DECIMAL},
|
||||
custom_purchase_order_buyer = #{customPurchaseOrderBuyer,jdbcType=VARCHAR},
|
||||
custom_purchase_order_seller = #{customPurchaseOrderSeller,jdbcType=VARCHAR},
|
||||
operate_shop_id = #{operateShopId,jdbcType=BIGINT},
|
||||
operate_ip = #{operateIp,jdbcType=VARCHAR},
|
||||
last_pay_fail_reason = #{lastPayFailReason,jdbcType=VARCHAR},
|
||||
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
|
||||
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
|
||||
where purchase_order_custom_id = #{purchaseOrderCustomId,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,137 @@
|
||||
<?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.PurchaseOrderDsEncryptMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ms.dal.entity.PurchaseOrderDsEncrypt">
|
||||
<id property="purchaseOrderDsEncryptId" column="purchase_order_ds_encrypt_id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
|
||||
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
|
||||
<result property="purchaseOrderSn" column="purchase_order_sn" jdbcType="VARCHAR"/>
|
||||
<result property="isSupportEncryptOrder" column="is_support_encrypt_order" jdbcType="BOOLEAN"/>
|
||||
<result property="isEncryptOrder" column="is_encrypt_order" jdbcType="TINYINT"/>
|
||||
<result property="result" column="result" jdbcType="VARCHAR"/>
|
||||
<result property="reason" column="reason" 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_ds_encrypt_id,shop_id,order_id,
|
||||
purchase_order_sn,is_support_encrypt_order,is_encrypt_order,
|
||||
result,reason,gmt_create,
|
||||
gmt_modified
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from purchase_order_ds_encrypt
|
||||
where purchase_order_ds_encrypt_id = #{purchaseOrderDsEncryptId,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from purchase_order_ds_encrypt
|
||||
where purchase_order_ds_encrypt_id = #{purchaseOrderDsEncryptId,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="purchase_order_ds_encrypt_id" keyProperty="purchaseOrderDsEncryptId" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt" useGeneratedKeys="true">
|
||||
insert into purchase_order_ds_encrypt
|
||||
( purchase_order_ds_encrypt_id,shop_id,order_id
|
||||
,purchase_order_sn,is_support_encrypt_order,is_encrypt_order
|
||||
,result,reason,gmt_create
|
||||
,gmt_modified)
|
||||
values (#{purchaseOrderDsEncryptId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR}
|
||||
,#{purchaseOrderSn,jdbcType=VARCHAR},#{isSupportEncryptOrder,jdbcType=BOOLEAN},#{isEncryptOrder,jdbcType=TINYINT}
|
||||
,#{result,jdbcType=VARCHAR},#{reason,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP}
|
||||
,#{gmtModified,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<update id="insertOrUpdate" keyColumn="purchase_order_ds_encrypt_id" keyProperty="purchaseOrderDsEncryptId" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt"
|
||||
useGeneratedKeys="true">
|
||||
insert into purchase_order_ds_encrypt
|
||||
( purchase_order_ds_encrypt_id,shop_id,order_id
|
||||
,purchase_order_sn,is_support_encrypt_order,is_encrypt_order
|
||||
,result,reason,gmt_create
|
||||
,gmt_modified)
|
||||
values (#{purchaseOrderDsEncryptId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR}
|
||||
,#{purchaseOrderSn,jdbcType=VARCHAR},#{isSupportEncryptOrder,jdbcType=BOOLEAN},#{isEncryptOrder,jdbcType=TINYINT}
|
||||
,#{result,jdbcType=VARCHAR},#{reason,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP}
|
||||
,#{gmtModified,jdbcType=TIMESTAMP})
|
||||
ON DUPLICATE KEY UPDATE
|
||||
shop_id = #{shopId,jdbcType=BIGINT}, order_id = #{orderId,jdbcType=VARCHAR}, purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR}, is_support_encrypt_order = #{isSupportEncryptOrder,jdbcType=BOOLEAN}, is_encrypt_order = #{isEncryptOrder,jdbcType=TINYINT}, result = #{result,jdbcType=VARCHAR}, reason = #{reason,jdbcType=VARCHAR}, gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
|
||||
</update>
|
||||
<insert id="insertSelective" keyColumn="purchase_order_ds_encrypt_id" keyProperty="purchaseOrderDsEncryptId" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt" useGeneratedKeys="true">
|
||||
insert into purchase_order_ds_encrypt
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="purchaseOrderDsEncryptId != null">purchase_order_ds_encrypt_id,</if>
|
||||
<if test="shopId != null">shop_id,</if>
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="purchaseOrderSn != null">purchase_order_sn,</if>
|
||||
<if test="isSupportEncryptOrder != null">is_support_encrypt_order,</if>
|
||||
<if test="isEncryptOrder != null">is_encrypt_order,</if>
|
||||
<if test="result != null">result,</if>
|
||||
<if test="reason != null">reason,</if>
|
||||
<if test="gmtCreate != null">gmt_create,</if>
|
||||
<if test="gmtModified != null">gmt_modified,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="purchaseOrderDsEncryptId != null">#{purchaseOrderDsEncryptId,jdbcType=BIGINT},</if>
|
||||
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
|
||||
<if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
|
||||
<if test="purchaseOrderSn != null">#{purchaseOrderSn,jdbcType=VARCHAR},</if>
|
||||
<if test="isSupportEncryptOrder != null">#{isSupportEncryptOrder,jdbcType=BOOLEAN},</if>
|
||||
<if test="isEncryptOrder != null">#{isEncryptOrder,jdbcType=TINYINT},</if>
|
||||
<if test="result != null">#{result,jdbcType=VARCHAR},</if>
|
||||
<if test="reason != null">#{reason,jdbcType=VARCHAR},</if>
|
||||
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
|
||||
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt">
|
||||
update purchase_order_ds_encrypt
|
||||
<set>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="orderId != null">
|
||||
order_id = #{orderId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="purchaseOrderSn != null">
|
||||
purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isSupportEncryptOrder != null">
|
||||
is_support_encrypt_order = #{isSupportEncryptOrder,jdbcType=BOOLEAN},
|
||||
</if>
|
||||
<if test="isEncryptOrder != null">
|
||||
is_encrypt_order = #{isEncryptOrder,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="result != null">
|
||||
result = #{result,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="reason != null">
|
||||
reason = #{reason,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_ds_encrypt_id = #{purchaseOrderDsEncryptId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.PurchaseOrderDsEncrypt">
|
||||
update purchase_order_ds_encrypt
|
||||
set
|
||||
shop_id = #{shopId,jdbcType=BIGINT},
|
||||
order_id = #{orderId,jdbcType=VARCHAR},
|
||||
purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR},
|
||||
is_support_encrypt_order = #{isSupportEncryptOrder,jdbcType=BOOLEAN},
|
||||
is_encrypt_order = #{isEncryptOrder,jdbcType=TINYINT},
|
||||
result = #{result,jdbcType=VARCHAR},
|
||||
reason = #{reason,jdbcType=VARCHAR},
|
||||
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
|
||||
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
|
||||
where purchase_order_ds_encrypt_id = #{purchaseOrderDsEncryptId,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,8 @@
|
||||
<?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.QueueMapper">
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue