| | |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.MD5Util; |
| | | import com.matrix.core.tools.PropertiesUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.constance.Dictionary; |
| | |
| | | import com.matrix.system.hive.service.SysShopInfoService; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | @Controller |
| | | @RequestMapping("hiveErp/shopInfo") |
| | | public class ErpShopInfoController extends BaseController { |
| | | |
| | | |
| | | @Autowired |
| | | WxacodeUtil wxacodeUtil; |
| | | |
| | | @Resource |
| | | private SysShopInfoService shopInfoService; // 店铺Service |
| | | @Value("${file_storage_path}") |
| | | private String fileStoragePath; |
| | | |
| | | @Value("${static_resource_url}") |
| | | private String staticResourceUrl; |
| | | |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | |
| | | return "admin/hive-erp/shop/shopInfo-form"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成门店二维码 |
| | | */ |
| | |
| | | AjaxResult creteSohopQrcode(@PathVariable("shopId") Long shopId) { |
| | | SysShopInfo shopInfo = shopInfoService.findById(shopId); |
| | | try { |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(shopId + "", "pages/index/index", MD5Util.strToMD5(shopId + "") |
| | | String qrcodeSavePath = wxacodeUtil.getWxacode(shopId + "", "pages/index/index", MD5Util.strToMD5(shopId + "") |
| | | ,weChatApiTools.getAppid(shopInfo.getCompanyId()),weChatApiTools.getSecret(shopInfo.getCompanyId())); |
| | | LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); |
| | | // 图片保存目录路径 |
| | | String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); |
| | | String baseSavePath = fileStoragePath; |
| | | // 图片访问URL |
| | | String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL); |
| | | String baseSaveUrl = staticResourceUrl; |
| | | String qrcodeImgUrl = qrcodeSavePath.replace(baseSavePath, baseSaveUrl); |
| | | shopInfo.setQrcode(qrcodeImgUrl); |
| | | shopInfoService.modify(shopInfo); |