|
@@ -15,6 +15,7 @@ import com.ylx.massage.mapper.TConsumptionLogMapper;
|
|
|
import com.ylx.massage.service.*;
|
|
|
import com.ylx.massage.utils.DateTimeUtils;
|
|
|
import com.ylx.massage.utils.LocationUtil;
|
|
|
+import com.ylx.massage.utils.WeChatUtil;
|
|
|
import com.ylx.system.service.ISysDeptService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -62,6 +63,9 @@ public class massageTask {
|
|
|
@Resource
|
|
|
private TWxUserService userService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private WeChatUtil weChatUtil;
|
|
|
+
|
|
|
|
|
|
public void cancelOrder() {
|
|
|
|
|
@@ -372,4 +376,33 @@ public class massageTask {
|
|
|
log.info("结束执行同步技师位置时间,{}", DateUtils.getNowDate());
|
|
|
}
|
|
|
|
|
|
+ public void sysJsWeiTicke() {
|
|
|
+ log.info("开始执行同步技师二维码,{}", DateUtils.getNowDate());
|
|
|
+ long flag = 1L;
|
|
|
+ while (flag > 0L) {
|
|
|
+ LambdaQueryWrapper<TJs> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+
|
|
|
+ objectLambdaQueryWrapper.gt(TJs::getId, String.valueOf(flag)).orderByAsc(TJs::getId);
|
|
|
+
|
|
|
+ Page<TJs> page = new Page<>();
|
|
|
+ page.setSize(MassageConstants.TWO_HUNDRED);
|
|
|
+ Page<TJs> page1 = jsService.page(page, objectLambdaQueryWrapper);
|
|
|
+
|
|
|
+ if (CollectionUtil.isNotEmpty(page1.getRecords())) {
|
|
|
+ page1.getRecords().forEach(tjs -> {
|
|
|
+ String token = weChatUtil.getToken();
|
|
|
+ //获取的二维码ticket
|
|
|
+ Map<?, ?> jsTicket = weChatUtil.getJsTicket(token, tjs.getId());
|
|
|
+ tjs.setTicket(jsTicket.get("ticket").toString());
|
|
|
+ jsService.updateById(tjs);
|
|
|
+ });
|
|
|
+ Optional<String> maxId = page1.getRecords().stream().max(Comparator.comparing(TJs::getId)).map(TJs::getId);
|
|
|
+ flag = Long.parseLong(maxId.orElse("0"));
|
|
|
+ } else {
|
|
|
+ flag = 0L;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("结束执行同步技师二维码,{}", DateUtils.getNowDate());
|
|
|
+ }
|
|
|
+
|
|
|
}
|