| @@ -70,7 +70,6 @@ public class WxAppinfoController extends BaseController { | |||||
| Map<String,String> map = (Map)resultData.data; | Map<String,String> map = (Map)resultData.data; | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| merchant.setQrCode(url); | merchant.setQrCode(url); | ||||
| System.out.println("---"+merchant.getId()); | |||||
| wxMerchantMapper.updateByPrimaryKeySelective(merchant); | wxMerchantMapper.updateByPrimaryKeySelective(merchant); | ||||
| } | } | ||||
| } | } | ||||
| @@ -112,7 +111,7 @@ public class WxAppinfoController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| private ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | |||||
| public ResultData exportQrcode(HttpServletRequest request, HttpServletResponse response, | |||||
| String tenantId, int type, String pageUrl, String sceneParam, | String tenantId, int type, String pageUrl, String sceneParam, | ||||
| int withText, String text1, String text2, | int withText, String text1, String text2, | ||||
| String name,boolean upload) { | String name,boolean upload) { | ||||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.app.WxAppinfoController; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxProfitSharingReceiver; | 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.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| @@ -31,6 +33,8 @@ public class WxMerchantController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantService wxMerchantService; | private WxMerchantService wxMerchantService; | ||||
| @Autowired | |||||
| private WxAppinfoController wxAppinfoController; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -96,7 +100,21 @@ public class WxMerchantController extends BaseController { | |||||
| public ResultData addMerchant(@RequestBody WxMerchant wxMerchant) { | public ResultData addMerchant(@RequestBody WxMerchant wxMerchant) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::addMerchant"); | logger.debug("[" + getIpAddr() + "] WxMerchantController::addMerchant"); | ||||
| wxMerchant.setTenantId(getTenantId()); | 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("更新商户接口") | @ApiOperation("更新商户接口") | ||||
| @@ -167,7 +167,7 @@ public class HomeController extends BaseController { | |||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| map.put("username", info.getUsername()); | map.put("username", info.getUsername()); | ||||
| map.put("withWechat", info.getWithWechatFormat()); | |||||
| map.put("withWechat", info.getWithWechat()); | |||||
| data.data = map; | data.data = map; | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -260,7 +260,7 @@ public class HomeController extends BaseController { | |||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| map.put("username", info.getUsername()); | map.put("username", info.getUsername()); | ||||
| map.put("withWechat", info.getWithWechatFormat()); | |||||
| map.put("withWechat", info.getWithWechat()); | |||||
| data.data = map; | data.data = map; | ||||
| } catch(Exception e){ | } catch(Exception e){ | ||||
| @@ -360,7 +360,7 @@ public class HomeController extends BaseController { | |||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| map.put("username", info.getUsername()); | map.put("username", info.getUsername()); | ||||
| map.put("withWechat", info.getWithWechatFormat()); | |||||
| map.put("withWechat", info.getWithWechat()); | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| @@ -71,6 +71,11 @@ public class MallUserInfoController extends BaseController { | |||||
| @SystemControllerLog(description = "用户管理-列表") | @SystemControllerLog(description = "用户管理-列表") | ||||
| public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize) { | public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::listAsPage"); | logger.debug("[" + getIpAddr() + "] MallUserInfoController::listAsPage"); | ||||
| if(userInfo.getWithWechatNotFormat() != null){ | |||||
| userInfo.setWithWechatForQuery(userInfo.getWithWechatNotFormat()); | |||||
| } | |||||
| userInfo.setTenantId(getTenantId()); | userInfo.setTenantId(getTenantId()); | ||||
| userInfo.setSortColumns(MallUserInfo.Field.Id_DESC); | userInfo.setSortColumns(MallUserInfo.Field.Id_DESC); | ||||
| final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize); | final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize); | ||||
| @@ -75,6 +75,9 @@ public class MallUserInfo extends BaseEntity { | |||||
| @Transient | @Transient | ||||
| private Integer withWechat; | private Integer withWechat; | ||||
| @Transient | |||||
| private Integer withWechatForQuery; | |||||
| @Transient | @Transient | ||||
| private Long roleId; | private Long roleId; | ||||
| @@ -100,9 +103,19 @@ public class MallUserInfo extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "邮箱", name = "email") | @io.swagger.annotations.ApiModelProperty(value = "邮箱", name = "email") | ||||
| private String email; | private String email; | ||||
| public Integer getWithWechatForQuery() { | |||||
| return withWechatForQuery; | |||||
| } | |||||
| public void setWithWechatForQuery(Integer withWechatForQuery) { | |||||
| this.withWechatForQuery = withWechatForQuery; | |||||
| } | |||||
| public Integer getWithWechatNotFormat() { | |||||
| return this.withWechat; | |||||
| } | |||||
| public Integer getWithWechatFormat() { | |||||
| public Integer getWithWechat() { | |||||
| if(StringUtils.isNotBlank(this.webOpenId)) { | if(StringUtils.isNotBlank(this.webOpenId)) { | ||||
| this.withWechat = EnumUserWechat.HAD.getCode(); | this.withWechat = EnumUserWechat.HAD.getCode(); | ||||
| } else { | } else { | ||||
| @@ -84,11 +84,11 @@ | |||||
| <if test=" null != email "> | <if test=" null != email "> | ||||
| and `email` = #{email} | and `email` = #{email} | ||||
| </if> | </if> | ||||
| <if test="null != withWechat "> | |||||
| <if test="0 == withWechat "> | |||||
| <if test="null != withWechatForQuery "> | |||||
| <if test="0 == withWechatForQuery "> | |||||
| and `web_open_id` is not null | and `web_open_id` is not null | ||||
| </if> | </if> | ||||
| <if test="1 == withWechat "> | |||||
| <if test="1 == withWechatForQuery "> | |||||
| and `web_open_id` is null | and `web_open_id` is null | ||||
| </if> | </if> | ||||
| </if> | </if> | ||||
| @@ -166,7 +166,7 @@ public class HomeController extends BaseController { | |||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| map.put("username", info.getUsername()); | map.put("username", info.getUsername()); | ||||
| map.put("withWechat", info.getWithWechatFormat()); | |||||
| map.put("withWechat", info.getWithWechat()); | |||||
| data.data = map; | data.data = map; | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -259,7 +259,7 @@ public class HomeController extends BaseController { | |||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| map.put("username", info.getUsername()); | map.put("username", info.getUsername()); | ||||
| map.put("withWechat", info.getWithWechatFormat()); | |||||
| map.put("withWechat", info.getWithWechat()); | |||||
| data.data = map; | data.data = map; | ||||
| } catch(Exception e){ | } catch(Exception e){ | ||||
| @@ -359,7 +359,7 @@ public class HomeController extends BaseController { | |||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| map.put("username", info.getUsername()); | map.put("username", info.getUsername()); | ||||
| map.put("withWechat", info.getWithWechatFormat()); | |||||
| map.put("withWechat", info.getWithWechat()); | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||