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