| @@ -7,6 +7,7 @@ import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl; | |||
| import cn.afterturn.easypoi.handler.inter.IExcelDataHandler; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxTags; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.CUserBaseInfoT; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxTagsService; | |||
| @@ -58,7 +59,7 @@ public class AsyncTask { | |||
| } | |||
| @Async | |||
| public void importExcelData(File file, MallUserInfo user, String importKey, String tenantId) { | |||
| public void importExcelData(File file, MallUserInfo user, String importKey) { | |||
| ImportParams params = new ImportParams(); | |||
| // 需要验证 | |||
| params.setImportFields(new String[]{"姓名", "性别", "手机号*", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签", "成长值", "积分"}); | |||
| @@ -441,7 +441,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| } | |||
| } | |||
| asyncTask.importExcelData(lFile, user, importKey, tenantId); | |||
| asyncTask.importExcelData(lFile, user, importKey); | |||
| return new ResultData(Result.SUCCESS, "模板正在导入"); | |||
| } | |||
| @@ -201,15 +201,18 @@ public class HomeController extends BaseController { | |||
| logger.error("appid未找到"); | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| } | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(appinfo.getTenantId()); | |||
| }}; | |||
| if (StringUtils.isNotBlank(user.getPhone())) { | |||
| // 领导登录 | |||
| user = mallUserInfoService.getByPhone(user.getPhone(), appinfo.getTenantId()); | |||
| user = mallUserInfoService.getByPhone(user.getPhone(), tenantEntity); | |||
| if (user == null || !isInMobileAdmin(user)) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION); | |||
| } | |||
| } else if (StringUtils.isNotBlank(user.getBopenId())) { | |||
| // 领导登录 | |||
| user = mallUserInfoService.getByBOpenId(user.getBopenId(), appinfo.getTenantId()); | |||
| user = mallUserInfoService.getByBOpenId(user.getBopenId(), tenantEntity); | |||
| if (user == null || !isInMobileAdmin(user)) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION); | |||
| } | |||
| @@ -11,6 +11,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumMallUserStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.*; | |||
| @@ -218,10 +219,13 @@ public class WxInfoController extends BaseController { | |||
| } | |||
| WxAppinfo wxAppinfo = getAppInfo(appId); | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(wxAppinfo.getTenantId()); | |||
| }}; | |||
| try { | |||
| Map<String, String> retMap = getOpenIdInfo(appId, code); | |||
| String openId = retMap.get("openId"); | |||
| MallUserInfo user = mallUserInfoService.getByBOpenId(openId, wxAppinfo.getTenantId()); | |||
| MallUserInfo user = mallUserInfoService.getByBOpenId(openId, tenantEntity); | |||
| if(user == null) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION, retMap); | |||
| } | |||
| @@ -325,6 +329,9 @@ public class WxInfoController extends BaseController { | |||
| WxMaService wxMaService = getWeappService(appId); | |||
| WxAppinfo wxAppinfo = getAppInfo(appId); | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(wxAppinfo.getTenantId()); | |||
| }}; | |||
| try { | |||
| // 解密 | |||
| WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(session_key, encryptedData, iv); | |||
| @@ -333,7 +340,7 @@ public class WxInfoController extends BaseController { | |||
| String phone = phoneNoInfo.getPhoneNumber(); | |||
| resultMap.put("phone", phone); | |||
| MallUserInfo user = mallUserInfoService.getByPhone(phone, wxAppinfo.getTenantId()); | |||
| MallUserInfo user = mallUserInfoService.getByPhone(phone, tenantEntity); | |||
| if(user == null) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION, resultMap); | |||
| } | |||
| @@ -2,8 +2,7 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.base.BaseTenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -12,7 +11,7 @@ import java.util.Date; | |||
| @TableName(value = "wx_business") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxBusiness extends BaseEntity { | |||
| public class WxBusiness extends BaseTenantEntity { | |||
| protected Integer id; | |||
| @@ -32,17 +31,10 @@ public class WxBusiness extends BaseEntity { | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="enddate") | |||
| private Date enddate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| @TableField(exist = false) | |||
| private Integer limitStart; | |||
| @TableField(exist = false) | |||
| private Integer limitEnd; | |||
| public void updateTenantInfo(TenantEntity tenantEntity) { | |||
| setTenantId(tenantEntity.getTenantId()); | |||
| } | |||
| } | |||
| @@ -79,10 +79,6 @@ public class WxFlowRecord extends TenantEntity { | |||
| this.businessId = businessId; | |||
| setTenantId(tenantId); | |||
| } | |||
| public WxFlowRecord(TenantEntity tenantEntity, Long businessId){ | |||
| updateTenantInfo(tenantEntity); | |||
| this.businessId = businessId; | |||
| } | |||
| @Deprecated | |||
| public WxFlowRecord(Long businessId,String tenantId,Integer approvalType){ | |||
| this.businessId = businessId; | |||
| @@ -90,6 +86,11 @@ public class WxFlowRecord extends TenantEntity { | |||
| this.approvalType = approvalType; | |||
| } | |||
| public WxFlowRecord(TenantEntity tenantEntity, Long businessId){ | |||
| updateTenantInfo(tenantEntity); | |||
| this.businessId = businessId; | |||
| } | |||
| public WxFlowRecord(TenantEntity tenantEntity, Long businessId,Integer approvalType){ | |||
| updateTenantInfo(tenantEntity); | |||
| this.businessId = businessId; | |||
| @@ -14,8 +14,6 @@ public class WxProfitSharingOrder extends TenantEntity { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="接收方(商场租户id)",name="tenantId") | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") | |||
| @@ -17,7 +17,7 @@ import java.util.List; | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| public class WxCouponOrderBVo extends WxCouponOrder { | |||
| private static final long serialVersionUID = 6687954932922444531L; | |||
| @@ -25,9 +25,6 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| protected Long id; | |||
| /** 基础购买到的券信息 */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId") | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId") | |||
| private Long orderId; | |||
| @@ -1,17 +1,13 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import java.io.Serializable; | |||
| @Data | |||
| public class WxMerchantMicroPayVo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| public class WxMerchantMicroPayVo extends TenantEntity { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "交易额", name = "tradeAmt") | |||
| private Integer tradeAmt; | |||
| @io.swagger.annotations.ApiModelProperty(value = "解单日期", name = "reportDate") | |||
| @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.MallUserInfoVo; | |||
| import java.io.Serializable; | |||
| @@ -29,7 +30,7 @@ public interface MallUserInfoService { | |||
| * @param phone | |||
| * @return | |||
| */ | |||
| MallUserInfo getByPhone(String phone, String tenantId); | |||
| MallUserInfo getByPhone(String phone, TenantEntity tenantEntity); | |||
| /** | |||
| * 根据web_open_id获得展示列表 | |||
| @@ -45,7 +46,7 @@ public interface MallUserInfoService { | |||
| * @param openId | |||
| * @return | |||
| */ | |||
| MallUserInfo getByBOpenId(String openId, String tenantId); | |||
| MallUserInfo getByBOpenId(String openId, TenantEntity tenantEntity); | |||
| //// -------------------- Login end ----------------------- //// | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -47,7 +48,7 @@ public interface WxAppinfoService { | |||
| * 获取c端小程序信息 | |||
| * @return | |||
| */ | |||
| WxAppinfo getCAppInfo(String tenantId); | |||
| WxAppinfo getCAppInfo(TenantEntity tenantEntity); | |||
| /** | |||
| * 保存或更新实体 | |||
| @@ -12,6 +12,7 @@ import com.iformall.domain.po.MallPermission; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.MallUserRole; | |||
| import com.iformall.domain.po.WxMsgValidationcode; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.MallUserInfoVo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.MallPermissionMapper; | |||
| @@ -81,8 +82,8 @@ public class MallUserInfoServiceImpl implements MallUserInfoService { | |||
| } | |||
| @Override | |||
| public MallUserInfo getByBOpenId(String openId, String tenantId) { | |||
| return mallUserInfoMapper.selectByBOpenId(openId, tenantId); | |||
| public MallUserInfo getByBOpenId(String openId, TenantEntity tenantEntity) { | |||
| return mallUserInfoMapper.selectByBOpenId(openId, tenantEntity.getTenantId()); | |||
| } | |||
| @Override | |||
| @@ -94,8 +95,8 @@ public class MallUserInfoServiceImpl implements MallUserInfoService { | |||
| } | |||
| @Override | |||
| public MallUserInfo getByPhone(String phone, String tenantId) { | |||
| return mallUserInfoMapper.selectByPhone(phone, tenantId); | |||
| public MallUserInfo getByPhone(String phone, TenantEntity tenantEntity) { | |||
| return mallUserInfoMapper.selectByPhone(phone, tenantEntity.getTenantId()); | |||
| } | |||
| @Override | |||
| @@ -166,7 +166,7 @@ public class QrCodeServiceImpl implements QrCodeService { | |||
| String name) { | |||
| // type 0 有限二维码, 1 无限制二维码 | |||
| // withText 0 不带字 1. 带下面的字,2 带下面的两行字 | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantEntity.getTenantId()); | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantEntity); | |||
| boolean autoColor = false; | |||
| boolean isHyaline = true; | |||
| WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | |||
| @@ -228,7 +228,7 @@ public class QrCodeServiceImpl implements QrCodeService { | |||
| String name) { | |||
| // type 0 有限二维码, 1 无限制二维码 | |||
| // withText 0 不带字 1. 带下面的字,2 带下面的两行字 | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantEntity.getTenantId()); | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantEntity); | |||
| boolean autoColor = false; | |||
| boolean isHyaline = true; | |||
| WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | |||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumAppType; | |||
| import com.iformall.mapper.WxAppinfoMapper; | |||
| import com.iformall.service.WxAppinfoService; | |||
| @@ -23,10 +24,10 @@ public class WxAppinfoServiceImpl implements WxAppinfoService { | |||
| WxAppinfoMapper wxAppinfoMapper; | |||
| @Override | |||
| public WxAppinfo getCAppInfo(String tenantId) { | |||
| public WxAppinfo getCAppInfo(TenantEntity tenantEntity) { | |||
| WxAppinfo appInfo = null; | |||
| WxAppinfo appinfoQ = new WxAppinfo(); | |||
| appinfoQ.setTenantId(tenantId); | |||
| appinfoQ.updateTenantInfo(tenantEntity); | |||
| appinfoQ.setType(EnumAppType.C.getCode()); | |||
| List<WxAppinfo> appList = wxAppinfoMapper.selectList(new QueryWrapper(appinfoQ)); | |||
| if (appList.size() > 0) { | |||
| @@ -590,7 +590,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getCAppInfo(couponOrder.getTenantId()); | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getCAppInfo(couponOrder); | |||
| WxPayAccount payAccount = wxPayAccountMapper.selectById(wxAppinfo.getPayId()); | |||
| Integer subsidyNum = coupon.getSubsidyNum(); | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxCouponPassword; | |||
| import com.iformall.domain.po.WxCouponPresent; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.msg.WxMsgRecord; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.WxCouponPasswordMapper; | |||
| @@ -54,8 +55,6 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService { | |||
| @Async | |||
| @Override | |||
| public ResultData add(WxCouponPresent record, List<WxCouponPassword> list, Set<String> phoneSet) { | |||
| String tenantId = record.getTenantId(); | |||
| //添加记录 | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| long id = idWorker.nextId(); | |||
| @@ -63,7 +62,7 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService { | |||
| record.setSendAmount(phoneSet.size()); | |||
| wxCouponPresentMapper.insert(record); | |||
| //小程序 | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(tenantId); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(record); | |||
| String title = record.getCouponName(); | |||
| String name = appInfo.getName(); | |||
| List<WxCouponPassword> tempList = new ArrayList<>(); | |||
| @@ -72,7 +71,7 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService { | |||
| for (String phone : phoneSet) { | |||
| WxCouponPassword couponPassword = list.get(i); | |||
| //发送 | |||
| sendMsg(tenantId, phone, title, name, couponPassword.getPassword(), couponPassword.getId().toString()); | |||
| sendMsg(record, phone, title, name, couponPassword.getPassword(), couponPassword.getId().toString()); | |||
| //记录发送数据便于更新状态 | |||
| couponPassword.setPresentId(id); | |||
| couponPassword.setSendedPhone(phone); | |||
| @@ -84,7 +83,7 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService { | |||
| return new ResultData(); | |||
| } | |||
| private void sendMsg(String tenantId, String phone, String title, String appName, String password, String id) { | |||
| private void sendMsg(TenantEntity tenantEntity, String phone, String title, String appName, String password, String id) { | |||
| logger.info("》》》》》》》》》》》"); | |||
| logger.info("系统发卡发送短信开始"); | |||
| logger.info("》》》》》》》》》》》"); | |||
| @@ -97,7 +96,7 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService { | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.COUPON_CARD_SEND.getCode()); | |||
| wxMsgRecord.setReceiver(phone); | |||
| wxMsgRecord.setTenantId(tenantId); | |||
| wxMsgRecord.updateTenantInfo(tenantEntity); | |||
| wxMsgRecord.setDynamicContentMap(msgReplaceMap); | |||
| mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| logger.info("》》》》》》》》》》》"); | |||
| @@ -414,7 +414,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||
| String phone = user.getPhone(); | |||
| //小程序名称 | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(tenantEntity.getTenantId()); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(tenantEntity); | |||
| String appName = appInfo.getName(); | |||
| Map<String, String> msgReplaceMap = new HashMap(); | |||
| msgReplaceMap.put("title", title); | |||
| @@ -1254,7 +1254,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| @Override | |||
| public ResultData orderClose(WxOrder order) { | |||
| // 1. get c appid | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order.getTenantId()); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order); | |||
| // 2. get pay order | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.updateTenantInfo(order); | |||
| @@ -420,7 +420,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| public ResultData createMicroPayOrder(WxMerchantBUser user, WxPayOrder record, EnumPayWay payWay) { | |||
| final IdWorker idworker = IdWorker.get(); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(user.getTenantId()); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(user); | |||
| EnumPayShare isShare = EnumPayShare.NO; | |||
| @@ -707,7 +707,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR.getCode(), "Order not found"); | |||
| } | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(record.getTenantId()); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(record); | |||
| String response = wechatPayOrderQuery(appInfo, record); | |||
| @@ -969,7 +969,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| @Override | |||
| public ResultData payOrderReverse(WxPayOrder record) { | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(record.getTenantId()); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(record); | |||
| try { | |||
| String response = wechatPayOrderReverse(appInfo, record); | |||
| @@ -1314,7 +1314,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||
| } | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(order.getTenantId()); | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(order); | |||
| // add c_user, 收银台支付和券支付可能不是同一个人 | |||
| Date curDate = new Date(); | |||
| @@ -1459,7 +1459,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||
| } | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(order.getTenantId()); | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(order); | |||
| if (record.getPayAmount().equals(0)) { | |||
| doCouponPayOrder(user, record, order); | |||
| @@ -1574,7 +1574,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| // 有价券 | |||
| if (EnumPayStatus.PAY_STATUS_FAIL.getCode() == status) { | |||
| // 1. get appinfo | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order.getTenantId()); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order); | |||
| // 前端支付取消, | |||
| // 回调未返回,主动检查支付订单状态 | |||
| try { | |||
| @@ -88,7 +88,7 @@ public class WxSubsidyServiceImpl implements WxSubsidyService { | |||
| EnumPayShare isShare = EnumPayShare.NO; | |||
| Date curDate = new Date(); | |||
| // 1. 获取c端小程序 | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(user.getTenantId()); | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(user); | |||
| // 2. 获取payAccount | |||
| WxPayAccount payAccount = wxPayAccountMapper.selectById(appInfo.getPayId()); | |||
| if (payAccount.checkShare()) { | |||
| @@ -8,6 +8,7 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxAppinfoService; | |||
| import com.iformall.service.wechat.FmOpenService; | |||
| @@ -123,7 +124,7 @@ public class WxAppinfoController extends BaseController { | |||
| } | |||
| try { | |||
| exportQrcode(request, response, | |||
| getTenantId(), type, pageUrl, sceneParam, | |||
| getTenantInfo(), type, pageUrl, sceneParam, | |||
| withText, text1, text2, | |||
| name); | |||
| } catch (Exception e) { | |||
| @@ -133,12 +134,12 @@ public class WxAppinfoController extends BaseController { | |||
| } | |||
| private void exportQrcode(HttpServletRequest request, HttpServletResponse response, | |||
| String tenantId, int type, String pageUrl, String sceneParam, | |||
| int withText, String text1, String text2, | |||
| TenantEntity tenantEntity, int type, String pageUrl, String sceneParam, | |||
| int withText, String text1, String text2, | |||
| String name) { | |||
| // type 0 有限二维码, 1 无限制二维码 | |||
| // withText 0 不带字 1. 带下面的字,2 带下面的两行字 | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantId); | |||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(tenantEntity); | |||
| boolean autoColor = false; | |||
| boolean isHyaline = true; | |||
| WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.MallUserInfoVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -199,15 +200,18 @@ public class HomeController extends BaseController { | |||
| logger.error("appid未找到"); | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| } | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(appinfo.getTenantId()); | |||
| }}; | |||
| if (StringUtils.isNotBlank(user.getPhone())) { | |||
| // 领导登录 | |||
| user = mallUserInfoService.getByPhone(user.getPhone(), appinfo.getTenantId()); | |||
| user = mallUserInfoService.getByPhone(user.getPhone(), tenantEntity); | |||
| if (user == null || !isInMobileAdmin(user)) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION); | |||
| } | |||
| } else if (StringUtils.isNotBlank(user.getBopenId())) { | |||
| // 领导登录 | |||
| user = mallUserInfoService.getByBOpenId(user.getBopenId(), appinfo.getTenantId()); | |||
| user = mallUserInfoService.getByBOpenId(user.getBopenId(), tenantEntity); | |||
| if (user == null || !isInMobileAdmin(user)) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION); | |||
| } | |||