|
@@ -12,6 +12,7 @@ import com.chelvc.cloud.vehicle.client.constant.MerchantStatus;
|
|
|
import com.chelvc.cloud.vehicle.client.dto.*;
|
|
|
import com.chelvc.cloud.vehicle.client.param.*;
|
|
|
import com.chelvc.cloud.vehicle.client.util.DateTimeUtils;
|
|
|
+import com.chelvc.cloud.vehicle.client.util.MyExecuter;
|
|
|
import com.chelvc.cloud.vehicle.server.copier.MerchantCopier;
|
|
|
import com.chelvc.cloud.vehicle.server.dao.MerchantMapper;
|
|
|
import com.chelvc.cloud.vehicle.server.dao.RegionMapper;
|
|
@@ -31,6 +32,8 @@ import com.chelvc.framework.location.Address;
|
|
|
import com.chelvc.framework.location.LocationHandler;
|
|
|
import lombok.NonNull;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -56,6 +59,8 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|
|
|
|
|
private final LocationHandler locationHandler;
|
|
|
|
|
|
+ static final Logger LOGGER = LoggerFactory.getLogger(MyExecuter.class);
|
|
|
+
|
|
|
private final RegionMapper regionMapper;
|
|
|
|
|
|
private final OmsCartItemService omsCartItemService;
|
|
@@ -455,12 +460,13 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|
|
/**
|
|
|
* 每天定时更新商家得营业状态
|
|
|
*/
|
|
|
- @Scheduled(cron = "1 * * * * ?")
|
|
|
+ @Scheduled(cron = "0 0/10 * * * ?")
|
|
|
public void batchMerchantBusinessStatus() {
|
|
|
List<Merchant> merchantList = this.lambdaQuery().list();
|
|
|
+ LOGGER.info("Convert to Basic Latin:{}", merchantList.size());
|
|
|
//星期一至星期六: 09:00~18:00
|
|
|
merchantList.forEach(item -> {
|
|
|
- if (!DateUtil.timeQuantum(item.getOpening())) {
|
|
|
+ if (DateUtil.timeQuantum(item.getOpening())) {
|
|
|
this.baseMapper.updateMerchantBusinessStatus(item.getId(), "0", "0");
|
|
|
} else {
|
|
|
this.baseMapper.updateMerchantBusinessStatus(item.getId(), "1", "0");
|