取消复制调试修改

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
parent 1f2f26774b
commit 2c58cf94d5

@ -35,5 +35,7 @@ public interface MoveProductPublishQueueService {
MoveProductPublishQueue selectByMoveCollectTaskDetailId(long taskDetailId);
int deleteByShopId(Long moveCollectTaskDetailId, Long shopId);
int deleteByShopId(Long shopId, Long moveCollectTaskDetailId);
Long getLockedQueueId(Long shopId, Long moveCollectTaskDetailId);
}

@ -19,6 +19,8 @@ public interface MoveProductPublishToPicQueueService {
int updateByPrimaryKey(MoveProductPublishToPicQueue record);
int deleteByShopId(Long moveCollectTaskDetailId, Long shopId);
int deleteByShopId(Long shopId, Long moveCollectTaskDetailId);
Long getLockedQueueId(Long shopId, Long moveCollectTaskDetailId);
}

@ -141,10 +141,14 @@ public class MoveProductPublishQueueServiceImpl implements MoveProductPublishQue
}
@Override
public int deleteByShopId(Long moveCollectTaskDetailId, Long shopId) {
return moveProductPublishQueueMapper.deleteByShopId(moveCollectTaskDetailId, shopId);
public int deleteByShopId(Long shopId, Long moveCollectTaskDetailId) {
return moveProductPublishQueueMapper.deleteByShopId(shopId, moveCollectTaskDetailId);
}
@Override
public Long getLockedQueueId(Long shopId, Long moveCollectTaskDetailId) {
return moveProductPublishQueueMapper.getLockedQueueId(shopId, moveCollectTaskDetailId);
}
}

@ -47,8 +47,13 @@ public class MoveProductPublishToPicQueueServiceImpl implements MoveProductPubli
}
@Override
public int deleteByShopId(Long moveCollectTaskDetailId, Long shopId) {
return moveProductPublishToPicQueueMapper.deleteByShopId(moveCollectTaskDetailId, shopId);
public int deleteByShopId(Long shopId, Long moveCollectTaskDetailId) {
return moveProductPublishToPicQueueMapper.deleteByShopId(shopId, moveCollectTaskDetailId);
}
@Override
public Long getLockedQueueId(Long shopId, Long moveCollectTaskDetailId) {
return moveProductPublishToPicQueueMapper.getLockedQueueId(shopId, moveCollectTaskDetailId);
}
}

@ -1,5 +1,6 @@
package com.ms.api.spi.move;
import cn.hutool.core.util.ObjectUtil;
import com.jinritemai.cloud.base.api.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.jinritemai.cloud.base.api.ExtensionService;
@ -80,11 +81,11 @@ public class CancelCollectTaskService extends SPIBaseService implements Extensio
if (!Arrays.toString(statusArray).contains(moveCollectTaskDetail.getStatus())) {
continue;
}
// $moveDetailExt = $this->getMoveCollectTaskDetailExt($shopId, $detailId);
// if ($this->checkMoveQueueIsProcessing($shopId, $detailId)) {
// $skipCancelDetailIds[] = $detailId;
// continue;
// }
// $moveDetailExt = $this->getMoveCollectTaskDetailExt($shopId, $detailId); // 扩展表,目前没用到
if (this.checkMoveQueueIsProcessing(shopId, detailId)) {
skipCancelDetailIds.add(detailId);
continue;
}
try {
int delRow = this.delQueueByDetailId(shopId, detailId);
// $delPicRow = $this->delToPicQueueByDetailId($shopId, $detailId); // 和上面重复了,可能不需要
@ -142,4 +143,14 @@ public class CancelCollectTaskService extends SPIBaseService implements Extensio
private int delBufferByDetailId(Long shopId, Long detailId) {
return moveProductPublishBufferService.deleteByShopId(shopId, detailId);
}
private Boolean checkMoveQueueIsProcessing(Long shopId, Long detailId) {
Long toPicQueueId = moveProductPublishToPicQueueService.getLockedQueueId(shopId, detailId);
Long picQueueId = moveProductPublishQueueService.getLockedQueueId(shopId, detailId);
if (!ObjectUtil.isEmpty(toPicQueueId) || !ObjectUtil.isEmpty(picQueueId)) {
return true;
} else {
return false;
}
}
}

@ -9,7 +9,7 @@ import com.ms.api.common.Ret;
import com.ms.api.common.TimerBaseService;
import com.ms.api.dto.ItemDTO;
import com.ms.api.task.CheckAuditStatusTimeoutTaskService;
import com.ms.api.task.RefreshTokenTimerTaskService;
import com.ms.api.task.RefreshTokenTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,11 +17,11 @@ import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
public class RefreshTokenTimerService extends TimerBaseService implements ExtensionServiceHandler<ItemDTO, Ret> {
@Autowired
RefreshTokenTimerTaskService refreshTokenTimerTaskService;
RefreshTokenTaskService refreshTokenTaskService;
@Override
public BaseResponse<Ret> handle(BaseRequest<ItemDTO> req) {
refreshTokenTimerTaskService.runTask();
refreshTokenTaskService.runTask();
return R.ok(Ret.success());
}
}

@ -37,7 +37,7 @@ import java.util.concurrent.Executor;
@Configuration
@Component
@Slf4j
public class RefreshTokenTimerTaskService extends TaskBaseService {
public class RefreshTokenTaskService extends TaskBaseService {
@Autowired
ShopService shopService;

@ -33,5 +33,7 @@ public interface MoveProductPublishQueueMapper {
int updateByMoveCollectTaskDetailIdForUnlock(MoveProductPublishQueue moveProductPublishQueue);
int deleteByShopId(Long moveCollectTaskDetailId, Long shopId);
int deleteByShopId(Long shopId, Long moveCollectTaskDetailId);
Long getLockedQueueId(Long shopId, Long moveCollectTaskDetailId);
}

@ -21,6 +21,7 @@ public interface MoveProductPublishToPicQueueMapper {
int updateByPrimaryKey(MoveProductPublishToPicQueue record);
int deleteByShopId(Long moveCollectTaskDetailId, Long shopId);
int deleteByShopId(Long shopId, Long moveCollectTaskDetailId);
Long getLockedQueueId(Long shopId, Long moveCollectTaskDetailId);
}

@ -170,4 +170,11 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where move_product_publish_queue_id = #{moveProductPublishQueueId,jdbcType=INTEGER}
</update>
<select id="getLockedQueueId" parameterType="java.lang.Long" resultType="java.lang.Long">
select
move_product_publish_queue_id
from move_product_publish_queue
where move_collect_task_detail_id = #{moveCollectTaskDetailId,jdbcType=BIGINT} and shop_id = #{shopId,jdbcType=BIGINT} and locked &lt;&gt; 0
limit 1
</select>
</mapper>

@ -140,4 +140,11 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where move_product_publish_to_pic_queue_id = #{moveProductPublishToPicQueueId,jdbcType=INTEGER}
</update>
<select id="getLockedQueueId" parameterType="java.lang.Long" resultType="java.lang.Long">
select
move_product_publish_to_pic_queue_id
from move_product_publish_to_pic_queue
where move_collect_task_detail_id = #{moveCollectTaskDetailId,jdbcType=BIGINT} and shop_id = #{shopId,jdbcType=BIGINT} and locked &lt;&gt; 0
limit 1
</select>
</mapper>

Loading…
Cancel
Save