| @@ -77,7 +77,6 @@ | |||
| com.fasterxml.uuid, | |||
| com.fasterxml, | |||
| com.github.axet, | |||
| com.github.binarywang, | |||
| com.github.jsqlparser, | |||
| com.github.pagehelper, | |||
| com.github.ulisesbocchio, | |||
| @@ -1,23 +1,87 @@ | |||
| package com.iformall.controller.basic; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.service.WxProjectConfigService; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxWeappInfo; | |||
| import com.iformall.enums.EnumGroupSupport; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.service.*; | |||
| import com.iformall.shiro.PasswordHelper; | |||
| import com.iformall.sms.EnumSMSChannel; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.util.Assert; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.*; | |||
| @RestController | |||
| @RequestMapping("wxProjectConfig") | |||
| public class WxProjectConfigController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxProjectConfigService wxProjectConfigService; | |||
| WxProjectConfigService wxProjectConfigService; | |||
| @Autowired | |||
| WxCouponSendConfigService wxCouponSendConfigService; | |||
| @Autowired | |||
| WxMallService wxMallService; | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @Autowired | |||
| WxPayAccountBillService wxPayAccountBillService; | |||
| @Autowired | |||
| MallUserInfoService userInfoService; | |||
| @Autowired | |||
| WxAppinfoService wxAppinfoService; | |||
| @Autowired | |||
| WxMsgConfigService wxMsgConfigService; | |||
| @Autowired | |||
| WxParkService wxParkService; | |||
| @Autowired | |||
| WxWiWideInfoService wxWiWideInfoService; | |||
| @Autowired | |||
| WxAuthorizerInfoService wxAuthorizerInfoService; | |||
| @Autowired | |||
| WxScoreRulesService wxScoreRulesService; | |||
| @Autowired | |||
| WxTemplateMsgService wxTemplateMsgService; | |||
| @Autowired | |||
| WxQuestionService wxQuestionService; | |||
| @Autowired | |||
| WxMsgValidationcodeModelService wxMsgValidationcodeModelService; | |||
| @Autowired | |||
| WxFlowConfigService wxFlowConfigService; | |||
| @Autowired | |||
| WxMallBuildingService wxMallBuildingService; | |||
| @Autowired | |||
| MallUserInfoService mallUserInfoService; | |||
| @ApiOperation("添加商场基础数据") | |||
| @GetMapping(value = "/init/{id}") | |||
| @@ -35,4 +99,475 @@ public class WxProjectConfigController extends BaseController { | |||
| } | |||
| @ApiOperation("查询商场集团列表") | |||
| @GetMapping(value = "/mallList") | |||
| @SystemControllerLog(description = "商场基础数据") | |||
| public ResultData getMallList(@ModelAttribute WxMall wxMall, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getMallList"); | |||
| try { | |||
| if(wxMall == null){ | |||
| wxMall = new WxMall(); | |||
| } | |||
| PageInfo<WxMall> page = wxMallService.listAsPage(wxMall, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改商场集团") | |||
| @PostMapping("/init/mall") | |||
| @SystemControllerLog(description = "商场集团-更新") | |||
| public ResultData initMall(@RequestBody WxMall wxMall) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall"); | |||
| try { | |||
| //集团版 | |||
| if(wxMall.getSaleType().equals(100)){ | |||
| wxMall.setGroupSupport(EnumGroupSupport.SUPPORT.getCode()); | |||
| }else{ | |||
| wxMall.setGroupSupport(EnumGroupSupport.SUPPORT.getCode()); | |||
| } | |||
| if(StringUtils.isBlank(wxMall.getBusinessHours())){ | |||
| wxMall.setBusinessHours("[]"); | |||
| } | |||
| if(StringUtils.isBlank(wxMall.getIntroduction())){ | |||
| wxMall.setIntroduction(""); | |||
| } | |||
| if(StringUtils.isBlank(wxMall.getImg())){ | |||
| wxMall.setImg(""); | |||
| } | |||
| wxProjectConfigService.initMall(wxMall); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改商场楼座信息") | |||
| @PostMapping("/init/building") | |||
| @SystemControllerLog(description = "商场楼座-更新") | |||
| public ResultData initBuilding(@RequestBody List<WxMallBuilding> wxMallBuildings) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initBuilding"); | |||
| try { | |||
| if(wxMallBuildings == null || wxMallBuildings.size() == 0){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| for (WxMallBuilding wxMallBuilding:wxMallBuildings) { | |||
| if(StringUtils.isBlank(wxMallBuilding.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| } | |||
| wxProjectConfigService.initBuilding(wxMallBuildings); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改特殊商户号信息") | |||
| @PostMapping("/init/payAccount") | |||
| @SystemControllerLog(description = "特殊商户号-更新") | |||
| public ResultData initPayAccount(@RequestBody WxPayAccount wxPayAccount) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPayAccount"); | |||
| try { | |||
| if(StringUtils.isBlank(wxPayAccount.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxPayAccount getByTenantId = wxPayAccountService.getByTenantId(wxPayAccount.getTenantId()); | |||
| if(wxPayAccount.getId() != null && (getByTenantId == null || !getByTenantId.getId().equals(wxPayAccount.getId()))){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| if(wxPayAccount.getId() == null && getByTenantId != null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| if(StringUtils.isBlank(wxPayAccount.getNotifyUrl())){ | |||
| wxPayAccount.setNotifyUrl("https://admin.malls.iformall.com/wxPay/notify"); | |||
| } | |||
| if(StringUtils.isBlank(wxPayAccount.getCertPath())){ | |||
| wxPayAccount.setCertPath("/opt/iformall/service/apiclient_cert.p12"); | |||
| } | |||
| if(wxPayAccount.getType() == null){ | |||
| wxPayAccount.setType(1);//0:普通商户模式, 1:服务商模式(默认服务商模式) | |||
| } | |||
| if(wxPayAccount.getShare() == null){ | |||
| wxPayAccount.setShare(0);//0: 未分账,1:分账(默认不分账) | |||
| } | |||
| wxProjectConfigService.initPayAccount(wxPayAccount); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改小程序信息") | |||
| @PostMapping("/init/appinfo") | |||
| @SystemControllerLog(description = "小程序信息-更新") | |||
| public ResultData initAppinfo(@RequestBody WxAppinfo wxAppinfo) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAppinfo"); | |||
| try { | |||
| if(StringUtils.isBlank(wxAppinfo.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(wxAppinfo.getId() == null){ | |||
| WxPayAccount byTenantId = wxPayAccountService.getByTenantId(wxAppinfo.getTenantId()); | |||
| if(byTenantId != null){ | |||
| wxAppinfo.setPayId(byTenantId.getId()); | |||
| } | |||
| WxPayAccountBill billByTenantId = wxPayAccountBillService.getByTenantId(wxAppinfo.getTenantId()); | |||
| if(billByTenantId != null){ | |||
| wxAppinfo.setPayBillId(billByTenantId.getId()); | |||
| } | |||
| } | |||
| wxAppinfoService.saveOrUpdate(wxAppinfo); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| /** | |||
| * 这里添加多个用户会生成多套角色 | |||
| */ | |||
| @ApiOperation("添加修改商场后台管理帐号") | |||
| @PostMapping("/init/userInfo") | |||
| @SystemControllerLog(description = "商场后台管理帐号-更新") | |||
| public ResultData initUserInfo(@RequestBody MallUserInfo userInfo) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initUserInfo"); | |||
| try { | |||
| if(StringUtils.isBlank(userInfo.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(StringUtils.isBlank(userInfo.getUsername())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(StringUtils.isBlank(userInfo.getPhone())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| boolean bChangedPhone = false; | |||
| if(userInfo.getId() == null){ | |||
| if(userInfoService.cntByUserName(userInfo.getUsername()) > 0){ | |||
| return new ResultData(ErrorCode.USER_NAME_IS_FOUND.getCode(),"用户名已存在"); | |||
| } | |||
| if(userInfoService.cntByUserPhone(userInfo.getPhone()) > 0){ | |||
| return new ResultData(ErrorCode.USER_PHONE_IS_FOUND.getCode(),"手机号已存在"); | |||
| } | |||
| Assert.notNull(userInfo.getPassword(), "密码不能为空"); | |||
| PasswordHelper passwordHelper = new PasswordHelper(); | |||
| passwordHelper.encryptPassword(userInfo); | |||
| userInfo.setIsAdmin(EnumUserAdmin.ADMIN.getCode()); | |||
| wxProjectConfigService.initUserInfo(userInfo); | |||
| }else{ | |||
| MallUserInfo oldUser = userInfoService.getById(userInfo.getId()); | |||
| if (!oldUser.getUsername().equals(userInfo.getUsername())) { | |||
| if(userInfoService.cntByUserName(userInfo.getUsername()) > 0){ | |||
| return new ResultData(ErrorCode.USER_NAME_IS_FOUND.getCode(),"用户名已存在"); | |||
| } | |||
| } | |||
| if (!oldUser.getPhone().equals(userInfo.getPhone())) { | |||
| if(userInfoService.cntByUserPhone(userInfo.getPhone()) > 0){ | |||
| return new ResultData(ErrorCode.USER_PHONE_IS_FOUND.getCode(),"手机号已存在"); | |||
| } | |||
| bChangedPhone = true; | |||
| } | |||
| if (StringUtils.isNotBlank(userInfo.getPassword()) && userInfo.getPassword().length() > 0) { | |||
| PasswordHelper passwordHelper = new PasswordHelper(); | |||
| passwordHelper.encryptPassword(userInfo); | |||
| } | |||
| userInfo.setIsAdmin(EnumUserAdmin.ADMIN.getCode()); | |||
| userInfoService.saveOrUpdate(userInfo); | |||
| if(bChangedPhone) { | |||
| // 手机号修改,清除bopen_id, 清除web_open_id | |||
| userInfoService.cleanAllOpenId(userInfo); | |||
| } | |||
| } | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改商场短信配置") | |||
| @PostMapping("/init/msgConfig") | |||
| @SystemControllerLog(description = "商场后短信配置-更新") | |||
| public ResultData initMsgConfig(@RequestBody WxMsgConfig wxMsgConfig) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMsgConfig"); | |||
| try { | |||
| if(StringUtils.isBlank(wxMsgConfig.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(StringUtils.isBlank(wxMsgConfig.getAppid())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(wxMsgConfig.getSmsChannel() == null){ | |||
| wxMsgConfig.setSmsChannel(EnumSMSChannel.WIWIDE.getCode()); | |||
| } | |||
| if(wxMsgConfig.getSmsChannel() == EnumSMSChannel.WIWIDE.getCode()){ | |||
| wxMsgConfig.setSecret("7305150347587283553aa8898e7dbf20"); | |||
| wxMsgConfig.setPublickey("MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvh8j/zagfxQdnSh5OIic\\r" + | |||
| "\\nMzN+MuRuWQJPjgu4Gza4+gX3j5Ln2xNDBOTjpwyuLBjh/JcBd1cGO3lAaKCwcaix\\r" + | |||
| "\\nsmhTq56wVXXUMgDiAChu4ud8FSvRc8G8tdZAirKVAIi3NW+/pYgpWBs/0wnF8hz4\\r" + | |||
| "\\n8no4pyJHl9Jc1LH3VNIMz8vqzKUPc4ack4pFUXlcNj6C+sBlaurmI4/vwLqNxBGs\\r" + | |||
| "\\n7/zyM7dv6oy3DSU/Y1qBArM1YPjfL2dNun8rmtPgJvlPwXqA7uoHPwQ2Ym3aUn59\\r" + | |||
| "\\npkS7QI6IE8uuqNkfSte8BXLd2nIqPLFxLYLDmdll7eoyRblHcHqAYSj8stK6StC7\\r" + | |||
| "\\nDNryNKEjTEwbgf9trUI0uvF1pfgTy2gpclnY69FtD/m0+FvLyorMq+nmBqYMjka5\\r" + | |||
| "\\nK0txDQJPOa7gsi//uXd/cJW2SAXY9MSO1AfMi8Xq/YKRQzN9FW5iapskXFHca7uX\\r" + | |||
| "\\ng5NhH7flr6DW+QInFlpoN6WIEAuDF1aj4O49Ikm3WxwhTqnvEkdSCfivpYQkp9Sh\\r" + | |||
| "\\n4kQ/SQdxuT7VX+Nz6k+uMx2z4cySk33bHi0KoHbA9QFGg/54Qd0+eU4qZnd4mrgh\\r" + | |||
| "\\nhH7/QQhL7Z9eF1U5UPrsHq2Vq3rEnN+tYQ26AuKeU8vzTxBrC/SxC6C/SMFt3f/Y\\r" + | |||
| "\\nnuFh1UnNJZleZwyQt+ZdGO0CAwEAAQ=="); | |||
| wxMsgConfig.setBid("465565"); | |||
| wxMsgConfig.setAccount("15626593768"); | |||
| wxMsgConfig.setNotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receivemsg/" + wxMsgConfig.getTenantId()); | |||
| wxMsgConfig.setModelnotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receivemodel/" + wxMsgConfig.getTenantId()); | |||
| wxMsgConfig.setVerifynotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receiveverifymodel/" + wxMsgConfig.getTenantId()); | |||
| } | |||
| if(wxMsgConfig.getTotal() == null){ | |||
| wxMsgConfig.setTotal((long) 100000); | |||
| } | |||
| wxMsgConfig.setRecharge((long) 0); | |||
| wxMsgConfig.setRemains(wxMsgConfig.getTotal()); | |||
| wxMsgConfig.setReminderstatus(0); | |||
| wxMsgConfigService.saveOrUpdate(wxMsgConfig); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改停车场配置") | |||
| @PostMapping("/init/park") | |||
| @SystemControllerLog(description = "商场停车场配置-更新") | |||
| public ResultData initPark(@RequestBody WxPark wxPark) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPark"); | |||
| try { | |||
| if(StringUtils.isBlank(wxPark.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(StringUtils.isBlank(wxPark.getAddr())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(wxPark.getNumber() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(StringUtils.isBlank(wxPark.getVendorParams())){ | |||
| wxPark.setVendorParams("{}"); | |||
| } | |||
| if(wxPark.getVendorType() == null){ | |||
| wxPark.setVendorType(0); | |||
| } | |||
| if(StringUtils.isBlank(wxPark.getParkId())){ | |||
| wxPark.setParkId("0"); | |||
| } | |||
| if(StringUtils.isBlank(wxPark.getStopFee())){ | |||
| wxPark.setStopFee(""); | |||
| } | |||
| if(wxPark.getEntryExit() == null){ | |||
| wxPark.setEntryExit(1); | |||
| } | |||
| wxParkService.saveOrUpdate(wxPark); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改迈外迪信息") | |||
| @PostMapping("/init/wiwidi") | |||
| @SystemControllerLog(description = "迈外迪信息配置-更新") | |||
| public ResultData initWiwidi(@RequestBody WxWiWideInfo wxWiWideInfo) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPark"); | |||
| try { | |||
| if(StringUtils.isBlank(wxWiWideInfo.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| wxWiWideInfoService.saveOrUpdate(wxWiWideInfo); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改微信公众账号的基本信息") | |||
| @PostMapping("/init/authorizer") | |||
| @SystemControllerLog(description = "微信公众账号的基本信息-更新") | |||
| public ResultData initAuthorizer(@RequestBody WxAuthorizerInfo wxAuthorizerInfo) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAuthorizer"); | |||
| try { | |||
| if(StringUtils.isBlank(wxAuthorizerInfo.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(wxAuthorizerInfo.getAuthorizationStatus() == null){ | |||
| wxAuthorizerInfo.setAuthorizationStatus(0);//授权状态,0为已授权,1为已取消授权 | |||
| wxAuthorizerInfo.setAuthTime(new Date()); | |||
| } | |||
| if(wxAuthorizerInfo.getBaseStatus() == null){ | |||
| wxAuthorizerInfo.setBaseStatus(0);//微信基础版本设置状态,0为已设置,1为设置失败 | |||
| wxAuthorizerInfo.setBaseTime(new Date()); | |||
| } | |||
| if(wxAuthorizerInfo.getDomainStatus() == null){ | |||
| wxAuthorizerInfo.setDomainStatus(0);//服务器域名设置状态,0为已设置,1为设置失败 | |||
| wxAuthorizerInfo.setDomainTime(new Date()); | |||
| } | |||
| if(wxAuthorizerInfo.getWebdomainStatus() == null){ | |||
| wxAuthorizerInfo.setWebdomainStatus(0);//服务器业务域名设置状态,0为已设置,1为设置失败 | |||
| wxAuthorizerInfo.setWebdomainTime(new Date()); | |||
| } | |||
| if(StringUtils.isNotBlank(wxAuthorizerInfo.getCurrentVersion()) | |||
| && wxAuthorizerInfo.getReleaseTime() != null){ | |||
| wxAuthorizerInfo.setReleaseTime(new Date()); | |||
| } | |||
| if(StringUtils.isNotBlank(wxAuthorizerInfo.getOpenAppid()) | |||
| && wxAuthorizerInfo.getBindOpenTime() != null){ | |||
| wxAuthorizerInfo.setBindOpenTime(new Date()); | |||
| } | |||
| if(StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){ | |||
| wxAuthorizerInfo.setRefreshToken(""); | |||
| } | |||
| if(StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){ | |||
| wxAuthorizerInfo.setAccessToken(""); | |||
| } | |||
| wxAuthorizerInfoService.saveOrUpdate(wxAuthorizerInfo); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("查询商场基础数据") | |||
| @GetMapping(value = "/getinit/{id}") | |||
| @SystemControllerLog(description = "商场基础数据") | |||
| public ResultData getinit(@PathVariable Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getinit"); | |||
| try { | |||
| Map<String, Object> map = new HashMap<String, Object>(); | |||
| WxMall wxMall = wxMallService.getById(id); | |||
| map.put("wxMall",wxMall); | |||
| List<WxMall> subWxMall = wxMallService.getSubByParentTenantId(wxMall.getTenantId()); | |||
| map.put("subWxMall",subWxMall); | |||
| WxCouponSendConfig wxCouponSendConfig = new WxCouponSendConfig(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<WxCouponSendConfig> wxCouponSendConfigList = wxCouponSendConfigService.findList(wxCouponSendConfig); | |||
| map.put("wxCouponSendConfigList",wxCouponSendConfigList); | |||
| WxScoreRules wxScoreRules = new WxScoreRules(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<WxScoreRules> wxScoreRulesList = wxScoreRulesService.findList(wxScoreRules); | |||
| map.put("wxScoreRulesList",wxScoreRulesList); | |||
| WxTemplateMsg wxTemplateMsg = new WxTemplateMsg(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<WxTemplateMsg> wxTemplateMsgList = wxTemplateMsgService.findList(wxTemplateMsg); | |||
| map.put("wxTemplateMsgList",wxTemplateMsgList); | |||
| WxQuestion wxQuestion = new WxQuestion(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<WxQuestion> wxQuestionList = wxQuestionService.findList(wxQuestion); | |||
| map.put("wxQuestionList",wxQuestionList); | |||
| WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<WxMsgValidationcodeModel> wxMsgValidationcodeModelList = wxMsgValidationcodeModelService.findList(wxMsgValidationcodeModel); | |||
| map.put("wxMsgValidationcodeModelList",wxMsgValidationcodeModelList); | |||
| WxFlowConfig wxFlowConfig = new WxFlowConfig(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<WxFlowConfig> wxFlowConfigList = wxFlowConfigService.findList(wxFlowConfig); | |||
| map.put("wxFlowConfigList",wxFlowConfigList); | |||
| TenantEntity tenantEntity = new TenantEntity() {{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| ResultData wxMallBuildingFloorList = wxMallBuildingService.getBuildingFloorList(tenantEntity); | |||
| map.put("wxMallBuildingFloorList",wxMallBuildingFloorList); | |||
| WxPayAccount wxPayAccount = wxPayAccountService.getByTenantId(wxMall.getTenantId()); | |||
| map.put("wxPayAccount",wxPayAccount); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxMall.getTenantId()); | |||
| map.put("wxPayAccountBill",wxPayAccountBill); | |||
| WxAppinfo wxAppinfo = new WxAppinfo() {{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<WxAppinfo> wxAppinfoList = wxAppinfoService.getList(wxAppinfo); | |||
| map.put("wxAppinfoList",wxAppinfoList); | |||
| MallUserInfo mallUserInfo = new MallUserInfo() {{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<MallUserInfo> mallUserInfoList = mallUserInfoService.findList(mallUserInfo); | |||
| map.put("mallUserInfoList",mallUserInfoList); | |||
| WxMsgConfig wxMsgConfig = new WxMsgConfig() {{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| WxMsgConfig wxMsgConfigObject = wxMsgConfigService.findObject(wxMsgConfig); | |||
| map.put("wxMsgConfig",wxMsgConfigObject); | |||
| WxPark wxPark = new WxPark(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| WxPark wxParkObj = wxParkService.getByObj(wxPark); | |||
| map.put("wxPark",wxParkObj); | |||
| WxWiWideInfo wxWiWideInfo = new WxWiWideInfo(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| WxWiWideInfo wxWiWideInfoObject = wxWiWideInfoService.findObject(wxWiWideInfo); | |||
| map.put("wxWiWideInfo",wxWiWideInfoObject); | |||
| WxWeappInfo wxWeappInfo = new WxWeappInfo(){{ | |||
| setTenantId(wxMall.getTenantId()); | |||
| }}; | |||
| List<WxWeappInfo> wxAuthorizerInfoList = wxAuthorizerInfoService.getList(wxWeappInfo); | |||
| map.put("wxAuthorizerInfoList",wxAuthorizerInfoList); | |||
| return new ResultData(map); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("集团新增修改子广场") | |||
| @PostMapping("/init/submall") | |||
| @SystemControllerLog(description = "子广场-更新") | |||
| public ResultData initSubmall(@RequestBody WxMall wxMall) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initSubmall"); | |||
| try { | |||
| if(StringUtils.isBlank(wxMall.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(StringUtils.isBlank(wxMall.getParentTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxMall parentWxMall = wxMallService.getById(Long.parseLong(wxMall.getParentTenantId())); | |||
| if(parentWxMall == null || parentWxMall.getSaleType() != 100 | |||
| || !parentWxMall.equals(EnumGroupSupport.SUPPORT.getCode()) | |||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| String[] tenantIds = wxMall.getTenantId().split(","); | |||
| wxProjectConfigService.initSubmall(wxMall.getParentTenantId(),tenantIds); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| } | |||
| @@ -92,7 +92,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | |||
| } else { | |||
| info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(info.getTenantInfo()); | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(info); | |||
| for (WxLevelConfig levelConfig : levelList) { | |||
| if (info.getPoins() >= levelConfig.getPoints()) { | |||
| info.setLevel(levelConfig.getLevel()); | |||
| @@ -107,7 +107,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| WxCUserTags uTag = wxCUserTagsService.getById(info.getTagId()); | |||
| if (uTag != null && StringUtils.isNotBlank(uTag.getTags())) { | |||
| List<Long> ids = JSONObject.parseArray(uTag.getTags(), Long.class); | |||
| info.setTagsList(wxCUserTagsService.findTagList(info.getTenantInfo(), ids)); | |||
| info.setTagsList(wxCUserTagsService.findTagList(info, ids)); | |||
| } | |||
| } | |||
| } | |||
| @@ -52,7 +52,7 @@ public class MallRoleController extends BaseController { | |||
| @SystemControllerLog(description = "用户管理-role列表") | |||
| public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] MallRoleController::list"); | |||
| sysRole.updateTenantInfo(getTenantInfo()); | |||
| sysRole.updateTenantInfo(ifParentUpdateTenantInfo()); | |||
| sysRole.setSortColumns(BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<MallRole> page = sysRoleService.listAsPage(sysRole, pageNum, pageSize); | |||
| for (MallRole r : page.getList()) { | |||
| @@ -84,7 +84,7 @@ public class MallRoleController extends BaseController { | |||
| MallRole role = sysRoleService.getById(sysRole.getId()); | |||
| MallRolePermission p = new MallRolePermission(); | |||
| p.setRoleId(role.getId()); | |||
| p.updateTenantInfo(getTenantInfo()); | |||
| p.updateTenantInfo(ifParentUpdateTenantInfo()); | |||
| List<MallRolePermission> pers = sysRolePermissionService.getList(p); | |||
| String menus = ""; | |||
| for (MallRolePermission rp : pers) { | |||
| @@ -70,7 +70,7 @@ public class MallUserInfoController extends BaseController { | |||
| public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::listAsPage"); | |||
| userInfo.updateTenantInfo(getTenantInfo()); | |||
| userInfo.updateTenantInfo(ifParentUpdateTenantInfo()); | |||
| userInfo.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize); | |||
| for (MallUserInfo u : page.getList()) { | |||
| @@ -73,7 +73,7 @@ public class SysMenuController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] MallPermissionController::list"); | |||
| MallUserInfo user = getUser(); | |||
| if (user.checkGroupAdmin()) { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | |||
| user.setParentTenantId(tenantEntity.getParentTenantId()); | |||
| } | |||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.file.aliyun.AliyunOSS; | |||
| import com.iformall.service.QrCodeService; | |||
| import com.iformall.utils.ImgUtil; | |||
| import io.swagger.annotations.Api; | |||
| @@ -33,6 +34,8 @@ public class UploadController extends BaseController { | |||
| @Autowired | |||
| private String fmUploadDir; | |||
| @Autowired | |||
| private AliyunOSS aliyunOSS; | |||
| @Autowired | |||
| private QrCodeService qrCodeService; | |||
| @@ -67,15 +70,16 @@ public class UploadController extends BaseController { | |||
| String fileName = UUID.randomUUID().toString(); | |||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | |||
| String fileFormat = ""; | |||
| if (dot >= 0) { | |||
| String fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||
| fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||
| } else { | |||
| fileName = getFileName(tenantEntity, fileName); | |||
| } | |||
| System.out.println(fileName); | |||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||
| // ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||
| ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multiReq.getInputStream()); | |||
| return data; | |||
| } | |||
| @@ -137,15 +141,17 @@ public class UploadController extends BaseController { | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| metadata.setContentType(multiReq.getContentType()); | |||
| metadata.setContentLength(newFile.length()); | |||
| ResultData data = qrCodeService.awsUpload(new FileInputStream(newFile), metadata, fileName, tenantEntity); | |||
| // 删除本地缓存 | |||
| // ResultData data = qrCodeService.awsUpload(new FileInputStream(newFile), metadata, fileName, tenantEntity); | |||
| ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, new FileInputStream(newFile)); | |||
| // 删除本地缓存 | |||
| newFile.delete(); | |||
| return data; | |||
| } else { | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| metadata.setContentType(multiReq.getContentType()); | |||
| metadata.setContentLength(size); | |||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||
| // ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||
| ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multiReq.getInputStream()); | |||
| return data; | |||
| } | |||
| } catch (Exception e) { | |||
| @@ -185,14 +191,17 @@ public class UploadController extends BaseController { | |||
| String fileName = UUID.randomUUID().toString(); | |||
| int dot = multipartFile.getOriginalFilename().lastIndexOf('.'); | |||
| String fileFormat = ""; | |||
| if (dot >= 0) { | |||
| String fileFormat = multipartFile.getOriginalFilename().substring(dot, multipartFile.getOriginalFilename().length());; | |||
| fileFormat = multipartFile.getOriginalFilename().substring(dot, multipartFile.getOriginalFilename().length());; | |||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||
| } else { | |||
| fileName = getFileName(tenantEntity, fileName); | |||
| } | |||
| ResultData data1 = qrCodeService.awsUpload(multipartFile.getInputStream(), metadata, fileName, getTenantInfo()); | |||
| // ResultData data1 = qrCodeService.awsUpload(multipartFile.getInputStream(), metadata, fileName, getTenantInfo()); | |||
| ResultData data1 = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multipartFile.getInputStream()); | |||
| if(data1.code == ResultData.SUCCESS) { | |||
| Map _data = (Map)data1.data; | |||
| map.put("url", (String) _data.get("url")); | |||
| @@ -229,10 +238,17 @@ public class UploadController extends BaseController { | |||
| metadata.setContentLength(multiReq.getSize()); | |||
| String fileName = multiReq.getOriginalFilename(); | |||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | |||
| String fileFormat = ""; | |||
| if (dot >= 0) { | |||
| fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||
| } | |||
| fileName = "cimg/" + fileName; | |||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, new TenantEntity() {{ | |||
| setTenantId("cimg"); | |||
| }}); | |||
| // ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, new TenantEntity() {{ | |||
| // setTenantId("cimg"); | |||
| // }}); | |||
| ResultData data = aliyunOSS.uploadFile("cimg", fileFormat, multiReq.getInputStream()); | |||
| return data; | |||
| } | |||
| @@ -20,16 +20,16 @@ public class PasswordHelper { | |||
| } | |||
| /* | |||
| public static void main(String[] args) { | |||
| MallUserInfo user = new MallUserInfo(); | |||
| user.setUsername("admin"); | |||
| user.setPassword("admin123"); | |||
| user.setUsername("sadmin"); | |||
| user.setPassword("fm2020admin"); | |||
| PasswordHelper passwordHelper = new PasswordHelper(); | |||
| passwordHelper.encryptPassword(user); | |||
| System.out.println(user); | |||
| System.out.println(user.getPassword()); | |||
| } | |||
| */ | |||
| } | |||
| @@ -115,9 +115,6 @@ public class TenantInfoImpl implements TenantInfo { | |||
| if ("wx_c_user".equals(tableName)) { | |||
| return true; | |||
| } | |||
| if ("wx_c_user_basic_info".equals(tableName)) { | |||
| return true; | |||
| } | |||
| if ("wx_c_user_car".equals(tableName)) { | |||
| return true; | |||
| } | |||
| @@ -1,11 +1,11 @@ | |||
| spring: | |||
| profiles: | |||
| include: rabbitMQ | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: ENC(NUzgQOdJnCbVLKT6BaX0aw==) | |||
| password: ENC(mvuoDRiu0jqYaKNRwwTuXZ6U7aoIaqsjdiPqTLgi/nY=) | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||
| username: ENC(nUefcxWYlMS/1cDxikIKwA==) | |||
| password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -24,9 +24,9 @@ spring: | |||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=60000" | |||
| # REDIS | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| @@ -37,11 +37,29 @@ spring: | |||
| max-idle: 20 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(IiL/PHP9wCkpibWHRH/Mts8K9fh4izYqaiaF66bDrqtEHP+KUcJRRg==) | |||
| password: ENC(m7L57m8mk6tApVoa4XIDQnXF0VxnYjKe4LVdzcgb+xY=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -60,8 +78,14 @@ spring: | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| # | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| flyway: | |||
| enabled: true | |||
| enabled: false | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| @@ -80,9 +104,9 @@ wechat: | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -99,7 +123,7 @@ fm: | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /home/ec2-user/server/uploads/ | |||
| upload_dir: /root/uploads/ | |||
| ueditor: | |||
| config: config.json | |||
| @@ -448,3 +448,8 @@ CHANGE COLUMN `sub_tenant_id` `parent_tenant_id` varchar(5) CHARACTER SET utf8mb | |||
| ALTER TABLE `wx_wiwide_info` | |||
| CHANGE COLUMN `sub_tenant_id` `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`; | |||
| ALTER TABLE `wx_c_user_car` | |||
| ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`, | |||
| MODIFY COLUMN `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID'; | |||
| @@ -0,0 +1,17 @@ | |||
| ALTER TABLE `mallink`.`wx_msg_config` | |||
| ADD COLUMN `isAliyunSMS` smallint(1) NOT NULL DEFAULT 0 COMMENT '是否阿里云发短信1:是' AFTER `appid`; | |||
| ALTER TABLE `mallink`.`wx_msg_config` | |||
| CHANGE COLUMN `isAliyunSMS` `sms_channel` smallint(1) NOT NULL DEFAULT 0 COMMENT '发短信渠道0:wiwidi; 11:aliyun' AFTER `appid`; | |||
| ALTER TABLE `mallink`.`wx_msg_signature` | |||
| ADD COLUMN `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '短信签名申请说明' AFTER `createtime`, | |||
| ADD COLUMN `sign_status` smallint(1) COMMENT '签名审核状态。0:审核中1:审核通过。2:审核失败,请在参数Reason中查看审核失败原因。' AFTER `remark`, | |||
| ADD COLUMN `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '审核失败原因' AFTER `sign_status`; | |||
| ALTER TABLE `mallink`.`wx_msg_model` | |||
| ADD COLUMN `model_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '模板code' AFTER `model_id`; | |||
| ALTER TABLE `mallink`.`wx_msg_validationcode_model` | |||
| ADD COLUMN `model_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '模板code' AFTER `model_id`; | |||
| @@ -0,0 +1,13 @@ | |||
| ALTER TABLE `wx_c_user_basic_info` | |||
| ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`; | |||
| ALTER TABLE `wx_buser` | |||
| ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`; | |||
| ALTER TABLE `wx_mall` | |||
| ADD COLUMN `live_support` SMALLINT(1) DEFAULT '0' COMMENT '是否支持直播(0-不支持,1-支持)'; | |||
| ALTER TABLE `wx_user_visit` | |||
| ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`; | |||
| CREATE OR REPLACE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `mallink`.`view_touch_user` AS select date_format(`u`.`day_date`,'%Y-%m-%d') AS `xTime`,`u`.`tenant_id` AS `tenant_id`,`u`.`parent_tenant_id` AS `parent_tenant_id`,`u`.`visit_pv` AS `pv`,`u`.`visit_uv` AS `uv`,ifnull(`o`.`couponCount`,0) AS `couponCount`,ifnull(`o`.`userCount`,0) AS `userCount`,ifnull(`v`.`verifyCount`,0) AS `verifyCount`,ifnull(`v`.`verifyUserCount`,0) AS `verifyUserCount` from ((`mallink`.`wx_user_visit` `u` left join (select `mallink`.`wx_coupon_order`.`tenant_id` AS `tenant_id`,date_format(`mallink`.`wx_coupon_order`.`create_date`,'%Y-%m-%d') AS `xTime`,count(distinct `mallink`.`wx_coupon_order`.`c_user_id`) AS `userCount`,count(0) AS `couponCount` from `mallink`.`wx_coupon_order` group by `xTime`,`mallink`.`wx_coupon_order`.`tenant_id`) `o` on(((date_format(`u`.`day_date`,'%Y-%m-%d') = `o`.`xTime`) and (`o`.`tenant_id` = `u`.`tenant_id`)))) left join (select `mallink`.`wx_coupon_order`.`tenant_id` AS `tenant_id`,date_format(`mallink`.`wx_coupon_order`.`update_date`,'%Y-%m-%d') AS `xTime`,count(0) AS `verifyCount`,count(distinct `mallink`.`wx_coupon_order`.`c_user_id`) AS `verifyUserCount` from `mallink`.`wx_coupon_order` where (`mallink`.`wx_coupon_order`.`coupon_order_status` = 1) group by `xTime`,`mallink`.`wx_coupon_order`.`tenant_id`) `v` on(((date_format(`u`.`day_date`,'%Y-%m-%d') = `v`.`xTime`) and (`v`.`tenant_id` = `u`.`tenant_id`)))); | |||
| @@ -46,7 +46,6 @@ | |||
| com.fasterxml.uuid, | |||
| com.fasterxml, | |||
| com.github.axet, | |||
| com.github.binarywang, | |||
| com.github.jsqlparser, | |||
| com.github.pagehelper, | |||
| com.github.ulisesbocchio, | |||
| @@ -15,6 +15,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.config.AwsProperty; | |||
| import com.iformall.domain.po.MallResource; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.file.aliyun.AliyunOSS; | |||
| import com.iformall.service.MallResourceService; | |||
| import com.iformall.utils.ImgUtil; | |||
| import io.swagger.annotations.Api; | |||
| @@ -50,6 +51,9 @@ public class UploadController extends BaseController { | |||
| @Autowired | |||
| private String fmUploadDir; | |||
| @Autowired | |||
| private AliyunOSS aliyunOSS; | |||
| private AmazonS3 s3 = null; | |||
| private String getFileName(TenantEntity tenantEntity, String fileName) { | |||
| @@ -149,14 +153,16 @@ public class UploadController extends BaseController { | |||
| String fileName = UUID.randomUUID().toString(); | |||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | |||
| String fileFormat = ""; | |||
| if (dot >= 0) { | |||
| String fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||
| fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||
| } else { | |||
| fileName = getFileName(tenantEntity, fileName); | |||
| } | |||
| ResultData data = awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||
| // ResultData data = awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||
| ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multiReq.getInputStream()); | |||
| return data; | |||
| } | |||
| @@ -212,7 +218,8 @@ public class UploadController extends BaseController { | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| metadata.setContentType(multiReq.getContentType()); | |||
| metadata.setContentLength(newFile.length()); | |||
| ResultData data = awsUpload(new FileInputStream(newFile), metadata, fileName, tenantEntity); | |||
| // ResultData data = awsUpload(new FileInputStream(newFile), metadata, fileName, tenantEntity); | |||
| ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, new FileInputStream(newFile)); | |||
| // 删除本地缓存 | |||
| newFile.delete(); | |||
| return data; | |||
| @@ -220,7 +227,8 @@ public class UploadController extends BaseController { | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| metadata.setContentType(multiReq.getContentType()); | |||
| metadata.setContentLength(multiReq.getSize()); | |||
| ResultData data = awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||
| // ResultData data = awsUpload(multiReq.getInputStream(), metadata, fileName, tenantEntity); | |||
| ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multiReq.getInputStream()); | |||
| return data; | |||
| } | |||
| } | |||
| @@ -256,14 +264,16 @@ public class UploadController extends BaseController { | |||
| String fileName = UUID.randomUUID().toString(); | |||
| int dot = multipartFile.getOriginalFilename().lastIndexOf('.'); | |||
| String fileFormat = ""; | |||
| if (dot >= 0) { | |||
| String fileFormat = multipartFile.getOriginalFilename().substring(dot, multipartFile.getOriginalFilename().length()); | |||
| fileFormat = multipartFile.getOriginalFilename().substring(dot, multipartFile.getOriginalFilename().length()); | |||
| getFileName(tenantEntity, fileName + fileFormat); | |||
| } else { | |||
| getFileName(tenantEntity, fileName); | |||
| } | |||
| ResultData data1 = awsUpload(multipartFile.getInputStream(), metadata, fileName, tenantEntity); | |||
| // ResultData data1 = awsUpload(multipartFile.getInputStream(), metadata, fileName, tenantEntity); | |||
| ResultData data1 = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multipartFile.getInputStream()); | |||
| if (data1.code == ResultData.SUCCESS) { | |||
| Map _data = (Map) data1.data; | |||
| map.put("url", (String) _data.get("url")); | |||
| @@ -7,6 +7,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; | |||
| import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.annotation.AuthIgnore; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| @@ -75,6 +76,7 @@ public class WxInfoController extends BaseController { | |||
| WxMerchantBUserService merchantBUserService; | |||
| @AuthIgnore | |||
| @TenantIgnore | |||
| @ApiOperation("获取OPENID") | |||
| @PostMapping("getOpenId") | |||
| public ResultData getOpenId(@RequestBody Map<String,String> param) { | |||
| @@ -223,6 +225,7 @@ public class WxInfoController extends BaseController { | |||
| } | |||
| @AuthIgnore | |||
| @TenantIgnore | |||
| @ApiOperation("获取超管OPENID") | |||
| @PostMapping("getSuperOpenId") | |||
| public ResultData getSuperOpenId(@RequestBody Map<String,String> param) { | |||
| @@ -330,6 +333,7 @@ public class WxInfoController extends BaseController { | |||
| * @return | |||
| */ | |||
| @AuthIgnore | |||
| @TenantIgnore | |||
| @PostMapping("/getUserPhone") | |||
| @ApiOperation(value = "授权后获取用户的手机号", notes="{\"appId\":\"string\",\"encryptedData\":\"string\",\"iv\":\"string\",\"openId\":\"string\",\"session_key\":\"string\"}") | |||
| public ResultData getUserPhone(@RequestBody Map<String, String> map) { | |||
| @@ -67,6 +67,9 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||
| //设置userId到request里,后续根据userId,获取用户信息 | |||
| request.setAttribute(Constant.LOGIN_USER_KEY, wxBuser.getId()); | |||
| request.setAttribute(Constant.TENANT_ID, wxBuser.getTenantId()); | |||
| if (StringUtils.isNotBlank(wxBuser.getParentTenantId())) { | |||
| request.setAttribute(Constant.PARENT_TENANT_ID, wxBuser.getParentTenantId()); | |||
| } | |||
| //如果是要不需要自动设置tenantI信息 | |||
| @@ -1,13 +1,12 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| #include: rabbitMQ | |||
| #include: aliyunRocketMQ | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| #url: jdbc:mysql://rm-2zel9i9t555zy7lftmo.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | |||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | |||
| url: jdbc:mysql://202.165.179.86:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| password: fm2020test | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -27,9 +26,9 @@ spring: | |||
| #date-format: yyyy-MM-dd HH:mm:ss | |||
| # REDIS | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -52,11 +51,19 @@ spring: | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkbapi | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(lknBjZsA24AaQEXuy0fFw3acd4v4Xsf3CsgDcRZgjlYnNAL9R07d/w==) | |||
| password: ENC(gIkVPuYMmJ/EDxry8QIfGumIAk4plAwolGrfg1fiM3U=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -80,8 +87,8 @@ spring: | |||
| rabbitmq: | |||
| host: 202.165.179.86 | |||
| port: 5672 | |||
| username: ENC(2f9Nqt3c4cbVGYnhpjp9Mg==) | |||
| password: ENC(2av0JfMfz141IHkG6ibI8aKzmD33bc64wcN/O43ucbo=) | |||
| username: fumao | |||
| password: f9l98&*%%u7flt33 | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| @@ -101,16 +108,41 @@ jasypt: | |||
| encryptor: | |||
| password: oRqdnDbK5pj3eMmB | |||
| #wechat: | |||
| # open: | |||
| # componentAppId: "wxdfc8fb4e62d6b52b" | |||
| # componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 101.201.103.81 | |||
| # port: 6379 | |||
| # password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| open: | |||
| componentAppId: "wxdfc8fb4e62d6b52b" | |||
| componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -118,7 +150,7 @@ wechat: | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 500 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| @@ -1,11 +1,11 @@ | |||
| spring: | |||
| profiles: | |||
| include: rabbitMQ | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(NUzgQOdJnCbVLKT6BaX0aw==) | |||
| password: ENC(mvuoDRiu0jqYaKNRwwTuXZ6U7aoIaqsjdiPqTLgi/nY=) | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(nUefcxWYlMS/1cDxikIKwA==) | |||
| password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -23,9 +23,9 @@ spring: | |||
| maxOpenPreparedStatements: 20 | |||
| # REDIS | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| @@ -36,11 +36,29 @@ spring: | |||
| max-idle: 20 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(IiL/PHP9wCkpibWHRH/Mts8K9fh4izYqaiaF66bDrqtEHP+KUcJRRg==) | |||
| password: ENC(m7L57m8mk6tApVoa4XIDQnXF0VxnYjKe4LVdzcgb+xY=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -59,6 +77,11 @@ spring: | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| @@ -73,9 +96,9 @@ wechat: | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -92,7 +115,7 @@ fm: | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /home/ec2-user/server/uploads/ | |||
| upload_dir: /root/uploads/ | |||
| pos: | |||
| dev_id: fmpos | |||
| @@ -46,7 +46,6 @@ | |||
| com.fasterxml.uuid, | |||
| com.fasterxml, | |||
| com.github.axet, | |||
| com.github.binarywang, | |||
| com.github.jsqlparser, | |||
| com.github.pagehelper, | |||
| com.github.ulisesbocchio, | |||
| @@ -76,7 +76,7 @@ public class WebMvcConfig implements WebMvcConfigurer { | |||
| MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter(); | |||
| //ObjectMapper 是Jackson库的主要类。它提供一些功能将转换成Java对象匹配JSON结构,反之亦然 | |||
| ObjectMapper objectMapper = new ObjectMapper(); | |||
| // SimpleModule simpleModule = new SimpleModule(); | |||
| SimpleModule simpleModule = new SimpleModule(); | |||
| //不显示为null的字段 | |||
| objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); | |||
| @@ -88,17 +88,17 @@ public class WebMvcConfig implements WebMvcConfigurer { | |||
| .without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) | |||
| ); | |||
| //序列化将Long转String类型 | |||
| // simpleModule.addSerializer(Long.class, ToStringSerializer.instance); | |||
| // simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); | |||
| // SimpleModule bigIntegerModule = new SimpleModule(); | |||
| simpleModule.addSerializer(Long.class, ToStringSerializer.instance); | |||
| simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); | |||
| SimpleModule bigIntegerModule = new SimpleModule(); | |||
| //序列化将BigInteger转String类型 | |||
| // bigIntegerModule.addSerializer(BigInteger.class, ToStringSerializer.instance); | |||
| // SimpleModule bigDecimalModule = new SimpleModule(); | |||
| bigIntegerModule.addSerializer(BigInteger.class, ToStringSerializer.instance); | |||
| SimpleModule bigDecimalModule = new SimpleModule(); | |||
| //序列化将BigDecimal转String类型 | |||
| // bigDecimalModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); | |||
| // objectMapper.registerModule(simpleModule); | |||
| // objectMapper.registerModule(bigDecimalModule); | |||
| // objectMapper.registerModule(bigIntegerModule); | |||
| bigDecimalModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); | |||
| objectMapper.registerModule(simpleModule); | |||
| objectMapper.registerModule(bigDecimalModule); | |||
| objectMapper.registerModule(bigIntegerModule); | |||
| jackson2HttpMessageConverter.setObjectMapper(objectMapper); | |||
| converters.add(jackson2HttpMessageConverter); | |||
| } | |||
| @@ -11,9 +11,11 @@ import com.amazonaws.services.s3.AmazonS3ClientBuilder; | |||
| import com.amazonaws.services.s3.model.CannedAccessControlList; | |||
| import com.amazonaws.services.s3.model.ObjectMetadata; | |||
| import com.amazonaws.services.s3.model.PutObjectRequest; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.config.AwsProperty; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.file.aliyun.AliyunOSS; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @@ -42,6 +44,9 @@ public class UploadController extends BaseController { | |||
| @Autowired | |||
| private AwsProperty awsProperty; | |||
| @Autowired | |||
| private AliyunOSS aliyunOSS; | |||
| private AmazonS3 s3 = null; | |||
| private ResultData awsUpload(MultipartFile multiReq, ObjectMetadata metadata, String fileName) { | |||
| @@ -134,15 +139,24 @@ public class UploadController extends BaseController { | |||
| String fileName = UUID.randomUUID().toString(); | |||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | |||
| String fileFormat = ""; | |||
| if (dot >= 0) { | |||
| String fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||
| fileFormat = multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||
| } else { | |||
| fileName = getFileName(tenantEntity, fileName); | |||
| } | |||
| ResultData data = awsUpload(multiReq, metadata, fileName); | |||
| return data; | |||
| // ResultData data = awsUpload(multiReq, metadata, fileName); | |||
| try { | |||
| ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multiReq.getInputStream()); | |||
| return data; | |||
| } catch (IOException e) { | |||
| //e.printStackTrace(); | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||
| } | |||
| } | |||
| /** | |||
| @@ -176,24 +190,33 @@ public class UploadController extends BaseController { | |||
| String fileName = UUID.randomUUID().toString(); | |||
| int dot = multipartFile.getOriginalFilename().lastIndexOf('.'); | |||
| String fileFormat = ""; | |||
| if (dot >= 0) { | |||
| String fileFormat = multipartFile.getOriginalFilename().substring(dot, multipartFile.getOriginalFilename().length()); | |||
| fileFormat = multipartFile.getOriginalFilename().substring(dot, multipartFile.getOriginalFilename().length()); | |||
| fileName = getFileName(tenantEntity, fileName + fileFormat); | |||
| } else { | |||
| fileName = getFileName(tenantEntity, fileName); | |||
| } | |||
| ResultData data1 = awsUpload(multipartFile, metadata, fileName); | |||
| if (data1.code == ResultData.SUCCESS) { | |||
| Map _data = (Map) data1.data; | |||
| map.put("url", (String) _data.get("url")); | |||
| dataList.add(map); | |||
| } else { | |||
| // 部分成功 | |||
| data.code = ResultData.SUCCESS; | |||
| data.data = dataList; | |||
| return data; | |||
| // ResultData data1 = awsUpload(multipartFile, metadata, fileName); | |||
| try { | |||
| ResultData data1 = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multipartFile.getInputStream()); | |||
| if (data1.code == ResultData.SUCCESS) { | |||
| Map _data = (Map) data1.data; | |||
| map.put("url", (String) _data.get("url")); | |||
| dataList.add(map); | |||
| } else { | |||
| // 部分成功 | |||
| data.code = ResultData.SUCCESS; | |||
| data.data = dataList; | |||
| return data; | |||
| } | |||
| } catch (IOException e) { | |||
| //e.printStackTrace(); | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||
| } | |||
| } | |||
| data.code = ResultData.SUCCESS; | |||
| data.data = dataList; | |||
| @@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.annotation.AuthIgnore; | |||
| import com.iformall.annotation.RedisCache; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| @@ -132,6 +133,7 @@ public class WxUserGrantController extends BaseController { | |||
| * @return | |||
| */ | |||
| @AuthIgnore | |||
| @TenantIgnore | |||
| @PostMapping("/login") | |||
| @ApiOperation(value = "用户登录", notes = "{\"appId\":\"string\",\"code\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\",\"latitude\":\"string\",\"longitude\":\"string\",\"systemInfo\":\"string\"}") | |||
| public ResultData userLogin(@RequestBody Map<String, String> map) { | |||
| @@ -1,13 +1,12 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| #include: rabbitMQ | |||
| #include: aliyunRocketMQ | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| #url: jdbc:mysql://rm-2zel9i9t555zy7lftmo.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | |||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | |||
| url: jdbc:mysql://202.165.179.86:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| password: fm2020test | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -28,9 +27,9 @@ spring: | |||
| # REDIS | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -52,11 +51,19 @@ spring: | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkcapi | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(lknBjZsA24AaQEXuy0fFw3acd4v4Xsf3CsgDcRZgjlYnNAL9R07d/w==) | |||
| password: ENC(gIkVPuYMmJ/EDxry8QIfGumIAk4plAwolGrfg1fiM3U=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -80,8 +87,8 @@ spring: | |||
| rabbitmq: | |||
| host: 202.165.179.86 | |||
| port: 5672 | |||
| username: ENC(2f9Nqt3c4cbVGYnhpjp9Mg==) | |||
| password: ENC(2av0JfMfz141IHkG6ibI8aKzmD33bc64wcN/O43ucbo=) | |||
| username: fumao | |||
| password: f9l98&*%%u7flt33 | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| @@ -97,16 +104,41 @@ aws: | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| #wechat: | |||
| # open: | |||
| # componentAppId: "wxdfc8fb4e62d6b52b" | |||
| # componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 101.201.103.81 | |||
| # port: 6379 | |||
| # password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| open: | |||
| componentAppId: "wxdfc8fb4e62d6b52b" | |||
| componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -114,7 +146,7 @@ wechat: | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 500 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| @@ -1,11 +1,11 @@ | |||
| spring: | |||
| profiles: | |||
| include: rabbitMQ | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(NUzgQOdJnCbVLKT6BaX0aw==) | |||
| password: ENC(mvuoDRiu0jqYaKNRwwTuXZ6U7aoIaqsjdiPqTLgi/nY=) | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(nUefcxWYlMS/1cDxikIKwA==) | |||
| password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -23,9 +23,9 @@ spring: | |||
| maxOpenPreparedStatements: 20 | |||
| # REDIS | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| @@ -36,11 +36,29 @@ spring: | |||
| max-idle: 20 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(IiL/PHP9wCkpibWHRH/Mts8K9fh4izYqaiaF66bDrqtEHP+KUcJRRg==) | |||
| password: ENC(m7L57m8mk6tApVoa4XIDQnXF0VxnYjKe4LVdzcgb+xY=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -59,7 +77,11 @@ spring: | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| @@ -73,9 +95,9 @@ wechat: | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -92,7 +114,7 @@ fm: | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /home/ec2-user/server/uploads/ | |||
| upload_dir: /root/uploads/ | |||
| logging: | |||
| level: | |||
| @@ -49,7 +49,6 @@ | |||
| com.fasterxml.uuid, | |||
| com.fasterxml, | |||
| com.github.axet, | |||
| com.github.binarywang, | |||
| com.github.jsqlparser, | |||
| com.github.pagehelper, | |||
| com.github.ulisesbocchio, | |||
| @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @RestController | |||
| @@ -51,12 +52,17 @@ public class WxMsgCallbackController extends BaseController { | |||
| * @param param | |||
| */ | |||
| @PostMapping(value = "/receivemodelAliyun") | |||
| public Result receiveverifymodel(@RequestParam Map<String, String> param) { | |||
| public Result receiveverifymodel(@RequestBody List<Map<String, String>> param) { | |||
| logger.debug("[" + getIpAddr() + "] WxMsgCallbackController::receivemodelAliyun"); | |||
| logger.info(param.toString()); | |||
| try { | |||
| //解析param数据插入数据库中 | |||
| wxMsgCallbackService.receivemodelAliyun(param); | |||
| if(param != null && param.size() > 0){ | |||
| for (Map<String, String> p:param) { | |||
| //解析param数据插入数据库中 | |||
| wxMsgCallbackService.receivemodelAliyun(p); | |||
| } | |||
| } | |||
| }catch(Exception e){ | |||
| logger.error("aliyun 模板回调ERROR",e); | |||
| return new Result(ErrorCode.SYS_SERVER_ERROR); | |||
| @@ -66,12 +72,17 @@ public class WxMsgCallbackController extends BaseController { | |||
| } | |||
| @PostMapping(value = "/receivemsgAliyun") | |||
| public Result receivemsg(@RequestParam Map<String, String> param) { | |||
| public Result receivemsg(@RequestBody List<Map<String, String>> param) { | |||
| logger.debug("[" + getIpAddr() + "] WxMsgCallbackController::receivemsgAliyun"); | |||
| logger.info(param.toString()); | |||
| try { | |||
| //解析param数据插入数据库中 | |||
| wxMsgCallbackService.receivemsgAliyun(param); | |||
| if(param != null && param.size() > 0){ | |||
| for (Map<String, String> p:param) { | |||
| //解析param数据插入数据库中 | |||
| wxMsgCallbackService.receivemsgAliyun(p); | |||
| } | |||
| } | |||
| }catch(Exception e){ | |||
| logger.error("aliyun 短信回调ERROR",e); | |||
| return new Result(ErrorCode.SYS_SERVER_ERROR); | |||
| @@ -1,13 +1,12 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| #include: rabbitMQ | |||
| #include: aliyunRocketMQ | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| #url: jdbc:mysql://rm-2zel9i9t555zy7lftmo.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | |||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | |||
| url: jdbc:mysql://202.165.179.86:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| password: fm2020test | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -28,9 +27,9 @@ spring: | |||
| #date-format: yyyy-MM-dd HH:mm:ss | |||
| # REDIS | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -53,11 +52,19 @@ spring: | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkcallback | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(lknBjZsA24AaQEXuy0fFw3acd4v4Xsf3CsgDcRZgjlYnNAL9R07d/w==) | |||
| password: ENC(gIkVPuYMmJ/EDxry8QIfGumIAk4plAwolGrfg1fiM3U=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -81,8 +88,8 @@ spring: | |||
| rabbitmq: | |||
| host: 202.165.179.86 | |||
| port: 5672 | |||
| username: ENC(2f9Nqt3c4cbVGYnhpjp9Mg==) | |||
| password: ENC(2av0JfMfz141IHkG6ibI8aKzmD33bc64wcN/O43ucbo=) | |||
| username: fumao | |||
| password: f9l98&*%%u7flt33 | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| @@ -99,20 +106,45 @@ aws: | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| #wechat: | |||
| # web: | |||
| # appId: "wxe31beafbfd8295ba" | |||
| # secret: "c689fabf3c4c9f5b6424ff2a36a26727" | |||
| # url: "https://mall.youlane.cn" | |||
| # open: | |||
| # componentAppId: "wx897e4673286c915d" | |||
| # componentSecret: "cdfdfda65c45689beb6766c4c427eed2" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 101.201.103.81 | |||
| # port: 6379 | |||
| # password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wxe31beafbfd8295ba" | |||
| secret: "c689fabf3c4c9f5b6424ff2a36a26727" | |||
| url: "https://mall.youlane.cn" | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| open: | |||
| componentAppId: "wx897e4673286c915d" | |||
| componentSecret: "cdfdfda65c45689beb6766c4c427eed2" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -120,7 +152,7 @@ wechat: | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 500 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| @@ -1,11 +1,11 @@ | |||
| spring: | |||
| profiles: | |||
| include: rabbitMQ | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(NUzgQOdJnCbVLKT6BaX0aw==) | |||
| password: ENC(mvuoDRiu0jqYaKNRwwTuXZ6U7aoIaqsjdiPqTLgi/nY=) | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(nUefcxWYlMS/1cDxikIKwA==) | |||
| password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -24,9 +24,9 @@ spring: | |||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=6000" | |||
| # REDIS | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| @@ -37,11 +37,29 @@ spring: | |||
| max-idle: 20 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(IiL/PHP9wCkpibWHRH/Mts8K9fh4izYqaiaF66bDrqtEHP+KUcJRRg==) | |||
| password: ENC(m7L57m8mk6tApVoa4XIDQnXF0VxnYjKe4LVdzcgb+xY=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -60,7 +78,11 @@ spring: | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| @@ -78,9 +100,9 @@ wechat: | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -97,7 +119,7 @@ fm: | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /home/ec2-user/server/uploads/ | |||
| upload_dir: /root/uploads/ | |||
| logging: | |||
| level: | |||
| @@ -43,7 +43,6 @@ | |||
| com.fasterxml.uuid, | |||
| com.fasterxml, | |||
| com.github.axet, | |||
| com.github.binarywang, | |||
| com.github.jsqlparser, | |||
| com.github.pagehelper, | |||
| com.github.ulisesbocchio, | |||
| @@ -1,13 +1,12 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| #include: rabbitMQ | |||
| #include: aliyunRocketMQ | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| #url: jdbc:mysql://rm-2zel9i9t555zy7lftmo.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | |||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | |||
| url: jdbc:mysql://202.165.179.86:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| password: fm2020test | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -29,9 +28,9 @@ spring: | |||
| # REDIS | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -54,11 +53,19 @@ spring: | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkmqconsumer | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(lknBjZsA24AaQEXuy0fFw3acd4v4Xsf3CsgDcRZgjlYnNAL9R07d/w==) | |||
| password: ENC(gIkVPuYMmJ/EDxry8QIfGumIAk4plAwolGrfg1fiM3U=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -80,8 +87,8 @@ spring: | |||
| rabbitmq: | |||
| host: 202.165.179.86 | |||
| port: 5672 | |||
| username: ENC(2f9Nqt3c4cbVGYnhpjp9Mg==) | |||
| password: ENC(2av0JfMfz141IHkG6ibI8aKzmD33bc64wcN/O43ucbo=) | |||
| username: fumao | |||
| password: f9l98&*%%u7flt33 | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| @@ -97,16 +104,41 @@ aws: | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| #wechat: | |||
| # open: | |||
| # componentAppId: "wxdfc8fb4e62d6b52b" | |||
| # componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 101.201.103.81 | |||
| # port: 6379 | |||
| # password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| open: | |||
| componentAppId: "wxdfc8fb4e62d6b52b" | |||
| componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -114,10 +146,11 @@ wechat: | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 500 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| jasypt: | |||
| encryptor: | |||
| password: oRqdnDbK5pj3eMmB | |||
| @@ -1,11 +1,11 @@ | |||
| spring: | |||
| profiles: | |||
| include: rabbitMQ | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(NUzgQOdJnCbVLKT6BaX0aw==) | |||
| password: ENC(mvuoDRiu0jqYaKNRwwTuXZ6U7aoIaqsjdiPqTLgi/nY=) | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(nUefcxWYlMS/1cDxikIKwA==) | |||
| password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -24,9 +24,9 @@ spring: | |||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=6000" | |||
| # REDIS | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| @@ -37,11 +37,28 @@ spring: | |||
| max-idle: 50 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(IiL/PHP9wCkpibWHRH/Mts8K9fh4izYqaiaF66bDrqtEHP+KUcJRRg==) | |||
| password: ENC(m7L57m8mk6tApVoa4XIDQnXF0VxnYjKe4LVdzcgb+xY=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -60,7 +77,11 @@ spring: | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| @@ -74,9 +95,9 @@ wechat: | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -93,7 +114,7 @@ fm: | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /home/ec2-user/server/uploads/ | |||
| upload_dir: /root/uploads/ | |||
| logging: | |||
| level: | |||
| @@ -46,7 +46,6 @@ | |||
| com.fasterxml.uuid, | |||
| com.fasterxml, | |||
| com.github.axet, | |||
| com.github.binarywang, | |||
| com.github.jsqlparser, | |||
| com.github.pagehelper, | |||
| com.github.ulisesbocchio, | |||
| @@ -1,13 +1,12 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| #include: rabbitMQ | |||
| #include: aliyunRocketMQ | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| #url: jdbc:mysql://rm-2zel9i9t555zy7lftmo.mysql.rds.aliyuncs.com:3306/mallinkDevGroup1?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallinkDevGroup1?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | |||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | |||
| url: jdbc:mysql://202.165.179.86:3306/mallinkDevGroup1?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| password: fm2020test | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -27,9 +26,9 @@ spring: | |||
| #date-format: yyyy-MM-dd HH:mm:ss | |||
| # REDIS | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -52,11 +51,19 @@ spring: | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkposapi | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(lknBjZsA24AaQEXuy0fFw3acd4v4Xsf3CsgDcRZgjlYnNAL9R07d/w==) | |||
| password: ENC(gIkVPuYMmJ/EDxry8QIfGumIAk4plAwolGrfg1fiM3U=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -80,8 +87,8 @@ spring: | |||
| rabbitmq: | |||
| host: 202.165.179.86 | |||
| port: 5672 | |||
| username: ENC(2f9Nqt3c4cbVGYnhpjp9Mg==) | |||
| password: ENC(2av0JfMfz141IHkG6ibI8aKzmD33bc64wcN/O43ucbo=) | |||
| username: fumao | |||
| password: f9l98&*%%u7flt33 | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| @@ -101,16 +108,41 @@ jasypt: | |||
| encryptor: | |||
| password: oRqdnDbK5pj3eMmB | |||
| #wechat: | |||
| # open: | |||
| # componentAppId: "wxdfc8fb4e62d6b52b" | |||
| # componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 101.201.103.81 | |||
| # port: 6379 | |||
| # password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| open: | |||
| componentAppId: "wxdfc8fb4e62d6b52b" | |||
| componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -118,7 +150,7 @@ wechat: | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 500 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| @@ -1,11 +1,11 @@ | |||
| spring: | |||
| profiles: | |||
| include: rabbitMQ | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(NUzgQOdJnCbVLKT6BaX0aw==) | |||
| password: ENC(mvuoDRiu0jqYaKNRwwTuXZ6U7aoIaqsjdiPqTLgi/nY=) | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(nUefcxWYlMS/1cDxikIKwA==) | |||
| password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -23,9 +23,9 @@ spring: | |||
| maxOpenPreparedStatements: 20 | |||
| # REDIS | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| @@ -36,11 +36,28 @@ spring: | |||
| max-idle: 20 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(IiL/PHP9wCkpibWHRH/Mts8K9fh4izYqaiaF66bDrqtEHP+KUcJRRg==) | |||
| password: ENC(m7L57m8mk6tApVoa4XIDQnXF0VxnYjKe4LVdzcgb+xY=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -59,7 +76,11 @@ spring: | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| @@ -73,9 +94,9 @@ wechat: | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -92,7 +113,7 @@ fm: | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /home/ec2-user/server/uploads/ | |||
| upload_dir: /root/uploads/ | |||
| logging: | |||
| level: | |||
| @@ -43,7 +43,6 @@ | |||
| com.fasterxml.uuid, | |||
| com.fasterxml, | |||
| com.github.axet, | |||
| com.github.binarywang, | |||
| com.github.jsqlparser, | |||
| com.github.pagehelper, | |||
| com.github.ulisesbocchio, | |||
| @@ -28,7 +28,7 @@ public class WxCUserCheckSchedule { | |||
| @Autowired | |||
| private WxCUserMapper cUserMapper; | |||
| @Scheduled(cron = "0 0 8 * * ?") // 每天凌晨08:00对c_user扫描查重 | |||
| //@Scheduled(cron = "0 0 8 * * ?") // 每天凌晨08:00对c_user扫描查重 | |||
| // @Scheduled(cron = "0 */1 * * * ?") // 测试1分钟一次 | |||
| public void cuserCheckDuplicate() { | |||
| @@ -1,13 +1,12 @@ | |||
| spring: | |||
| profiles: | |||
| include: aliyunRocketMQ | |||
| #include: rabbitMQ | |||
| #include: aliyunRocketMQ | |||
| include: rabbitMQ | |||
| # JDBC | |||
| datasource: | |||
| #url: jdbc:mysql://rm-2zel9i9t555zy7lftmo.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | |||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | |||
| url: jdbc:mysql://202.165.179.86:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||
| username: root | |||
| password: fm2020test | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -29,9 +28,9 @@ spring: | |||
| # REDIS | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 5 | |||
| @@ -54,11 +53,19 @@ spring: | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkschedule | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(lknBjZsA24AaQEXuy0fFw3acd4v4Xsf3CsgDcRZgjlYnNAL9R07d/w==) | |||
| password: ENC(gIkVPuYMmJ/EDxry8QIfGumIAk4plAwolGrfg1fiM3U=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -80,8 +87,8 @@ spring: | |||
| rabbitmq: | |||
| host: 202.165.179.86 | |||
| port: 5672 | |||
| username: ENC(2f9Nqt3c4cbVGYnhpjp9Mg==) | |||
| password: ENC(2av0JfMfz141IHkG6ibI8aKzmD33bc64wcN/O43ucbo=) | |||
| username: fumao | |||
| password: f9l98&*%%u7flt33 | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| @@ -97,16 +104,41 @@ aws: | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| #wechat: | |||
| # open: | |||
| # componentAppId: "wxdfc8fb4e62d6b52b" | |||
| # componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| # componentToken: "formall2018" | |||
| # componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| # redis: | |||
| # host: 101.201.103.81 | |||
| # port: 6379 | |||
| # password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| # timeout: 3600 | |||
| # expire: 1800 #30分钟 | |||
| # database: 2 | |||
| # defaultExpiration: 2592000 # 默认生命周期30天 | |||
| # jedis: | |||
| # pool: | |||
| # max-active: 100 | |||
| # max-idle: 500 | |||
| # max-wait: -1 | |||
| # min-idle: 10 | |||
| wechat: | |||
| web: | |||
| appId: "wx091907dd0bfd3f6b" | |||
| secret: "2a2ca10738998b9ef92c1fe8a4d366a6" | |||
| url: "https://admintest.malls.iformall.com" | |||
| open: | |||
| componentAppId: "wxdfc8fb4e62d6b52b" | |||
| componentSecret: "98daa62b316dd6feabaad708327ce233" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| componentAppId: wxdfc8fb4e62d6b52b | |||
| componentSecret: 98daa62b316dd6feabaad708327ce233 | |||
| componentToken: formall2018 | |||
| componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN | |||
| redis: | |||
| host: 101.201.103.81 | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) | |||
| password: iF0rm@2l2ol9 | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -114,7 +146,7 @@ wechat: | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 500 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| @@ -1,11 +1,11 @@ | |||
| spring: | |||
| profiles: | |||
| include: rabbitMQ | |||
| include: aliyunRocketMQ | |||
| # JDBC | |||
| datasource: | |||
| url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(NUzgQOdJnCbVLKT6BaX0aw==) | |||
| password: ENC(mvuoDRiu0jqYaKNRwwTuXZ6U7aoIaqsjdiPqTLgi/nY=) | |||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true | |||
| username: ENC(nUefcxWYlMS/1cDxikIKwA==) | |||
| password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) | |||
| type: com.alibaba.druid.pool.DruidDataSource | |||
| driver-class-name: com.mysql.cj.jdbc.Driver | |||
| filters: stat | |||
| @@ -24,9 +24,9 @@ spring: | |||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=6000" | |||
| # REDIS | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| @@ -37,11 +37,28 @@ spring: | |||
| max-idle: 8 | |||
| max-wait: -1 | |||
| min-idle: 0 | |||
| # SMS | |||
| aliyun: | |||
| sms: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| product: Dysmsapi | |||
| domain: dysmsapi.aliyuncs.com | |||
| regionId: cn-hangzhou | |||
| dateFormat: yyyyMMdd | |||
| endpointName: cn-hangzhou | |||
| oss: | |||
| endpoint: oss-cn-beijing.aliyuncs.com | |||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| bucketname: formall | |||
| filehost: malinkadmin | |||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||
| mail: | |||
| host: smtp.exmail.qq.com | |||
| username: ENC(IiL/PHP9wCkpibWHRH/Mts8K9fh4izYqaiaF66bDrqtEHP+KUcJRRg==) | |||
| password: ENC(m7L57m8mk6tApVoa4XIDQnXF0VxnYjKe4LVdzcgb+xY=) # 授权密码 | |||
| username: zhengfangyuan@iformall.com | |||
| password: xnydCeUzofB2h8qp # 授权密码 | |||
| properties: | |||
| mail: | |||
| smtp: | |||
| @@ -60,7 +77,11 @@ spring: | |||
| publisher-confirms: true | |||
| publisher-returns: false | |||
| virtual-host: / | |||
| aliyunRocketmq: | |||
| accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" | |||
| accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" | |||
| groupId: "GID_P_1" | |||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| bucketName: iformall-net | |||
| @@ -74,9 +95,9 @@ wechat: | |||
| componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) | |||
| componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) | |||
| redis: | |||
| host: 127.0.0.1 | |||
| host: 101.201.103.81 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| password: ENC(KD+AiEPSefoV6aKm5qchSASXFGijMzHL) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 2 | |||
| @@ -93,7 +114,7 @@ fm: | |||
| exception_emails: houtaikaifa@iformall.com | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /home/ec2-user/server/uploads/ | |||
| upload_dir: /root/uploads/ | |||
| monitor_emails: houtaikaifa@iformall.com,xiaochengxufabu@iformall.com | |||
| monitor_enable: false | |||
| clear_data_before_msg_record: 1 | |||
| @@ -0,0 +1,47 @@ | |||
| package com.iformall.common; | |||
| import org.springframework.web.context.request.RequestAttributes; | |||
| public class NonWebRequestAttributes implements RequestAttributes{ | |||
| @Override | |||
| public Object getAttribute(String arg0, int arg1) { | |||
| return null; | |||
| } | |||
| @Override | |||
| public String[] getAttributeNames(int arg0) { | |||
| return null; | |||
| } | |||
| @Override | |||
| public String getSessionId() { | |||
| return null; | |||
| } | |||
| @Override | |||
| public Object getSessionMutex() { | |||
| return null; | |||
| } | |||
| @Override | |||
| public void registerDestructionCallback(String arg0, Runnable arg1, int arg2) { | |||
| } | |||
| @Override | |||
| public void removeAttribute(String arg0, int arg1) { | |||
| } | |||
| @Override | |||
| public Object resolveReference(String arg0) { | |||
| return null; | |||
| } | |||
| @Override | |||
| public void setAttribute(String arg0, Object arg1, int arg2) { | |||
| } | |||
| } | |||
| @@ -1,26 +1,46 @@ | |||
| package com.iformall.common; | |||
| import org.springframework.web.context.request.RequestAttributes; | |||
| import org.springframework.web.context.request.RequestContextHolder; | |||
| public class TenantThreadLocal { | |||
| private static ThreadLocal<String> local = new ThreadLocal<String>(); | |||
| private static ThreadLocal<String> parentLocal = new ThreadLocal<String>(); | |||
| //private static ThreadLocal<String> local = new ThreadLocal<String>(); | |||
| //private static ThreadLocal<String> parentLocal = new ThreadLocal<String>(); | |||
| public static void setCurrentThreadTenant(String tenantId,String parentId) { | |||
| local.set(tenantId); | |||
| parentLocal.set(parentId); | |||
| getRequestAttributesSafely().setAttribute("tenaneId", tenantId, RequestAttributes.SCOPE_REQUEST); | |||
| getRequestAttributesSafely().setAttribute("parentTenaneId", parentId, RequestAttributes.SCOPE_REQUEST); | |||
| //local.set(tenantId); | |||
| //parentLocal.set(parentId); | |||
| } | |||
| public static String getTenantId() { | |||
| return local.get(); | |||
| return (String)getRequestAttributesSafely().getAttribute("tenaneId", RequestAttributes.SCOPE_REQUEST); | |||
| //return local.get(); | |||
| } | |||
| public static String getParentTenantId() { | |||
| return parentLocal.get(); | |||
| return (String)getRequestAttributesSafely().getAttribute("parentTenaneId", RequestAttributes.SCOPE_REQUEST); | |||
| //return parentLocal.get(); | |||
| } | |||
| public static void remove() { | |||
| local.remove(); | |||
| parentLocal.remove(); | |||
| getRequestAttributesSafely().removeAttribute("tenaneId", RequestAttributes.SCOPE_REQUEST); | |||
| getRequestAttributesSafely().removeAttribute("parentTenaneId", RequestAttributes.SCOPE_REQUEST); | |||
| //local.remove(); | |||
| //parentLocal.remove(); | |||
| } | |||
| //如果是非web的线程,则都为空 | |||
| public static RequestAttributes getRequestAttributesSafely(){ | |||
| RequestAttributes requestAttributes = null; | |||
| try{ | |||
| requestAttributes = RequestContextHolder.currentRequestAttributes(); | |||
| }catch (IllegalStateException e){ | |||
| requestAttributes = new NonWebRequestAttributes(); | |||
| } | |||
| return requestAttributes; | |||
| } | |||
| } | |||
| @@ -2,6 +2,8 @@ package com.iformall.domain.dto; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.iformall.domain.po.base.BaseTenantEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -15,7 +17,7 @@ import java.util.List; | |||
| */ | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCUserBasicInfoDto extends BaseTenantEntity { | |||
| public class WxCUserBasicInfoDto extends TenantEntity { | |||
| protected Long id; | |||
| @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import com.iformall.domain.po.base.BaseTenantEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.utils.Constant; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -22,7 +23,7 @@ import java.util.UUID; | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxBuser extends BaseTenantEntity { | |||
| public class WxBuser extends TenantEntity { | |||
| protected Long id; | |||
| @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import com.iformall.domain.po.base.BaseTenantEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| @@ -19,7 +21,7 @@ import java.util.Objects; | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCUserBasicInfo extends BaseTenantEntity { | |||
| public class WxCUserBasicInfo extends TenantEntity { | |||
| protected Long id; | |||
| @@ -2,6 +2,8 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseTenantEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -10,7 +12,7 @@ import java.util.*; | |||
| @TableName(value = "wx_c_user_car") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCUserCar extends BaseTenantEntity { | |||
| public class WxCUserCar extends TenantEntity { | |||
| protected Long id; | |||
| @@ -86,6 +86,8 @@ public class WxMall extends BaseEntity { | |||
| private BigDecimal longitude; | |||
| @io.swagger.annotations.ApiModelProperty(value="纬度",name="latitude") | |||
| private BigDecimal latitude; | |||
| @io.swagger.annotations.ApiModelProperty(value="直播支持(0:不支持,1支持)",name="liveSupport") | |||
| private Integer liveSupport; | |||
| @TableField(exist = false) | |||
| protected List<WxMallBuilding> buildings; | |||
| @@ -44,7 +44,7 @@ public class WxMsgConfig extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="appid",name="appid") | |||
| private String appid; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否阿里云发短信1:是;0:否",name="isAliyunSMS") | |||
| private Integer isAliyunSMS; | |||
| @io.swagger.annotations.ApiModelProperty(value="发短信渠道0:wiwidi; 11:aliyun",name="smsChannel") | |||
| private Integer smsChannel; | |||
| } | |||
| @@ -1,7 +1,7 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseTenantEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -10,7 +10,7 @@ import java.util.*; | |||
| @TableName(value = "wx_user_visit") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxUserVisit extends BaseTenantEntity { | |||
| public class WxUserVisit extends TenantEntity { | |||
| protected Long id; | |||
| @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.fasterxml.jackson.annotation.JsonProperty; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| /** | |||
| @@ -11,6 +13,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| * @date 2019/4/24 14:32 | |||
| */ | |||
| @Data | |||
| @Slf4j | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class BaseTenantEntity extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| @@ -25,6 +28,7 @@ public class BaseTenantEntity extends BaseEntity { | |||
| private TenantEntity tenantInfo; | |||
| public void updateTenantInfo(TenantEntity info) { | |||
| log.info("info.tenantId:"+info.getTenantId()+". info.parentTenantId:"+info.getParentTenantId()+"."); | |||
| setTenantId(info.getTenantId()); | |||
| if (StringUtils.isNotBlank(info.getParentTenantId())) { | |||
| setParentTenantId(info.getParentTenantId()); | |||
| @@ -11,7 +11,9 @@ import org.apache.commons.lang3.StringUtils; | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class TenantEntity extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private static final long serialVersionUID = 1441638860618733611L; | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="父租户ID",name="parentTenantId") | |||
| @@ -0,0 +1,99 @@ | |||
| package com.iformall.file.aliyun; | |||
| import com.aliyun.oss.*; | |||
| import com.aliyun.oss.model.CannedAccessControlList; | |||
| import com.aliyun.oss.model.CreateBucketRequest; | |||
| import com.aliyun.oss.model.PutObjectRequest; | |||
| import com.aliyun.oss.model.PutObjectResult; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.file.aliyun.bean.AliyunOSSConfig; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| import org.springframework.stereotype.Service; | |||
| import java.io.File; | |||
| import java.io.InputStream; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| import java.util.UUID; | |||
| @Component | |||
| @Slf4j | |||
| public class AliyunOSS { | |||
| @Autowired | |||
| private AliyunOSSConfig aliyunOSSConfig; | |||
| public ResultData uploadFile(String folder, String suffix,InputStream inputStream){ | |||
| String upload = upload(folder,suffix, inputStream); | |||
| ResultData data; | |||
| if(StringUtils.isNotBlank(upload)){ | |||
| data = new ResultData(); | |||
| Map<String, String> map = new HashMap<>(); | |||
| map.put("url", upload); | |||
| data.data = map; | |||
| }else{ | |||
| data = new ResultData(ResultData.ERROR,"上传失败"); | |||
| } | |||
| return data; | |||
| } | |||
| /** | |||
| * 上传 | |||
| * @param inputStream | |||
| * @return | |||
| */ | |||
| public String upload(String folder, String suffix,InputStream inputStream){ | |||
| log.info("=========>OSS文件上传开始:"); | |||
| String endpoint= aliyunOSSConfig.getEndpoint(); | |||
| String accessKeyId= aliyunOSSConfig.getKeyid(); | |||
| String accessKeySecret=aliyunOSSConfig.getKeysecret(); | |||
| String bucketName=aliyunOSSConfig.getBucketname(); | |||
| String fileHost=aliyunOSSConfig.getFilehost(); | |||
| SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | |||
| String dateStr = format.format(new Date()); | |||
| if(null == inputStream){ | |||
| return null; | |||
| } | |||
| OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId,accessKeySecret); | |||
| try { | |||
| //容器不存在,就创建 | |||
| if(! ossClient.doesBucketExist(bucketName)){ | |||
| ossClient.createBucket(bucketName); | |||
| CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName); | |||
| createBucketRequest.setCannedACL(CannedAccessControlList.PublicRead); | |||
| ossClient.createBucket(createBucketRequest); | |||
| } | |||
| if(StringUtils.isNotBlank(folder)){ | |||
| folder = folder + "/"; | |||
| }else{ | |||
| folder = ""; | |||
| } | |||
| //创建文件路径 | |||
| String fileUrl = folder + fileHost + "/" + dateStr + "/" | |||
| + UUID.randomUUID().toString().replace("-","") + suffix; | |||
| //上传文件 | |||
| PutObjectResult result = ossClient.putObject(new PutObjectRequest(bucketName, fileUrl, inputStream)); | |||
| //设置权限 这里是公开读 | |||
| ossClient.setBucketAcl(bucketName,CannedAccessControlList.PublicRead); | |||
| if(null != result){ | |||
| log.info("==========>OSS文件上传成功,OSS地址:"+fileUrl); | |||
| return aliyunOSSConfig.getFiledomain() + "/" + fileUrl; | |||
| } | |||
| }catch (OSSException oe){ | |||
| log.error(oe.getMessage()); | |||
| }catch (ClientException ce){ | |||
| log.error(ce.getMessage()); | |||
| }finally { | |||
| //关闭 | |||
| ossClient.shutdown(); | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -0,0 +1,22 @@ | |||
| package com.iformall.file.aliyun.bean; | |||
| import lombok.Data; | |||
| import org.springframework.boot.context.properties.ConfigurationProperties; | |||
| import org.springframework.stereotype.Component; | |||
| /** | |||
| * aliyun 配置 | |||
| */ | |||
| @Component | |||
| @Data | |||
| @ConfigurationProperties(prefix = "spring.aliyun.oss") | |||
| public class AliyunOSSConfig { | |||
| private String endpoint; | |||
| private String keyid; | |||
| private String keysecret; | |||
| private String bucketname; | |||
| private String filehost; | |||
| private String filedomain; | |||
| } | |||
| @@ -7,10 +7,6 @@ import com.iformall.domain.po.WxMallFloor; | |||
| public interface WxMallFloorMapper extends CommonMapper<WxMallFloor, String> { | |||
| List<WxMallFloor> findList(WxMallFloor wxMallFloor); | |||
| int deleteByBuildingId(Long buildingId); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxMall; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| @@ -17,4 +18,5 @@ public interface WxMallMapper extends CommonMapper<WxMall, Long> { | |||
| String queryMenusByTenantInfo(WxMall wxMall); | |||
| void undateSubmall(@Param(value = "parentTenantId")String parentTenantId, @Param(value = "tenantIds")String[] tenantIds); | |||
| } | |||
| @@ -11,10 +11,7 @@ import java.util.List; | |||
| public interface WxPayAccountBillMapper extends CommonMapper<WxPayAccountBill, Long> { | |||
| List<WxPayAccountBill> findList(WxPayAccountBill wxPayAccount); | |||
| WxPayAccountBill getByTenantId(String tenantId); | |||
| } | |||
| @@ -7,10 +7,7 @@ import com.iformall.domain.po.WxPayAccount; | |||
| public interface WxPayAccountMapper extends CommonMapper<WxPayAccount, Long> { | |||
| List<WxPayAccount> findList(WxPayAccount wxPayAccount); | |||
| WxPayAccount getByTenantId(String tenantId); | |||
| } | |||
| @@ -3,6 +3,8 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxCouponSendConfig; | |||
| import java.util.List; | |||
| public interface WxCouponSendConfigService { | |||
| /** | |||
| @@ -21,6 +23,8 @@ public interface WxCouponSendConfigService { | |||
| * @return | |||
| */ | |||
| PageInfo<WxCouponSendConfig> listAsPage(WxCouponSendConfig record, Integer pageIndex, Integer pageSize); | |||
| List<WxCouponSendConfig> findList(WxCouponSendConfig record); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -0,0 +1,20 @@ | |||
| package com.iformall.service; | |||
| import com.iformall.domain.po.WxFlowConfig; | |||
| import java.util.List; | |||
| /** | |||
| * | |||
| * wx_flow_config | |||
| */ | |||
| public interface WxFlowConfigService { | |||
| /** | |||
| * 查询列表 | |||
| * | |||
| * @param record | |||
| */ | |||
| List<WxFlowConfig> findList(WxFlowConfig record); | |||
| } | |||
| @@ -42,4 +42,5 @@ public interface WxMallFloorService { | |||
| ResultData getFloorList(TenantEntity tenantEntity, Long buildingId); | |||
| void deleteByBuildingId(Long buildingId); | |||
| } | |||
| @@ -79,4 +79,5 @@ public interface WxMallService { | |||
| */ | |||
| List<WxMall> getSubByParentTenantId(String parentTenantId); | |||
| void undateSubmall(String parentTenantId, String[] tenantIds); | |||
| } | |||
| @@ -5,6 +5,8 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMsgValidationcodeModel; | |||
| import com.iformall.domain.po.WxProjectConfig; | |||
| import java.util.List; | |||
| public interface WxMsgValidationcodeModelService { | |||
| /** | |||
| @@ -13,7 +15,7 @@ public interface WxMsgValidationcodeModelService { | |||
| * @param tenantId | |||
| * @return | |||
| */ | |||
| void wxMsgValidationcodeModelInit(String tenantId, WxProjectConfig wxProjectConfig); | |||
| void wxMsgValidationcodeModelInit(String tenantId, String signature,String emailBgImg); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -24,6 +26,8 @@ public interface WxMsgValidationcodeModelService { | |||
| * @return | |||
| */ | |||
| PageInfo<WxMsgValidationcodeModel> listAsPage(WxMsgValidationcodeModel record, Integer pageIndex, Integer pageSize); | |||
| List<WxMsgValidationcodeModel> findList(WxMsgValidationcodeModel record); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -55,12 +55,7 @@ public interface WxPayAccountBillService { | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| WxPayAccountBill getByTenantId(String tenantId); | |||
| } | |||
| @@ -47,12 +47,7 @@ public interface WxPayAccountService { | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| WxPayAccount getByTenantId(String te); | |||
| } | |||
| @@ -1,6 +1,10 @@ | |||
| package com.iformall.service; | |||
| import com.iformall.domain.po.*; | |||
| import java.util.List; | |||
| public interface WxProjectConfigService { | |||
| /** | |||
| @@ -10,4 +14,30 @@ public interface WxProjectConfigService { | |||
| */ | |||
| void initProjectConfig(Long id); | |||
| /** | |||
| * 初始化新增修改wxmall | |||
| * @param wxMall | |||
| */ | |||
| void initMall(WxMall wxMall); | |||
| /** | |||
| * 初始化新增修改wxMallBuilding | |||
| * @param wxMallBuildings | |||
| */ | |||
| void initBuilding(List<WxMallBuilding> wxMallBuildings); | |||
| /** | |||
| * 初始化新增修改wxPayAccount | |||
| * @param wxPayAccount | |||
| */ | |||
| void initPayAccount(WxPayAccount wxPayAccount); | |||
| /** | |||
| * 初始化新增userInfo | |||
| * @param userInfo | |||
| */ | |||
| void initUserInfo(MallUserInfo userInfo); | |||
| void initSubmall(String parentTenantId, String[] tenantIds); | |||
| } | |||
| @@ -13,10 +13,10 @@ public interface WxQuestionService { | |||
| * wx_question 初始化 | |||
| * | |||
| * @param tenantId | |||
| * @param questionJson | |||
| * @param | |||
| * @return | |||
| */ | |||
| void wxQuestionInit(String tenantId, String questionJson); | |||
| void wxQuestionInit(String tenantId); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -3,6 +3,8 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxTemplateMsg; | |||
| import java.util.List; | |||
| public interface WxTemplateMsgService { | |||
| /** | |||
| @@ -22,6 +24,8 @@ public interface WxTemplateMsgService { | |||
| * @return | |||
| */ | |||
| PageInfo<WxTemplateMsg> listAsPage(WxTemplateMsg record, Integer pageIndex, Integer pageSize); | |||
| List<WxTemplateMsg> findList(WxTemplateMsg record); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -0,0 +1,20 @@ | |||
| package com.iformall.service; | |||
| import com.iformall.domain.po.WxWiWideInfo; | |||
| /** | |||
| * | |||
| * 迈外迪信息 | |||
| */ | |||
| public interface WxWiWideInfoService { | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxWiWideInfo record); | |||
| WxWiWideInfo findObject(WxWiWideInfo record); | |||
| } | |||
| @@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @Service | |||
| @@ -45,6 +46,11 @@ public class WxCouponSendConfigServiceImpl implements WxCouponSendConfigService | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendConfigMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public List<WxCouponSendConfig> findList(WxCouponSendConfig record) { | |||
| return wxCouponSendConfigMapper.findList(record); | |||
| } | |||
| @Override | |||
| public WxCouponSendConfig getById(Long id) { | |||
| return wxCouponSendConfigMapper.selectById(id); | |||
| @@ -0,0 +1,29 @@ | |||
| package com.iformall.service.impl; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxFlowConfig; | |||
| import com.iformall.domain.po.WxWiWideInfo; | |||
| import com.iformall.mapper.WxFlowConfigMapper; | |||
| import com.iformall.mapper.WxWiwideInfoMapper; | |||
| import com.iformall.service.WxFlowConfigService; | |||
| import com.iformall.service.WxWiWideInfoService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| @Service | |||
| public class WxFlowConfigServiceImpl implements WxFlowConfigService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxFlowConfigMapper wxFlowConfigMapper; | |||
| @Override | |||
| public List<WxFlowConfig> findList(WxFlowConfig record) { | |||
| return wxFlowConfigMapper.findList(record); | |||
| } | |||
| } | |||
| @@ -58,9 +58,11 @@ public class WxMallFloorServiceImpl implements WxMallFloorService { | |||
| List<WxMallFloor> list = wxMallFloorMapper.findList(wxMallFloor); | |||
| return new ResultData(list); | |||
| } | |||
| @Override | |||
| public void deleteByBuildingId(Long buildingId) { | |||
| wxMallFloorMapper.deleteByBuildingId(buildingId); | |||
| } | |||
| } | |||
| @@ -109,16 +109,16 @@ public class WxMallServiceImpl implements WxMallService { | |||
| @Override | |||
| public int save(WxMall record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long id = idWorker.nextId(); | |||
| record.setId(id); | |||
| } | |||
| if(StringUtils.isBlank(record.getTenantId())) { | |||
| record.setTenantId(String.valueOf(record.getId())); | |||
| } | |||
| // if (record.getId() == null) { | |||
| // //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| // final IdWorker idWorker = IdWorker.get(); | |||
| // Long id = idWorker.nextId(); | |||
| // record.setId(id); | |||
| // } | |||
| // | |||
| // if(StringUtils.isBlank(record.getTenantId())) { | |||
| // record.setTenantId(String.valueOf(record.getId())); | |||
| // } | |||
| int ret = wxMallMapper.insert(record); | |||
| @@ -294,6 +294,11 @@ public class WxMallServiceImpl implements WxMallService { | |||
| return mallList; | |||
| } | |||
| @Override | |||
| public void undateSubmall(String parentTenantId, String[] tenantIds) { | |||
| wxMallMapper.undateSubmall(parentTenantId, tenantIds); | |||
| } | |||
| private String getRedisKeyByTenantInfo(TenantEntity tenantEntity) { | |||
| StringBuilder sb = new StringBuilder(); | |||
| sb.append(Constant.TENANT_KEY_PREV).append(tenantEntity.getTenantId()); | |||
| @@ -167,11 +167,11 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { | |||
| //approved:审核通过 | |||
| //rejected:审核未通过 | |||
| String templateStatus = param.get("template_status"); | |||
| if("approving".equals(templateStatus)){ | |||
| if("approving".equalsIgnoreCase(templateStatus)){ | |||
| wxMsgModel.setStatus(2); | |||
| }else if("approved".equals(templateStatus)){ | |||
| }else if("approved".equalsIgnoreCase(templateStatus)){ | |||
| wxMsgModel.setStatus(1); | |||
| }else if("rejected".equals(templateStatus)){ | |||
| }else if("rejected".equalsIgnoreCase(templateStatus)){ | |||
| wxMsgModel.setStatus(0); | |||
| }else{ | |||
| wxMsgModel.setStatus(-1); | |||
| @@ -190,7 +190,7 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { | |||
| String success = param.get("success"); | |||
| WxMsgCallback wxMsgCallback = new WxMsgCallback(); | |||
| wxMsgCallback.setBatchNo(param.get("biz_id")); | |||
| if("true".equals(success)){ | |||
| if("true".equalsIgnoreCase(success)){ | |||
| wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SEND_SUCCESS.getCode()); | |||
| if(StringUtils.isNotBlank(param.get("out_id"))){ | |||
| WxCouponPassword couponPassword = new WxCouponPassword(); | |||
| @@ -17,6 +17,7 @@ import com.iformall.mapper.WxMsgModelMapper; | |||
| import com.iformall.service.WxMsgModelService; | |||
| import com.iformall.sms.SMSFactory; | |||
| import com.iformall.utils.*; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -74,7 +75,7 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { | |||
| String result = SMSFactory.addTemplate(secret, bid, wxMsgConfig.getPublickey(), signature, | |||
| content, wxMsgConfig.getModelnotifyurl(),EnumVerifyCode.NO.getCode().toString(), | |||
| wxMsgModel.getName(),2,wxMsgModel.getName(),wxMsgConfig.getIsAliyunSMS()); | |||
| wxMsgModel.getName(),1,wxMsgModel.getName(),wxMsgConfig.getSmsChannel()); | |||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | |||
| String ret = jsonObjectResult.get("ret").toString(); | |||
| logger.info("短信模板创建结果:" + result); | |||
| @@ -83,16 +84,24 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxMsgModel.setId(idWorker.nextId()); | |||
| wxMsgModel.setTenantId(wxMsgModel.getTenantId()); | |||
| String data = jsonObjectResult.get("data").toString(); | |||
| wxMsgModel.setModelId(Integer.valueOf(data)); | |||
| wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); | |||
| if(jsonObjectResult.get("data") != null){ | |||
| String data = jsonObjectResult.get("data").toString(); | |||
| wxMsgModel.setModelId(Integer.valueOf(data)); | |||
| } | |||
| if(jsonObjectResult.get("aliyunModelCode") != null){ | |||
| wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); | |||
| } | |||
| wxMsgModel.setCreatetime(new Date()); | |||
| wxMsgModel.setStatus(2);//审核中 | |||
| wxMsgModelMapper.insert(wxMsgModel); | |||
| } else { | |||
| String data = jsonObjectResult.get("data").toString(); | |||
| wxMsgModel.setModelId(Integer.valueOf(data)); | |||
| wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); | |||
| if(jsonObjectResult.get("data") != null){ | |||
| String data = jsonObjectResult.get("data").toString(); | |||
| wxMsgModel.setModelId(Integer.valueOf(data)); | |||
| } | |||
| if(jsonObjectResult.get("aliyunModelCode") != null){ | |||
| wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); | |||
| } | |||
| wxMsgModel.setStatus(2);//审核中 | |||
| wxMsgModelMapper.updateById(wxMsgModel); | |||
| } | |||
| @@ -37,48 +37,48 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM | |||
| WxMsgConfigMapper wxMsgConfigMapper; | |||
| @Override | |||
| public void wxMsgValidationcodeModelInit(String tenantId, WxProjectConfig wxProjectConfig) { | |||
| public void wxMsgValidationcodeModelInit(String tenantId, String signature, String emailBgImg) { | |||
| DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |||
| String nowTimestr = format.format(new Date()); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| String initSql = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) values " + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '2', '代办通知', '" + wxProjectConfig.getName() + "', '{userName}提交了一个合同待您审批,电脑登陆{page} 查看您的待办。', '" + nowTimestr + "', '1', '0', '226', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '3', '审批通知', '" + wxProjectConfig.getName() + "', '{userName}同意编号{contract}的合同审批,已呈送至{toUserName},登录{page}查看审批进度。', '" + nowTimestr + "', '1', '0', '227', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '4', '通过审批通知', '" + wxProjectConfig.getName() + "', '编号{contract}的合同已通过审批,请登录{page} 跟进后续工作。', '" + nowTimestr + "', '1', '0', '228', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '5', '驳回通知', '" + wxProjectConfig.getName() + "', '编号{contract}的合同审批被驳回,请登录{page} 查看审批明细。', '" + nowTimestr + "', '1', '0', '229', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '6', '验证码', '" + wxProjectConfig.getName() + "', '{s6}(动态验证码),请在1分钟内填写', '" + nowTimestr + "', '1', '1', '115', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '7', '账单待缴模板', '" + wxProjectConfig.getName() + "', '您当期的待缴账单为{price}元,截止日期为{date} ,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '8', '账单欠缴模板', '" + wxProjectConfig.getName() + "', '截止今日您的账单共计欠缴{price}元,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '9', '场景投放', '" + wxProjectConfig.getName() + "', '亲爱的vip,悄悄地送您一张{title},请到{app}微信小程序中使用吧!', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '商户分账账户新增通知商户', '" + wxProjectConfig.getName() + "', '您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '" + wxProjectConfig.getName() + "', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '" + wxProjectConfig.getName() + "', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '" + wxProjectConfig.getName() + "', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '" + wxProjectConfig.getName() + "', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, null);" + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '2', '代办通知', '" + signature + "', '{userName}提交了一个合同待您审批,电脑登陆{page} 查看您的待办。', '" + nowTimestr + "', '1', '0', '226', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '3', '审批通知', '" + signature + "', '{userName}同意编号{contract}的合同审批,已呈送至{toUserName},登录{page}查看审批进度。', '" + nowTimestr + "', '1', '0', '227', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '4', '通过审批通知', '" + signature + "', '编号{contract}的合同已通过审批,请登录{page} 跟进后续工作。', '" + nowTimestr + "', '1', '0', '228', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '5', '驳回通知', '" + signature + "', '编号{contract}的合同审批被驳回,请登录{page} 查看审批明细。', '" + nowTimestr + "', '1', '0', '229', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '6', '验证码', '" + signature + "', '{s6}(动态验证码),请在1分钟内填写', '" + nowTimestr + "', '1', '1', '115', null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '7', '账单待缴模板', '" + signature + "', '您当期的待缴账单为{price}元,截止日期为{date} ,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '8', '账单欠缴模板', '" + signature + "', '截止今日您的账单共计欠缴{price}元,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '9', '场景投放', '" + signature + "', '亲爱的vip,悄悄地送您一张{title},请到{app}微信小程序中使用吧!', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '商户分账账户新增通知商户', '" + signature + "', '您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '" + signature + "', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '" + signature + "', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '" + signature + "', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, null)," + | |||
| " ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '" + signature + "', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, null);" + | |||
| "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '10', '审批通过通知', '富茂', " + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \\'px\\';</script>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\\\" src=\\\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/changrong-logo.png\\\"/>\\n </header>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\\\">审批通过通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\\\">编号<span>{contract}</span>的{bustype}已经审批通过,请登录<a href=\\\"{page}\\\">{page}</a>跟进后续工作</div>\\n </div>\\n </div>\\n</body>\\n\\n</html>', " + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" + | |||
| "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '待缴账单通知', '富茂', " + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background: #fff;padding-bottom: 40px;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding-top: 56px;padding-left: 55px;\\\">待缴账单通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding:36px 55px 0;\\\">您当前的待缴账单为<span style=\\\"font-weight:400;color:rgba(200,89,98,1);margin:0 10px;\\\">{price}</span>元,截止日期为<span>{date}</span>请登录<span>您的商户端</span>小程序查看账单并缴费</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">租金账单</span>\\n <div style=\\\"margin: 0 5%;width:90%;overflow: hidden;\\\">\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单类型</div>\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单金额(元)</div>\\n <div style=\\\"width: 33.3%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">缴费时间</div>\\n </div>\\n {billList}\\n </div>\\n </div>\\n <div style=\\\"background: #fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold; font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;margin-left: 55px;padding-top: 56px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系商管负责人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" + | |||
| "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '12', '审批通知', '富茂', " + | |||
| "'<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + \\'px\\';</script>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;padding:0 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding:56px 55px 0;\\\">审批通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px;\\\"><span>{userName}</span>同意编号<span>{contract}</span>的{bustype}审批,已呈送<span>{toUserName},</span>请登录<a href=\\\"{page}\\\">{page}</a>查看审批进度</div>\\n </div>\\n </div>\\n</body>\\n\\n</html>', " + | |||
| "'" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" + | |||
| "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" + | |||
| "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '欠缴账单通知', '富茂', " + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background: #fff;padding-bottom: 40px;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">欠缴账单通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px 0;\\\">您当前的欠缴账单为<span style=\\\"font-weight:400;color:rgba(200,89,98,1);margin:0 10px;\\\">{price}</span>元,截止日期为<span>{date}</span>请登录<span>您的商户端</span>小程序查看账单并缴费</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">租金账单</span>\\n <div style=\\\"margin: 0 5%;width:90%;overflow: hidden;font-size:14px;\\\">\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单类型</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">账单金额(元)</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">缴费时间</div>\\n <div style=\\\"width: 25%;float: left;height: 60px;line-height: 60px;text-align: center;font-family:MicrosoftYaHei;color:rgba(85,85,85,1);\\\">逾期天数</div>\\n </div>\\n {billList}\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold; font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;margin-left: 55px;padding-top: 56px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系商管负责人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," + | |||
| "'" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" + | |||
| "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" + | |||
| "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| " values ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '待办通知', '富茂'," + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">待办通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding: 36px 55px 40px;\\\"><span>{name}</span><span>提交了一个{bustype}待您审批,电脑登录</span><a href=\\\"{page}\\\" target=\\\"_blank\\\">{page}</a>查看您的待办</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <div style=\\\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">申请时间:</div>\\n <div style=\\\"float: left;font-size:18px;width:cale(80%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{applyTime}</div>\\n </div>\\n <div style=\\\"overflow: hidden;\\\">\\n <div style=\\\"float: left;font-size:18px;width:cale(20%-55px);font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">申请进度:</div>\\n <div style=\\\"float: left;width:cale(80%-55px);margin-left: 55px;\\\">\\n \\n {taskList}\\n </div>\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 26px;padding: 56px 55px 0;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系申请人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');" + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');" + | |||
| "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + | |||
| " values ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '驳回通知', '富茂', " + | |||
| " '<!DOCTYPE html>\\n<html>\\n\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n <meta name=\\\"viewport\\\" content=\\\"width=device-width,initial-scale=1.0\\\">\\n <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\\n <meta name=\\\"viewport\\\" content=\\\"initial-scale=1.0, user-scalable=no\\\" />\\n <meta name=\\\"renderer\\\" content=\\\"webkit\\\">\\n <meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=edge,chrome=1\\\">\\n <title>富茂审批邮件</title>\\n <title></title>\\n <style>\\n *{\\n margin: 0;\\n padding: 0;\\n }\\n </style>\\n</head>\\n\\n<body>\\n <div id=\\\"box\\\" style=\\\"padding:80px 20%;background:#E9E7E7;min-height:100vh;\\\">\\n <header style=\\\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\\\">\\n <img style=\\\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\\\" src=\\\"{bg}\\\"/>\\n </header>\\n <content>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;\\\">审批通过通知</div>\\n <div style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);padding:36px 55px 40px;\\\">编号<span>{contract}</span>的{bustype}审批被驳回,请登录<a href=\\\"{page}\\\">{page}</a>查看审批明细</div>\\n </div>\\n <div style=\\\"height: auto;width: 100%;line-height: 40px; background: rgba(245,245,245,1);padding: 30px 0;\\\">\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">驳回人:</span>\\n <span style=\\\"display: block;float: left; width:calc(100% - 240px);font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{name}</span>\\n </div>\\n <div style=\\\"overflow: hidden;\\\">\\n <span style=\\\"display: block;float: left; font-size:18px;width:80px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">驳回原因:</span>\\n <span style=\\\"display: block;float: left;width:calc(100% - 240px); font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;\\\">{remark}</span>\\n </div>\\n </div>\\n <div style=\\\"background:#fff;\\\">\\n <div style=\\\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;padding: 56px 55px 0;margin-top: 26px;\\\">遇到问题?</div>\\n <div style=\\\"overflow: hidden;line-height: 60px;padding-bottom: 40px;\\\">\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(153,153,153,1);margin-left: 55px;\\\">请联系驳回人:</span>\\n <span style=\\\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 25px;\\\"><span>{linkName}</span><span style=\\\"margin-left: 16px; font-family:MicrosoftYaHei;font-weight:400;color:rgba(64,103,139,1);\\\">{linkPhone}</span></span>\\n </div>\\n </div>\\n </content>\\n </div>\\n</body>\\n\\n</html>'," + | |||
| " '" + nowTimestr + "', '1', null, '500', '" + wxProjectConfig.getImgUrlH() + "');"; | |||
| " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "');"; | |||
| wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql); | |||
| } | |||
| @@ -87,6 +87,11 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMsgValidationcodeModelMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public List<WxMsgValidationcodeModel> findList(WxMsgValidationcodeModel record) { | |||
| return wxMsgValidationcodeModelMapper.findList(record); | |||
| } | |||
| @Override | |||
| public WxMsgValidationcodeModel getById(String id) { | |||
| return wxMsgValidationcodeModelMapper.selectById(id); | |||
| @@ -124,7 +129,7 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM | |||
| String result = SMSFactory.addTemplate(secret, bid, wxMsgConfig.getPublickey(), signature, content, | |||
| wxMsgConfig.getVerifynotifyurl(),EnumVerifyCode.YES.getCode().toString(), | |||
| wxMsgModel.getName(),1,wxMsgModel.getName(),wxMsgConfig.getIsAliyunSMS()); | |||
| wxMsgModel.getName(),1,wxMsgModel.getName(),wxMsgConfig.getSmsChannel()); | |||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | |||
| String ret = jsonObjectResult.get("ret").toString(); | |||
| @@ -133,15 +138,24 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxMsgModel.setId(idWorker.nextId()); | |||
| wxMsgModel.setTenantId(wxMsgModel.getTenantId()); | |||
| String data = jsonObjectResult.get("data").toString(); | |||
| wxMsgModel.setModelId(Integer.valueOf(data)); | |||
| wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); | |||
| if(jsonObjectResult.get("data") != null){ | |||
| String data = jsonObjectResult.get("data").toString(); | |||
| wxMsgModel.setModelId(Integer.valueOf(data)); | |||
| } | |||
| if(jsonObjectResult.get("aliyunModelCode") != null){ | |||
| wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); | |||
| } | |||
| wxMsgModel.setCreatetime(new Date()); | |||
| wxMsgModel.setStatus(2);//审核中 | |||
| wxMsgValidationcodeModelMapper.insert(wxMsgModel); | |||
| } else { | |||
| String data = jsonObjectResult.get("data").toString(); | |||
| wxMsgModel.setModelId(Integer.valueOf(data)); | |||
| if(jsonObjectResult.get("data") != null){ | |||
| String data = jsonObjectResult.get("data").toString(); | |||
| wxMsgModel.setModelId(Integer.valueOf(data)); | |||
| } | |||
| if(jsonObjectResult.get("aliyunModelCode") != null){ | |||
| wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); | |||
| } | |||
| wxMsgModel.setStatus(2);//审核中 | |||
| wxMsgValidationcodeModelMapper.updateById(wxMsgModel); | |||
| } | |||
| @@ -610,7 +610,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| long redisStock = redisLock.getCouponStock(Long.parseLong(couponIdStr)); | |||
| if (redisStock<=0) { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券库存已为零!"); | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券库存已为零!:"+couponIdStr); | |||
| } | |||
| // 检查 优惠券 库存 | |||
| if (coupon.getRemainInventory() <= 0) { | |||
| @@ -1067,13 +1067,6 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| /// 储值卡信息添加 | |||
| if (isCard) { | |||
| //判断该transctionId是否已经存在,如果存在,则不添加 | |||
| WxCardInfo cardInfoq = new WxCardInfo(); | |||
| cardInfoq.setTransactionId(payOrder.getTransactionId()); | |||
| List<WxCardInfo> cardInfoList = wxCardInfoMapper.findList(cardInfoq); | |||
| if (null != cardInfoList && cardInfoList.size() > 0) { | |||
| //do nothing | |||
| }else { | |||
| Integer fee = 0; | |||
| WxCardInfo cardInfo = new WxCardInfo(); | |||
| cardInfo.setId(couponOrder.getId()); | |||
| @@ -1083,27 +1076,35 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| cardInfo.setSaleAmount(coupon.getSalePrice()); | |||
| cardInfo.setRemainingAmount(coupon.getPrice()); | |||
| if (!coupon.checkIsFree()) { | |||
| // 有价卡 | |||
| cardInfo.setTransactionId(payOrder.getTransactionId()); | |||
| if (payOrder.getShareAmount() != null) { | |||
| // 开启分账 | |||
| fee = payOrder.getPayAmount() - payOrder.getShareAmount(); | |||
| cardInfo.setShareFeeAmount(payOrder.getShareAmount()); | |||
| cardInfo.setRemainingShareFeeAmount(payOrder.getShareAmount()); | |||
| cardInfo.setRateAmount(payOrder.getRateAmount()); | |||
| } else { | |||
| // 未开启分账 | |||
| fee = PayUtils.getPayRate(payOrder.getPayAmount(), payAccount.getRate(), false); | |||
| Integer shareAmount = payOrder.getPayAmount() - fee; | |||
| cardInfo.setShareFeeAmount(shareAmount); | |||
| cardInfo.setRemainingShareFeeAmount(shareAmount); | |||
| if (payAccount.getRealRate() != null) { | |||
| int iRealChargeFee = PayUtils.getPayRate(payOrder.getPayAmount(), payAccount.getRealRate(), true); | |||
| if (fee > iRealChargeFee) { | |||
| cardInfo.setRateAmount(fee - iRealChargeFee); | |||
| } | |||
| } | |||
| } | |||
| //判断该transctionId是否已经存在,如果存在,则不添加 | |||
| WxCardInfo cardInfoq = new WxCardInfo(); | |||
| cardInfoq.setTransactionId(payOrder.getTransactionId()); | |||
| List<WxCardInfo> cardInfoList = wxCardInfoMapper.findList(cardInfoq); | |||
| if (null != cardInfoList && cardInfoList.size() > 0) { | |||
| //do nothing | |||
| }else { | |||
| // 有价卡 | |||
| cardInfo.setTransactionId(payOrder.getTransactionId()); | |||
| if (payOrder.getShareAmount() != null) { | |||
| // 开启分账 | |||
| fee = payOrder.getPayAmount() - payOrder.getShareAmount(); | |||
| cardInfo.setShareFeeAmount(payOrder.getShareAmount()); | |||
| cardInfo.setRemainingShareFeeAmount(payOrder.getShareAmount()); | |||
| cardInfo.setRateAmount(payOrder.getRateAmount()); | |||
| } else { | |||
| // 未开启分账 | |||
| fee = PayUtils.getPayRate(payOrder.getPayAmount(), payAccount.getRate(), false); | |||
| Integer shareAmount = payOrder.getPayAmount() - fee; | |||
| cardInfo.setShareFeeAmount(shareAmount); | |||
| cardInfo.setRemainingShareFeeAmount(shareAmount); | |||
| if (payAccount.getRealRate() != null) { | |||
| int iRealChargeFee = PayUtils.getPayRate(payOrder.getPayAmount(), payAccount.getRealRate(), true); | |||
| if (fee > iRealChargeFee) { | |||
| cardInfo.setRateAmount(fee - iRealChargeFee); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } else { | |||
| // 免费卡 | |||
| cardInfo.setShareFeeAmount(0); | |||
| @@ -1130,7 +1131,6 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| } | |||
| wxCardInfoMapper.insert(cardInfo); | |||
| } | |||
| } | |||
| return couponOrder; | |||
| } | |||
| @@ -83,12 +83,11 @@ public class WxPayAccountBillServiceImpl implements WxPayAccountBillService { | |||
| public void deleteById(Long id) { | |||
| wxPayAccountBillMapper.deleteById(id); | |||
| } | |||
| @Override | |||
| public WxPayAccountBill getByTenantId(String tenantId) { | |||
| return wxPayAccountBillMapper.getByTenantId(tenantId); | |||
| } | |||
| } | |||
| @@ -65,12 +65,11 @@ public class WxPayAccountServiceImpl implements WxPayAccountService { | |||
| public void deleteById(Long id) { | |||
| wxPayAccountMapper.deleteById(id); | |||
| } | |||
| @Override | |||
| public WxPayAccount getByTenantId(String tenantId) { | |||
| return wxPayAccountMapper.getByTenantId(tenantId); | |||
| } | |||
| } | |||
| @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.PasswordHelper; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| @@ -30,6 +31,8 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { | |||
| @Autowired | |||
| WxMallBuildingService wxMallBuildingService; | |||
| @Autowired | |||
| WxMallFloorService wxMallFloorService; | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @Autowired | |||
| WxPayAccountBillService wxPayAccountBillService; | |||
| @@ -42,6 +45,12 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { | |||
| @Autowired | |||
| MallRoleService mallRoleService; | |||
| @Autowired | |||
| MallUserRoleService mallUserRoleService; | |||
| @Autowired | |||
| MallPermissionService mallPermissionService; | |||
| @Autowired | |||
| MallRolePermissionService mallRolePermissionService; | |||
| @Autowired | |||
| WxMsgConfigService wxMsgConfigService; | |||
| @Autowired | |||
| WxParkService wxParkService; | |||
| @@ -55,6 +64,8 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { | |||
| WxMsgValidationcodeModelService wxMsgValidationcodeModelService; | |||
| @Autowired | |||
| WxFlowService wxFlowService; | |||
| @Autowired | |||
| MallUserInfoService userInfoService; | |||
| @Override | |||
| @Transactional | |||
| @@ -102,21 +113,10 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { | |||
| //# wuguoqiang@iformall.com | |||
| // # 19. wx_question | |||
| logger.info("wx_question---------------------init--start"); | |||
| String questionJson = "[{\"flag\": \"single\", \"title\": \"请问您的职业是?\", \"answers\": [{\"id\": \"59\", \"name\": \"学生\"}, {\"id\": \"60\", \"name\": \"上班族\"}, {\"id\": \"61\", \"name\": \"企业高管\"}, {\"id\": \"62\", \"name\": \"个体户\"}, {\"id\": \"63\", \"name\": \"自由职业\"}, {\"id\": \"64\", \"name\": \"其他\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"请问您目前的学历是?\", \"answers\": [{\"id\": \"34\", \"name\": \"高中\"}, {\"id\": \"35\", \"name\": \"大专\"}, {\"id\": \"36\", \"name\": \"本科\"}, {\"id\": \"37\", \"name\": \"硕士及以上\"}, {\"id\": \"38\", \"name\": \"博士及以上\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"请问您是如何到达商场的?\", \"answers\": [{\"id\": \"127\", \"name\": \"走路\"}, {\"id\": \"128\", \"name\": \"乘车\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"请问您和父母一起居住吗?\", \"answers\": [{\"id\": \"65\", \"name\": \"不是,我已租房\"}, {\"id\": \"66\", \"name\": \"是,我已购房\"}, {\"id\": \"67\", \"name\": \"不是,我和室友住宿舍\"}]}," | |||
| + "{\"flag\": \"multi\", \"title\": \"请问您的孩子愿意与您一起?\", \"answers\": [{\"id\": \"57\", \"name\": \"逛街\"}, {\"id\": \"57\", \"name\": \"玩乐\"}, {\"id\": \"57\", \"name\": \"阅读\"}, {\"id\": \"55\", \"name\": \"我还没有宝宝\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"主人,您结婚了吗?\", \"answers\": [{\"id\": \"56\", \"name\": \"结婚啦\"}, {\"id\": \"55\", \"name\": \"还没有哦\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"您是?\", \"answers\": [{\"id\": \"42\", \"name\": \"贫下中农\"}, {\"id\": \"43\", \"name\": \"小康家庭\"}, {\"id\": \"44\", \"name\": \"中产家庭\"}, {\"id\": \"45\", \"name\": \"富裕家庭\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"请问您是?\", \"answers\": [{\"id\": \"104\", \"name\": \"实惠型消费\"}, {\"id\": \"105\", \"name\": \"享乐型消费\"}, {\"id\": \"106\", \"name\": \"品质型消费\"}]}," | |||
| + "{\"flag\": \"multi\", \"title\": \"请问您喜欢哪种口味的食物?\", \"answers\": [{\"id\": \"92\", \"name\": \"轻餐\"}, {\"id\": \"93\", \"name\": \"小吃快餐\"}, {\"id\": \"94\", \"name\": \"西餐\"}, {\"id\": \"95\", \"name\": \"日料中餐甜点\"}, {\"id\": \"96\", \"name\": \"火锅\"}]}," | |||
| + "{\"flag\": \"multi\", \"title\": \"请问您的爱好是?\", \"answers\": [{\"id\": \"121\", \"name\": \"时尚\"}, {\"id\": \"122\", \"name\": \"旅游\"}, {\"id\": \"123\", \"name\": \"运动\"}, {\"id\": \"124\", \"name\": \"电玩\"}, {\"id\": \"125\", \"name\": \"看书\"}, {\"id\": \"126\", \"name\": \"其他\"}]}]"; | |||
| wxQuestionService.wxQuestionInit(tenantId,questionJson); | |||
| wxQuestionService.wxQuestionInit(tenantId); | |||
| //# 20. wx_msg_validationcode_model, 数据重新一下 | |||
| wxMsgValidationcodeModelService.wxMsgValidationcodeModelInit(tenantId, wxProjectConfig); | |||
| wxMsgValidationcodeModelService.wxMsgValidationcodeModelInit(tenantId, wxProjectConfig.getName(), wxProjectConfig.getImgUrlH()); | |||
| //wx_flow_config | |||
| wxFlowService.wxFlowConfigInit(tenantId); | |||
| //初始化成功 删除标记 | |||
| @@ -129,5 +129,119 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { | |||
| } | |||
| @Override | |||
| @Transactional | |||
| public void initMall(WxMall wxMall) { | |||
| if(wxMall.getId() == null){ | |||
| wxMall.setTenantId("-1"); | |||
| wxMallService.save(wxMall); | |||
| wxMall.setTenantId(wxMall.getId().toString()); | |||
| // 2. wx_coupon_send_config | |||
| wxCouponSendConfigService.wxCouponSendConfigInit(wxMall.getTenantId()); | |||
| //# 积分成长值设置wx_score_rules | |||
| wxScoreRulesService.wxScoreRulesInit(wxMall.getTenantId()); | |||
| //# 17. wx_template_msg | |||
| //# 设置核销成功通知,核销失败通知 | |||
| wxTemplateMsgService.wxTemplateMsgInit(wxMall.getTenantId()); | |||
| // # 19. wx_question | |||
| wxQuestionService.wxQuestionInit(wxMall.getTenantId()); | |||
| //# 20. wx_msg_validationcode_model, 数据重新一下 | |||
| wxMsgValidationcodeModelService.wxMsgValidationcodeModelInit(wxMall.getTenantId(), wxMall.getName(), wxMall.getImgUrlH()); | |||
| //wx_flow_config | |||
| wxFlowService.wxFlowConfigInit(wxMall.getTenantId()); | |||
| } | |||
| wxMallService.update(wxMall); | |||
| } | |||
| @Override | |||
| @Transactional | |||
| public void initBuilding(List<WxMallBuilding> wxMallBuildings) { | |||
| for (WxMallBuilding wxMallBuilding:wxMallBuildings) { | |||
| wxMallBuilding.setMallId(Long.parseLong(wxMallBuilding.getTenantId())); | |||
| if(wxMallBuilding.getFloors() != null && wxMallBuilding.getFloors().size() > 0){ | |||
| wxMallBuilding.setFloorNumber(wxMallBuilding.getFloors().size()); | |||
| wxMallBuildingService.saveOrUpdate(wxMallBuilding); | |||
| for (WxMallFloor wxMallFloor:wxMallBuilding.getFloors()) { | |||
| wxMallFloor.setTenantId(wxMallBuilding.getTenantId()); | |||
| wxMallFloor.setParentTenantId(wxMallBuilding.getParentTenantId()); | |||
| wxMallFloor.setMallId(Long.parseLong(wxMallBuilding.getTenantId())); | |||
| wxMallFloor.setBuildingId(wxMallBuilding.getId()); | |||
| wxMallFloor.setBackgroundImg(Constant.floor_back_img); | |||
| wxMallFloorService.saveOrUpdate(wxMallFloor); | |||
| } | |||
| }else{ | |||
| wxMallBuilding.setFloorNumber(0); | |||
| wxMallBuildingService.saveOrUpdate(wxMallBuilding); | |||
| wxMallFloorService.deleteByBuildingId(wxMallBuilding.getId()); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| @Transactional | |||
| public void initPayAccount(WxPayAccount wxPayAccount) { | |||
| wxPayAccountService.saveOrUpdate(wxPayAccount); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxPayAccount.getTenantId()); | |||
| if(wxPayAccountBill == null){ | |||
| wxPayAccountBill = new WxPayAccountBill(); | |||
| wxPayAccountBill.setTenantId(wxPayAccount.getTenantId()); | |||
| } | |||
| wxPayAccountBill.setMchId(wxPayAccount.getMchId()); | |||
| wxPayAccountBill.setSubMchId(wxPayAccount.getSubMchId()); | |||
| wxPayAccountBill.setApiKey(wxPayAccount.getApiKey()); | |||
| wxPayAccountBill.setNotifyUrl(wxPayAccount.getNotifyUrl()); | |||
| wxPayAccountBill.setCertPath(wxPayAccount.getCertPath()); | |||
| wxPayAccountBill.setType(wxPayAccount.getType()); | |||
| wxPayAccountBill.setShare(!(wxPayAccount.getShare() == 0)); | |||
| wxPayAccountBill.setRate(wxPayAccount.getRate()); | |||
| wxPayAccountBill.setRealRate(wxPayAccount.getRealRate()); | |||
| wxPayAccountBillService.saveOrUpdate(wxPayAccountBill); | |||
| WxAppinfo wxAppinfo = new WxAppinfo(); | |||
| wxAppinfo.setTenantId(wxPayAccount.getTenantId()); | |||
| List<WxAppinfo> list = wxAppinfoService.getList(wxAppinfo); | |||
| if(list != null && list.size() > 0){ | |||
| for (WxAppinfo wa:list) { | |||
| wa.setPayId(wxPayAccount.getId()); | |||
| wa.setPayBillId(wxPayAccountBill.getId()); | |||
| wxAppinfoService.saveOrUpdate(wa); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| @Transactional | |||
| public void initUserInfo(MallUserInfo userInfo) { | |||
| userInfoService.saveOrUpdate(userInfo); | |||
| //创建角色 | |||
| MallRole mallRole = new MallRole(); | |||
| mallRole.setTenantId(userInfo.getTenantId()); | |||
| mallRole.setName("系统管理员"); | |||
| mallRole.setAvailable("0"); | |||
| mallRoleService.saveOrUpdate(mallRole); | |||
| //给角色赋权限 | |||
| MallPermission mallPermission=new MallPermission(); | |||
| List<MallPermission> list = mallPermissionService.getList(mallPermission); | |||
| for(MallPermission m : list){ | |||
| MallRolePermission mallRolePermission = new MallRolePermission(); | |||
| mallRolePermission.setTenantId(userInfo.getTenantId()); | |||
| mallRolePermission.setRoleId(mallRole.getId()); | |||
| mallRolePermission.setPermissionId(m.getId()); | |||
| mallRolePermissionService.saveOrUpdate(mallRolePermission); | |||
| } | |||
| //给帐号加角色 | |||
| MallUserRole mallUserRole = new MallUserRole(); | |||
| mallUserRole.setUid(userInfo.getId()); | |||
| mallUserRole.setRoleId(mallRole.getId()); | |||
| mallUserRoleService.saveOrUpdate(mallUserRole); | |||
| } | |||
| @Override | |||
| public void initSubmall(String parentTenantId, String[] tenantIds) { | |||
| wxMallService.undateSubmall(parentTenantId,tenantIds); | |||
| /** | |||
| * 初始化数据 | |||
| */ | |||
| } | |||
| } | |||
| @@ -34,7 +34,17 @@ public class WxQuestionServiceImpl implements WxQuestionService { | |||
| WxQuestionLogMapper wxQuestionLogMapper; | |||
| @Override | |||
| public void wxQuestionInit(String tenantId, String questionJson) { | |||
| public void wxQuestionInit(String tenantId) { | |||
| String questionJson = "[{\"flag\": \"single\", \"title\": \"请问您的职业是?\", \"answers\": [{\"id\": \"59\", \"name\": \"学生\"}, {\"id\": \"60\", \"name\": \"上班族\"}, {\"id\": \"61\", \"name\": \"企业高管\"}, {\"id\": \"62\", \"name\": \"个体户\"}, {\"id\": \"63\", \"name\": \"自由职业\"}, {\"id\": \"64\", \"name\": \"其他\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"请问您目前的学历是?\", \"answers\": [{\"id\": \"34\", \"name\": \"高中\"}, {\"id\": \"35\", \"name\": \"大专\"}, {\"id\": \"36\", \"name\": \"本科\"}, {\"id\": \"37\", \"name\": \"硕士及以上\"}, {\"id\": \"38\", \"name\": \"博士及以上\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"请问您是如何到达商场的?\", \"answers\": [{\"id\": \"127\", \"name\": \"走路\"}, {\"id\": \"128\", \"name\": \"乘车\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"请问您和父母一起居住吗?\", \"answers\": [{\"id\": \"65\", \"name\": \"不是,我已租房\"}, {\"id\": \"66\", \"name\": \"是,我已购房\"}, {\"id\": \"67\", \"name\": \"不是,我和室友住宿舍\"}]}," | |||
| + "{\"flag\": \"multi\", \"title\": \"请问您的孩子愿意与您一起?\", \"answers\": [{\"id\": \"57\", \"name\": \"逛街\"}, {\"id\": \"57\", \"name\": \"玩乐\"}, {\"id\": \"57\", \"name\": \"阅读\"}, {\"id\": \"55\", \"name\": \"我还没有宝宝\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"主人,您结婚了吗?\", \"answers\": [{\"id\": \"56\", \"name\": \"结婚啦\"}, {\"id\": \"55\", \"name\": \"还没有哦\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"您是?\", \"answers\": [{\"id\": \"42\", \"name\": \"贫下中农\"}, {\"id\": \"43\", \"name\": \"小康家庭\"}, {\"id\": \"44\", \"name\": \"中产家庭\"}, {\"id\": \"45\", \"name\": \"富裕家庭\"}]}," | |||
| + "{\"flag\": \"single\", \"title\": \"请问您是?\", \"answers\": [{\"id\": \"104\", \"name\": \"实惠型消费\"}, {\"id\": \"105\", \"name\": \"享乐型消费\"}, {\"id\": \"106\", \"name\": \"品质型消费\"}]}," | |||
| + "{\"flag\": \"multi\", \"title\": \"请问您喜欢哪种口味的食物?\", \"answers\": [{\"id\": \"92\", \"name\": \"轻餐\"}, {\"id\": \"93\", \"name\": \"小吃快餐\"}, {\"id\": \"94\", \"name\": \"西餐\"}, {\"id\": \"95\", \"name\": \"日料中餐甜点\"}, {\"id\": \"96\", \"name\": \"火锅\"}]}," | |||
| + "{\"flag\": \"multi\", \"title\": \"请问您的爱好是?\", \"answers\": [{\"id\": \"121\", \"name\": \"时尚\"}, {\"id\": \"122\", \"name\": \"旅游\"}, {\"id\": \"123\", \"name\": \"运动\"}, {\"id\": \"124\", \"name\": \"电玩\"}, {\"id\": \"125\", \"name\": \"看书\"}, {\"id\": \"126\", \"name\": \"其他\"}]}]"; | |||
| WxQuestion wxQuestion = new WxQuestion(); | |||
| wxQuestion.setTenantId(tenantId); | |||
| JSONArray jsonObject = JSON.parseArray(questionJson); | |||
| @@ -450,7 +450,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| private int bindCarAddScore(WxCUserCar userCar) { | |||
| int addScoreNumber = 0; | |||
| // 1. 获取score rules | |||
| WxScoreRules scoreRules = getScoreRules(userCar.getTenantInfo()); | |||
| WxScoreRules scoreRules = getScoreRules(userCar); | |||
| // 2. 获取成长值 | |||
| addScoreNumber = scoreRules.getRule(EnumScoreType.BIND_CAR,WxScoreRules.SCORE); | |||
| @@ -459,7 +459,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| updateScore(userCar.getCUserId(), addScoreNumber); | |||
| // 4. 记录历史 | |||
| recordScoreHistory(addScoreNumber, userCar.getTenantInfo(), userCar.getCUserId(), EnumScoreType.BIND_CAR); | |||
| recordScoreHistory(addScoreNumber, userCar, userCar.getCUserId(), EnumScoreType.BIND_CAR); | |||
| return addScoreNumber; | |||
| } | |||
| @@ -552,7 +552,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| } | |||
| // 2. 记录历史 | |||
| recordReduceScoreHistory(scoreNum, reason, userInfo.getTenantInfo(), userInfo.getId(), EnumScoreType.MEM_REDUCE); | |||
| recordReduceScoreHistory(scoreNum, reason, userInfo, userInfo.getId(), EnumScoreType.MEM_REDUCE); | |||
| return score; | |||
| } | |||
| @@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @Service | |||
| public class WxTemplateMsgServiceImpl implements WxTemplateMsgService { | |||
| @@ -48,6 +49,11 @@ public class WxTemplateMsgServiceImpl implements WxTemplateMsgService { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxTemplateMsgMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public List<WxTemplateMsg> findList(WxTemplateMsg record) { | |||
| return wxTemplateMsgMapper.findList(record); | |||
| } | |||
| @Override | |||
| public WxTemplateMsg getById(Long id) { | |||
| return wxTemplateMsgMapper.selectById(id); | |||
| @@ -0,0 +1,40 @@ | |||
| package com.iformall.service.impl; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxWiWideInfo; | |||
| import com.iformall.mapper.WxWiwideInfoMapper; | |||
| import com.iformall.service.WxWiWideInfoService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| @Service | |||
| public class WxWiWideInfoServiceImpl implements WxWiWideInfoService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxWiwideInfoMapper wxWiwideInfoMapper; | |||
| @Override | |||
| public void saveOrUpdate(WxWiWideInfo record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxWiwideInfoMapper.insert(record); | |||
| } else { | |||
| wxWiwideInfoMapper.updateById(record); | |||
| } | |||
| } | |||
| @Override | |||
| public WxWiWideInfo findObject(WxWiWideInfo record) { | |||
| return wxWiwideInfoMapper.selectOne(new QueryWrapper(record)); | |||
| } | |||
| } | |||
| @@ -101,9 +101,14 @@ public class SendCallBackSmsServiceImpl implements MsgSendService { | |||
| return; | |||
| } | |||
| */ | |||
| String outId = ""; | |||
| try { | |||
| outId = Long.toString(record.getId()); | |||
| }catch(Exception e){} | |||
| String result = SMSFactory.sendSms(secret, bid, publickey, phone, signature, msg, notifyUrl, | |||
| EnumVerifyCode.NO.getCode().toString(), modelId, | |||
| null,wxMsgModel.getModelCode(),Long.toString(record.getId()),wxMsgConfig.getIsAliyunSMS()); | |||
| null,wxMsgModel.getModelCode(),outId,wxMsgConfig.getSmsChannel()); | |||
| @@ -102,7 +102,7 @@ public class SendSmsServiceImpl implements MsgSendService { | |||
| String result = SMSFactory.sendSms(secret, bid, publickey, phone, signature, msg, notifyUrl, | |||
| EnumVerifyCode.YES.getCode().toString(), modelId, | |||
| JSON.toJSONString(record.getDynamicContentMap()),wxMsgValidationcodeModel.getModelCode(), | |||
| id,wxMsgConfig.getIsAliyunSMS()); | |||
| id,wxMsgConfig.getSmsChannel()); | |||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | |||
| String ret = jsonObjectResult.get("ret").toString(); | |||
| String batchNo = jsonObjectResult.get("data").toString(); | |||
| @@ -7,7 +7,7 @@ package com.iformall.sms; | |||
| public enum EnumSMSChannel { | |||
| ALIYUN(11, "ALIYUN"), | |||
| WIWIDE(1,"WIWIDE"); | |||
| WIWIDE(0,"WIWIDE"); | |||
| public static EnumSMSChannel getEnum(Integer code) { | |||
| for (EnumSMSChannel value : values()) { | |||
| @@ -11,6 +11,7 @@ import com.iformall.sms.SMSExcutor; | |||
| import com.iformall.sms.SMSResult; | |||
| import com.iformall.sms.aliyun.bean.*; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| @@ -30,11 +31,13 @@ public class AliyunSMS implements SMSExcutor { | |||
| sms.setPhoneNumbers(phone); | |||
| sms.setTemplateParam(templateParam); | |||
| sms.setTemplateCode(templateCode); | |||
| sms.setOutId(outId); | |||
| if(StringUtils.isNotBlank(outId)){ | |||
| sms.setOutId(outId); | |||
| } | |||
| sms.setSignName(signature); | |||
| Result result = this.sendSms(sms); | |||
| if(result.getSendSmsResponse().getCode() != null | |||
| && result.getSendSmsResponse().getCode().equals("ok")){ | |||
| && result.getSendSmsResponse().getCode().equalsIgnoreCase("ok")){ | |||
| SMSResult.setRet("1"); | |||
| SMSResult.setData(result.getSendSmsResponse().getBizId()); | |||
| } | |||
| @@ -50,7 +53,7 @@ public class AliyunSMS implements SMSExcutor { | |||
| smsTemplate.setTemplateType(templateType); | |||
| smsTemplate.setRemark(remark); | |||
| AddSmsTemplateResponse addSmsTemplateResponse = this.addSmsTemplate(smsTemplate); | |||
| if(addSmsTemplateResponse.getCode() != null && addSmsTemplateResponse.getCode().equals("ok")){ | |||
| if(addSmsTemplateResponse.getCode() != null && addSmsTemplateResponse.getCode().equalsIgnoreCase("ok")){ | |||
| SMSResult.setRet("1"); | |||
| SMSResult.setAliyunModelCode(addSmsTemplateResponse.getTemplateCode()); | |||
| } | |||
| @@ -97,6 +100,7 @@ public class AliyunSMS implements SMSExcutor { | |||
| log.error("添加签名发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| } | |||
| log.info("添加签名-----" + response.getCode() + "----" + response.getMessage()); | |||
| return response; | |||
| } | |||
| @@ -115,6 +119,7 @@ public class AliyunSMS implements SMSExcutor { | |||
| log.error("删除签名发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| } | |||
| log.info("删除签名-----" + response.getCode() + "----" + response.getMessage()); | |||
| return response; | |||
| } | |||
| @@ -135,6 +140,7 @@ public class AliyunSMS implements SMSExcutor { | |||
| log.error("修改签名发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| } | |||
| log.info("修改签名----" + response.getCode() + "----" + response.getMessage()); | |||
| return response; | |||
| } | |||
| @@ -153,6 +159,7 @@ public class AliyunSMS implements SMSExcutor { | |||
| log.error("查询签名发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| } | |||
| log.info("查询签名----" + response.getCode() + "----" + response.getMessage()); | |||
| return response; | |||
| } | |||
| @@ -171,9 +178,10 @@ public class AliyunSMS implements SMSExcutor { | |||
| try { | |||
| response = acsClient.getAcsResponse(request); | |||
| } catch (ClientException e) { | |||
| log.error("添加签名发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| log.error(" 添加模板发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| } | |||
| log.info(" 添加模板----" + response.getCode() + "----" + response.getMessage()); | |||
| return response; | |||
| } | |||
| @@ -189,9 +197,10 @@ public class AliyunSMS implements SMSExcutor { | |||
| try { | |||
| response = acsClient.getAcsResponse(request); | |||
| } catch (ClientException e) { | |||
| log.error("删除签名发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| log.error("删除模板发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| } | |||
| log.info(" 删除模板----" + response.getCode() + "----" + response.getMessage()); | |||
| return response; | |||
| } | |||
| @@ -211,9 +220,10 @@ public class AliyunSMS implements SMSExcutor { | |||
| try { | |||
| response = acsClient.getAcsResponse(request); | |||
| } catch (ClientException e) { | |||
| log.error("修改签名发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| log.error("修改模板发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| } | |||
| log.info(" 修改模板----" + response.getCode() + "----" + response.getMessage()); | |||
| return response; | |||
| } | |||
| @@ -229,9 +239,10 @@ public class AliyunSMS implements SMSExcutor { | |||
| try { | |||
| response = acsClient.getAcsResponse(request); | |||
| } catch (ClientException e) { | |||
| log.error("查询签名发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| log.error("查询模板发生错误。错误代码是 [{}],错误消息是 [{}],错误请求ID是 [{}],错误Msg是 [{}],错误类型是 [{}]", | |||
| e.getErrCode(), e.getMessage(), e.getRequestId(), e.getErrMsg(), e.getErrorType()); | |||
| } | |||
| log.info(" 查询模板----" + response.getCode() + "----" + response.getMessage()); | |||
| return response; | |||
| } | |||
| @@ -103,14 +103,14 @@ public class CreditUtil { | |||
| if(Objects.isNull(wxCUserBasicInfo.getScoreDate())) { | |||
| //设置过生日的用户 | |||
| if (Objects.nonNull(wxCUserBasicInfo.getBirthdate()) && DateUtils.birthdaysBetween(wxCUserBasicInfo.getBirthdate()) == 0) { | |||
| birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo.getTenantInfo(), wxScoreRulesService); | |||
| birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo, wxScoreRulesService); | |||
| } else { | |||
| log.info("积分倍率计算:未设置生日或生日条件未匹配={}", wxCUserBasicInfo.getScoreDate()); | |||
| } | |||
| } else { | |||
| //发过生日券的用户或者享受过生日积分倍率的用户 | |||
| if (Objects.nonNull(wxCUserBasicInfo.getScoreDate()) && DateUtils.birthdaysBetween(wxCUserBasicInfo.getScoreDate()) == 0) { | |||
| birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo.getTenantInfo(), wxScoreRulesService); | |||
| birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo, wxScoreRulesService); | |||
| } | |||
| } | |||
| @@ -133,6 +133,16 @@ public class RedisLock { | |||
| } | |||
| public boolean hasCouponStockCache(long couponId) { | |||
| return stringRedisTemplate.hasKey(EnumCacheKey.COUPON_STOCK.getMessage()+String.valueOf(couponId)); | |||
| //如果库存为零,这个时候同步一下数据库的库存,因为有的时候系统报错事务会胡滚,但是redis扣减库存执行了,所以为0的时候,跟数据库的同步一下 | |||
| boolean booleanHasCache = stringRedisTemplate.hasKey(EnumCacheKey.COUPON_STOCK.getMessage()+String.valueOf(couponId)); | |||
| if (booleanHasCache) { | |||
| long stockvalue = getCouponStock(couponId); | |||
| if (stockvalue > 0) { | |||
| return true; | |||
| }else { | |||
| return false; | |||
| } | |||
| } | |||
| return false; | |||
| } | |||
| } | |||
| @@ -175,9 +175,12 @@ | |||
| <sql id="dynamicWhereConditionsVo"> | |||
| where 1 = 1 | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != boxId "> | |||
| and `box_id` = #{boxId} | |||
| @@ -27,9 +27,12 @@ | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != boxId "> | |||
| and `box_id` = #{boxId} | |||
| @@ -106,9 +109,12 @@ | |||
| <sql id="dynamicWhereConditionsVo"> | |||
| where 1 = 1 | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != boxId "> | |||
| and `box_id` = #{boxId} | |||
| @@ -232,9 +238,12 @@ | |||
| tenant_id | |||
| FROM kw_meter_data | |||
| where 1 = 1 | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != meterId "> | |||
| and `meter_id` = #{meterId} | |||
| </if> | |||
| @@ -152,8 +152,11 @@ | |||
| <include refid="allSafeColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != bopenId "> | |||
| and `bopen_id`=#{bopenId} | |||
| @@ -174,8 +177,11 @@ | |||
| update mall_user_info | |||
| set `web_open_id` = null | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != username "> | |||
| and username=#{username} | |||
| @@ -189,8 +195,11 @@ | |||
| update mall_user_info | |||
| set `web_open_id` = null, `bopen_id` = null | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != username "> | |||
| and username=#{username} | |||
| @@ -205,8 +214,11 @@ | |||
| <include refid="allColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != phone "> | |||
| and `phone`=#{phone} | |||
| @@ -83,9 +83,12 @@ | |||
| select a.id,a.cover_img,a.title,a.activity_start_time,a.activity_end_time,aj.`status` | |||
| from wx_activity_join aj left join wx_activity a on aj.activity_id=a.id | |||
| where aj.user_id=#{userId} | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and aj.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and aj.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != statusStr and ''!=statusStr"> | |||
| and aj.`status` in (${statusStr}) and a.`status`=2 | |||
| </if> | |||
| @@ -278,7 +278,7 @@ | |||
| </select> | |||
| <update id="insertBillAction"> | |||
| insert into wx_bill_action(id,user_name,`action`,bill_id,details,tenant_id) | |||
| insert into wx_bill_action(id,user_name,`action`,bill_id,details,tenant_id,parent_tenant_id) | |||
| select | |||
| (select unix_timestamp(now()) + CEILING(RAND()*90000+10000) + CEILING(RAND()*90000+10000) + CEILING(RAND()*90000+10000)) id | |||
| ,'系统端' user_name,7 `action`,b.id bill_id, | |||
| @@ -292,7 +292,7 @@ | |||
| b.owe * (c.late_pay_ratio) /10000 | |||
| ,2) | |||
| ) | |||
| ,'元') details,b.tenant_id | |||
| ,'元') details,b.tenant_id,b.parent_tenant_id | |||
| from wx_bill_property b left join wx_property_contract c on(b.`property_contract_id`=c.id) | |||
| where c.late_pay_ratio >0 | |||
| and DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) >0 | |||