|
|
|
@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.annotation.SystemControllerLog; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.controller.app.WxAppinfoController; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.WxMerchant; |
|
|
|
import com.iformall.domain.po.WxProfitSharingReceiver; |
|
|
|
@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author gongbiao |
|
|
|
@@ -31,6 +33,8 @@ public class WxMerchantController extends BaseController { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxMerchantService wxMerchantService; |
|
|
|
@Autowired |
|
|
|
private WxAppinfoController wxAppinfoController; |
|
|
|
|
|
|
|
@ApiOperation("分页列表接口") |
|
|
|
@GetMapping("list") |
|
|
|
@@ -96,7 +100,21 @@ public class WxMerchantController extends BaseController { |
|
|
|
public ResultData addMerchant(@RequestBody WxMerchant wxMerchant) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxMerchantController::addMerchant"); |
|
|
|
wxMerchant.setTenantId(getTenantId()); |
|
|
|
return wxMerchantService.addMerchant(wxMerchant, getUserId()); |
|
|
|
|
|
|
|
ResultData resultData = wxMerchantService.addMerchant(wxMerchant, getUserId()); |
|
|
|
|
|
|
|
if(resultData.code == 200){ |
|
|
|
//加载二维码图片 |
|
|
|
String pageUrl = "pages/index/index"; |
|
|
|
String param = "t:md:"+resultData.data; |
|
|
|
ResultData resultQrCode = wxAppinfoController.exportQrcode(null,null,wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); |
|
|
|
Map<String,String> map = (Map)resultQrCode.data; |
|
|
|
String url = map.get("url"); |
|
|
|
wxMerchant.setQrCode(url); |
|
|
|
wxMerchantService.updateMerchant(wxMerchant); |
|
|
|
} |
|
|
|
|
|
|
|
return resultData; |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("更新商户接口") |
|
|
|
|