diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java index fc1d3d5e6..33a8dde75 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java @@ -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 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 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/building") + @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 map = new HashMap(); + WxMall wxMall = wxMallService.getById(id); + map.put("wxMall",wxMall); + List subWxMall = wxMallService.getSubByParentTenantId(wxMall.getTenantId()); + map.put("subWxMall",subWxMall); + WxCouponSendConfig wxCouponSendConfig = new WxCouponSendConfig(){{ + setTenantId(wxMall.getTenantId()); + }}; + List wxCouponSendConfigList = wxCouponSendConfigService.findList(wxCouponSendConfig); + map.put("wxCouponSendConfigList",wxCouponSendConfigList); + WxScoreRules wxScoreRules = new WxScoreRules(){{ + setTenantId(wxMall.getTenantId()); + }}; + List wxScoreRulesList = wxScoreRulesService.findList(wxScoreRules); + map.put("wxScoreRulesList",wxScoreRulesList); + WxTemplateMsg wxTemplateMsg = new WxTemplateMsg(){{ + setTenantId(wxMall.getTenantId()); + }}; + List wxTemplateMsgList = wxTemplateMsgService.findList(wxTemplateMsg); + map.put("wxTemplateMsgList",wxTemplateMsgList); + WxQuestion wxQuestion = new WxQuestion(){{ + setTenantId(wxMall.getTenantId()); + }}; + List wxQuestionList = wxQuestionService.findList(wxQuestion); + map.put("wxQuestionList",wxQuestionList); + WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(){{ + setTenantId(wxMall.getTenantId()); + }}; + List wxMsgValidationcodeModelList = wxMsgValidationcodeModelService.findList(wxMsgValidationcodeModel); + map.put("wxMsgValidationcodeModelList",wxMsgValidationcodeModelList); + WxFlowConfig wxFlowConfig = new WxFlowConfig(){{ + setTenantId(wxMall.getTenantId()); + }}; + List 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 wxAppinfoList = wxAppinfoService.getList(wxAppinfo); + map.put("wxAppinfoList",wxAppinfoList); + MallUserInfo mallUserInfo = new MallUserInfo() {{ + setTenantId(wxMall.getTenantId()); + }}; + List 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 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); + } + } + + } diff --git a/mallinkAdmin/src/main/resources/db/migration/V202007131031__GROUP__ADD_001.sql b/mallinkAdmin/src/main/resources/db/migration/V202007131031__GROUP__ADD_001.sql index 5bf81edb6..23d729270 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202007131031__GROUP__ADD_001.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202007131031__GROUP__ADD_001.sql @@ -1,2 +1,5 @@ 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`; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxMallFloorMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxMallFloorMapper.java index 82a63bd92..394038048 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxMallFloorMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxMallFloorMapper.java @@ -7,10 +7,6 @@ import com.iformall.domain.po.WxMallFloor; public interface WxMallFloorMapper extends CommonMapper { List findList(WxMallFloor wxMallFloor); - - - - - + int deleteByBuildingId(Long buildingId); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxMallMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxMallMapper.java index 68fdac77f..aae3ca71a 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxMallMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxMallMapper.java @@ -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 { String queryMenusByTenantInfo(WxMall wxMall); + void undateSubmall(@Param(value = "parentTenantId")String parentTenantId, @Param(value = "tenantIds")String[] tenantIds); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxPayAccountBillMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxPayAccountBillMapper.java index deb9f46af..e286f3510 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxPayAccountBillMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxPayAccountBillMapper.java @@ -11,10 +11,7 @@ import java.util.List; public interface WxPayAccountBillMapper extends CommonMapper { List findList(WxPayAccountBill wxPayAccount); - - - - - + + WxPayAccountBill getByTenantId(String tenantId); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxPayAccountMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxPayAccountMapper.java index 252940dd4..2819adeee 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxPayAccountMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxPayAccountMapper.java @@ -7,10 +7,7 @@ import com.iformall.domain.po.WxPayAccount; public interface WxPayAccountMapper extends CommonMapper { List findList(WxPayAccount wxPayAccount); - - - - - + + WxPayAccount getByTenantId(String tenantId); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponSendConfigService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponSendConfigService.java index 220221173..47f287ab0 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponSendConfigService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponSendConfigService.java @@ -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 listAsPage(WxCouponSendConfig record, Integer pageIndex, Integer pageSize); + + List findList(WxCouponSendConfig record); /** * 根据Id获得实体 diff --git a/mallinkService/src/main/java/com/iformall/service/WxFlowConfigService.java b/mallinkService/src/main/java/com/iformall/service/WxFlowConfigService.java new file mode 100644 index 000000000..eb77675e1 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/WxFlowConfigService.java @@ -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 findList(WxFlowConfig record); + +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxMallFloorService.java b/mallinkService/src/main/java/com/iformall/service/WxMallFloorService.java index 1ff8cea04..29f5ad48c 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxMallFloorService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxMallFloorService.java @@ -42,4 +42,5 @@ public interface WxMallFloorService { ResultData getFloorList(TenantEntity tenantEntity, Long buildingId); + void deleteByBuildingId(Long buildingId); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxMallService.java b/mallinkService/src/main/java/com/iformall/service/WxMallService.java index 2fbfc56d3..8b98c1ea1 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxMallService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxMallService.java @@ -79,4 +79,5 @@ public interface WxMallService { */ List getSubByParentTenantId(String parentTenantId); + void undateSubmall(String parentTenantId, String[] tenantIds); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxMsgValidationcodeModelService.java b/mallinkService/src/main/java/com/iformall/service/WxMsgValidationcodeModelService.java index 74bfba03e..80b6c6c5c 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxMsgValidationcodeModelService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxMsgValidationcodeModelService.java @@ -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 listAsPage(WxMsgValidationcodeModel record, Integer pageIndex, Integer pageSize); + + List findList(WxMsgValidationcodeModel record); /** * 根据Id获得实体 diff --git a/mallinkService/src/main/java/com/iformall/service/WxPayAccountBillService.java b/mallinkService/src/main/java/com/iformall/service/WxPayAccountBillService.java index 87a0eb753..b7cddb8a7 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxPayAccountBillService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxPayAccountBillService.java @@ -55,12 +55,7 @@ public interface WxPayAccountBillService { * @param id */ void deleteById(Long id); - - - - - - - + + WxPayAccountBill getByTenantId(String tenantId); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxPayAccountService.java b/mallinkService/src/main/java/com/iformall/service/WxPayAccountService.java index e0ba9d246..53681cfa5 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxPayAccountService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxPayAccountService.java @@ -47,12 +47,7 @@ public interface WxPayAccountService { * @param id */ void deleteById(Long id); - - - - - - - + + WxPayAccount getByTenantId(String te); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxProjectConfigService.java b/mallinkService/src/main/java/com/iformall/service/WxProjectConfigService.java index f1fa8b340..3f879fbad 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxProjectConfigService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxProjectConfigService.java @@ -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 wxMallBuildings); + + /** + * 初始化新增修改wxPayAccount + * @param wxPayAccount + */ + void initPayAccount(WxPayAccount wxPayAccount); + + /** + * 初始化新增userInfo + * @param userInfo + */ + void initUserInfo(MallUserInfo userInfo); + + void initSubmall(String parentTenantId, String[] tenantIds); + } diff --git a/mallinkService/src/main/java/com/iformall/service/WxQuestionService.java b/mallinkService/src/main/java/com/iformall/service/WxQuestionService.java index 1ba1d06ad..8e7dc2686 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxQuestionService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxQuestionService.java @@ -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); /** * 根据实体查询分页列表 diff --git a/mallinkService/src/main/java/com/iformall/service/WxTemplateMsgService.java b/mallinkService/src/main/java/com/iformall/service/WxTemplateMsgService.java index ea7ad0dbc..716b983c1 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxTemplateMsgService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxTemplateMsgService.java @@ -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 listAsPage(WxTemplateMsg record, Integer pageIndex, Integer pageSize); + + List findList(WxTemplateMsg record); /** * 根据Id获得实体 diff --git a/mallinkService/src/main/java/com/iformall/service/WxWiWideInfoService.java b/mallinkService/src/main/java/com/iformall/service/WxWiWideInfoService.java new file mode 100644 index 000000000..d62a9c405 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/WxWiWideInfoService.java @@ -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); + +} diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendConfigServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendConfigServiceImpl.java index 6ca74cc81..8d14dd912 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendConfigServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendConfigServiceImpl.java @@ -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 findList(WxCouponSendConfig record) { + return wxCouponSendConfigMapper.findList(record); + } + @Override public WxCouponSendConfig getById(Long id) { return wxCouponSendConfigMapper.selectById(id); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowConfigServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowConfigServiceImpl.java new file mode 100644 index 000000000..338e0d1f3 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowConfigServiceImpl.java @@ -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 findList(WxFlowConfig record) { + return wxFlowConfigMapper.findList(record); + } +} diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMallFloorServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMallFloorServiceImpl.java index ce324cc79..cf30da178 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMallFloorServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMallFloorServiceImpl.java @@ -58,9 +58,11 @@ public class WxMallFloorServiceImpl implements WxMallFloorService { List list = wxMallFloorMapper.findList(wxMallFloor); return new ResultData(list); } - - - - - + + @Override + public void deleteByBuildingId(Long buildingId) { + wxMallFloorMapper.deleteByBuildingId(buildingId); + } + + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java index 1511d9a19..e16dc2463 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java @@ -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()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java index 6225aaa9c..0d3538acc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java @@ -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', '审批通过通知', '富茂', " + " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n
\\n
审批通过通知
\\n
编号{contract}的{bustype}已经审批通过,请登录{page}跟进后续工作
\\n
\\n
\\n\\n\\n', " + - " '" + 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', '待缴账单通知', '富茂', " + " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
待缴账单通知
\\n
您当前的待缴账单为{price}元,截止日期为{date}请登录您的商户端小程序查看账单并缴费
\\n
\\n
\\n
\\n 租金账单\\n
\\n
账单类型
\\n
账单金额(元)
\\n
缴费时间
\\n
\\n {billList}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系商管负责人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + - " '" + 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', '审批通知', '富茂', " + "'\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n
\\n
审批通知
\\n
{userName}同意编号{contract}的{bustype}审批,已呈送{toUserName},请登录{page}查看审批进度
\\n
\\n
\\n\\n\\n', " + - "'" + 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', '欠缴账单通知', '富茂', " + " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
欠缴账单通知
\\n
您当前的欠缴账单为{price}元,截止日期为{date}请登录您的商户端小程序查看账单并缴费
\\n
\\n
\\n
\\n 租金账单\\n
\\n
账单类型
\\n
账单金额(元)
\\n
缴费时间
\\n
逾期天数
\\n
\\n {billList}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系商管负责人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + - "'" + 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', '待办通知', '富茂'," + " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
待办通知
\\n
{name}提交了一个{bustype}待您审批,电脑登录{page}查看您的待办
\\n
\\n
\\n
\\n
申请时间:
\\n
{applyTime}
\\n
\\n
\\n
申请进度:
\\n
\\n \\n {taskList}\\n
\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系申请人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + - " '" + 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', '驳回通知', '富茂', " + " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
审批通过通知
\\n
编号{contract}的{bustype}审批被驳回,请登录{page}查看审批明细
\\n
\\n
\\n
\\n 驳回人:\\n {name}\\n
\\n
\\n 驳回原因:\\n {remark}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系驳回人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + - " '" + 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 findList(WxMsgValidationcodeModel record) { + return wxMsgValidationcodeModelMapper.findList(record); + } + @Override public WxMsgValidationcodeModel getById(String id) { return wxMsgValidationcodeModelMapper.selectById(id); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java index af3e6a85e..2b0eefca2 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java @@ -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); + } + + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountServiceImpl.java index 1f4a7d3aa..b21177e2e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountServiceImpl.java @@ -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); + } + + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java index e4f9f9b02..115c0b710 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java @@ -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 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 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 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); + /** + * 初始化数据 + */ + } + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxQuestionServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxQuestionServiceImpl.java index db803ce5b..e402b6e38 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxQuestionServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxQuestionServiceImpl.java @@ -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); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxTemplateMsgServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxTemplateMsgServiceImpl.java index 92a6fe386..2ed7aa39c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxTemplateMsgServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxTemplateMsgServiceImpl.java @@ -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 findList(WxTemplateMsg record) { + return wxTemplateMsgMapper.findList(record); + } + @Override public WxTemplateMsg getById(Long id) { return wxTemplateMsgMapper.selectById(id); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxWiWideInfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxWiWideInfoServiceImpl.java new file mode 100644 index 000000000..c2b21983a --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxWiWideInfoServiceImpl.java @@ -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)); + } + +} diff --git a/mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml b/mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml index 513374cb2..9a5022c8f 100644 --- a/mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml @@ -73,4 +73,9 @@ + + delete from wx_mall_floor where building_id=#{buildingId} + + + diff --git a/mallinkService/src/main/resources/mapper/WxMallMapper.xml b/mallinkService/src/main/resources/mapper/WxMallMapper.xml index 05504be40..d6da92382 100644 --- a/mallinkService/src/main/resources/mapper/WxMallMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMallMapper.xml @@ -179,6 +179,15 @@ and m.`parent_tenant_id` = #{parentTenantId} + + + update wx_mall set parent_tenant_id = null where parent_tenant_id = #{parentTenantId} ; + update wx_mall set parent_tenant_id = #{parentTenantId} where tenant_id in + + #{item} + + diff --git a/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml b/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml index 164561bf7..76e3f339e 100644 --- a/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml @@ -77,12 +77,18 @@ order by ${sortColumns} - select - from wx_pay_account + from wx_pay_account_bill + + diff --git a/mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml b/mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml index e1714c017..139f2996e 100644 --- a/mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml @@ -3,6 +3,8 @@ + + @@ -15,14 +17,17 @@ - `id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`,`real_rate` + `id`,`tenant_id`,`parent_tenant_id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`,`real_rate` where 1 = 1 - - and `id` = #{id} + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} @@ -72,5 +77,11 @@ + +