| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.config.properties.GunsProperties; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.WeChatUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.QianYunTongConfig; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.CallbackUtil; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.TokenUtil; |
| | | import com.stylefeng.guns.modular.system.util.zhenglian.model.MessageBody; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.MessageFormat; |
| | |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private GunsProperties gunsProperties; |
| | | |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | |
| | | @Autowired |
| | | private QianYunTongConfig qianYunTongConfig; |
| | | |
| | | @Value("${wx.url}") |
| | | private String ACCESS_TOKEN_URL; |
| | |
| | | |
| | | @Autowired |
| | | private WeChatUtil weChatUtil; |
| | | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | | |
| | | @Value("${qyt.admin_url}") |
| | | private String adminUrl; |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("page", "pages/home/home"); |
| | | param.put("width", 430); //二维码尺寸 |
| | | param.put("scene", "driverId=" + uid); //二维码尺寸 |
| | | param.put("env_version", "release"); //二维码尺寸 |
| | | param.put("scene", "driverId=" + uid); |
| | | param.put("env_version", "trial"); //正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。 |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.body(JSON.toJSONString(param)); |
| | | |
| | |
| | | if (fileName == null || "".equals(fileName)) { |
| | | String appletPath = "pages/home/scanPage/scanPage"; |
| | | //HttpURLConnection httpURLConnection = weChatUtil.getwxacodeunlimit(appletPath, "d=" + driverId + "&k=" + 0, "release",driverId); |
| | | InputStream inputStream = weChatUtil.getwxacodeunlimit(appletPath, "driverId=" + driverId, "release"); |
| | | InputStream inputStream = weChatUtil.getwxacodeunlimit(appletPath, "driverId=" + driverId, "trial"); |
| | | if (inputStream != null) { |
| | | // 上传文件目录 |
| | | fileName = UUID.randomUUID().toString() + ".png"; |
| | | String fileSavePath = gunsProperties.getFileUploadPath() + "img\\"; |
| | | FileUtil.writeFromStream(inputStream, fileName); |
| | | String pictureName = gunsProperties.getPictureServerAddress() + "img/" + fileName; |
| | | // fileName = OssUploadUtil.ossUploadByStream(driverId, inputStream); |
| | | System.out.println(pictureName); |
| | | driver.setQrCode(pictureName); |
| | | File file = FileUtil.writeFromStream(inputStream, new File(filePath + "/" + UUID.randomUUID().toString() + ".png")); |
| | | HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | | post.form("file", file); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException("上传图片异常"); |
| | | } |
| | | driver.setQrCode(execute.body()); |
| | | driverService.updateById(driver); |
| | | fileName = driver.getQrCode(); |
| | | } |
| | | } |
| | | return ResultUtil.success(fileName); |