|
|
|
@@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.core.task.AsyncTaskExecutor; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
@@ -36,6 +37,8 @@ import java.io.*; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.UUID; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
import java.util.concurrent.Executors; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("wxAppinfo") |
|
|
|
@@ -57,6 +60,9 @@ public class WxAppinfoController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private UploadController uploadController; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AsyncTaskExecutor asyncTaskExecutor; |
|
|
|
|
|
|
|
@ApiOperation("加载二维码") |
|
|
|
@GetMapping("/updateQrCode") |
|
|
|
public void updateQrCode(String p)throws ServletException, IOException { |
|
|
|
@@ -65,12 +71,20 @@ public class WxAppinfoController extends BaseController { |
|
|
|
|
|
|
|
List<WxMerchant> list = wxMerchantMapper.findQrcodeEmptyList(); |
|
|
|
for (WxMerchant merchant:list) { |
|
|
|
String param = "t:md:"+merchant.getId(); |
|
|
|
ResultData resultData = this.exportQrcode(null,null,merchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); |
|
|
|
Map<String,String> map = (Map)resultData.data; |
|
|
|
String url = map.get("url"); |
|
|
|
merchant.setQrCode(url); |
|
|
|
wxMerchantMapper.updateByPrimaryKeySelective(merchant); |
|
|
|
asyncTaskExecutor.execute(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
// String param = "t:md:"+merchant.getId(); |
|
|
|
// ResultData resultData = this.exportQrcode(null,null,merchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); |
|
|
|
// Map<String,String> map = (Map)resultData.data; |
|
|
|
// String url = map.get("url"); |
|
|
|
// merchant.setQrCode(url); |
|
|
|
// wxMerchantMapper.updateByPrimaryKeySelective(merchant); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|