From 341baf3bdd5e8e7e83a01a03b8636f1f3aeb8f6a Mon Sep 17 00:00:00 2001 From: wzy <wzy19931122ai@163.com> Date: Sun, 28 Nov 2021 16:15:45 +0800 Subject: [PATCH] fix --- zq-erp/src/main/resources/config/test/system.properties | 1 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml | 2 zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html | 148 +++++++++++++++++++++++++++++++++++-- zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java | 2 zq-erp/pom.xml | 4 zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java | 1 zq-erp/src/main/resources/config/mdprd/system.properties | 3 zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java | 4 zq-erp/src/main/resources/config/application.properties | 8 +- zq-erp/src/main/resources/config/prd/system.properties | 3 zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java | 3 zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java | 2 zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java | 5 + zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java | 2 zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java | 20 +++++ zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml | 3 zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml | 5 + 17 files changed, 192 insertions(+), 24 deletions(-) diff --git a/zq-erp/pom.xml b/zq-erp/pom.xml index e2607e6..a4dbca9 100644 --- a/zq-erp/pom.xml +++ b/zq-erp/pom.xml @@ -413,11 +413,11 @@ <exclude>config/xcx/*</exclude> <exclude>config/xcshop/*</exclude> - <!----> + <!-- <exclude>config/config.json</exclude> <exclude>config/application.properties</exclude> <exclude>config/system.properties</exclude> - +--> <exclude>**/*.woff</exclude> diff --git a/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java b/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java index 8bb1c0b..c3067f7 100644 --- a/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java +++ b/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java @@ -74,6 +74,7 @@ registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**") .addPathPatterns("/api/common/wxLogin/**") .addPathPatterns("/api/common/bindUser") + .addPathPatterns("/api/user/xcxloginOut/**") .excludePathPatterns("/wxCommon/wxapi/wxpayCallback") .excludePathPatterns("/wxCommon/wxapi/rechargeCallBack"); } diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java index 571d201..ed9b2c4 100644 --- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java @@ -374,8 +374,7 @@ List<String> openIds = StrUtil.split(hasBind.getOpenIds(), ','); openIds.remove(loginDto.getOpenId()); - hasBind.setOpenIds(CollUtil.join(openIds, ",")); - sysUsersService.modifyByModel(hasBind); + sysUsersService.modifyUserOpenId(CollUtil.join(openIds, ","), hasBind.getSuId()); } } diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java index e4fdf69..f0dcbb0 100644 --- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java @@ -1,5 +1,7 @@ package com.matrix.system.app.action; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.DateUtil; @@ -16,6 +18,7 @@ import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.init.LocalCache; import com.matrix.system.common.interceptor.ApiUserLoginInterceptor; +import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.common.service.SysUsersService; import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.common.tools.PasswordUtil; @@ -108,6 +111,23 @@ return AjaxResult.buildSuccessInstance("退出成功"); } + @ApiOperation(value = "小程序退出登陆", notes = "小程序退出登陆") + @GetMapping(value = "/xcxloginOut/{code}") + public AjaxResult xcxloginOut(HttpServletRequest request, @PathVariable("code") String code) { + SysUsers hasBind = sysUsersService.findByOpenId(code, HostInterceptor.getCompanyId()); + if (hasBind != null) { + if(StrUtil.isNotBlank(hasBind.getOpenIds())) { + List<String> openIds = StrUtil.split(hasBind.getOpenIds(), ','); + openIds.remove(code); + + sysUsersService.modifyUserOpenId(CollUtil.join(openIds, ","), hasBind.getSuId()); + } + } + String token=ApiUserLoginInterceptor.resolveToken(request,privateKey); + LocalCache.remove(token); + return AjaxResult.buildSuccessInstance("退出成功"); + } + @ApiOperation(value = "员工列表", notes = "员工列表") @ApiResponses({ @ApiResponse(code = 200, message = "ok", response = BeauticianVo.class) diff --git a/zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java b/zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java index daadc33..7d3181a 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java +++ b/zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java @@ -126,4 +126,6 @@ public List<AppVersion> selectAppVersion(); SysUsers selectUserByOpenId(@Param("openId") String openId, @Param("companyId") Long companyId); + + int updateUserOpenId(@Param("openId") String openId, @Param("suId") Long suId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java b/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java index 905a0ff..ec9d7c5 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java +++ b/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java @@ -174,4 +174,6 @@ public List<AppVersion> findAppVersion(); SysUsers findByOpenId(String openId, Long companyId); + + int modifyUserOpenId(String openId, Long suId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java index f633b69..2d14f86 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java @@ -275,4 +275,9 @@ public SysUsers findByOpenId(String openId, Long companyId) { return sysUsersDao.selectUserByOpenId(openId, companyId); } + + @Override + public int modifyUserOpenId(String openId, Long suId) { + return sysUsersDao.updateUserOpenId(openId, suId); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java b/zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java index 62525b3..60dd23f 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java +++ b/zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java @@ -20,7 +20,7 @@ */ public static boolean hasAllShopAuth() { SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - return user.getShopRole().equals(Dictionary.FLAG_YES_Y) || user.getSuUserType().equals(AppConstance.USER_TYPE_ADMIN); + return Dictionary.FLAG_YES_Y.equals(user.getShopRole()) || AppConstance.USER_TYPE_ADMIN.equals(user.getSuUserType()); } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java index f23d9a1..f32259e 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java @@ -316,7 +316,9 @@ num = 1D / achieveNewList.size(); } - achieveNewDao.updateAchieveNumOfPeople(achieveNewList, num); + if (CollUtil.isNotEmpty(achieveNewList)) { + achieveNewDao.updateAchieveNumOfPeople(achieveNewList, num); + } } } diff --git a/zq-erp/src/main/resources/config/application.properties b/zq-erp/src/main/resources/config/application.properties index a110e8a..ee23831 100644 --- a/zq-erp/src/main/resources/config/application.properties +++ b/zq-erp/src/main/resources/config/application.properties @@ -4,14 +4,14 @@ #线上测试环境 # -#spring.datasource.username=ct_test -#spring.datasource.password=123456 -#spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test_meidu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 - spring.datasource.username=ct_test spring.datasource.password=123456 spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 +#spring.datasource.username=hive +#spring.datasource.password=hive123!@# +#spring.datasource.url=jdbc:mysql://124.70.222.34/hive_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + #spring.datasource.username=xc_shop #spring.datasource.password=xc_shop123!@# #spring.datasource.url=jdbc:mysql://124.70.222.34/xc_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 diff --git a/zq-erp/src/main/resources/config/mdprd/system.properties b/zq-erp/src/main/resources/config/mdprd/system.properties index b601be1..30d25c6 100644 --- a/zq-erp/src/main/resources/config/mdprd/system.properties +++ b/zq-erp/src/main/resources/config/mdprd/system.properties @@ -59,7 +59,8 @@ wechar_login_url =https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code xcx_appid =wx3836ab3c1490ff29 xcx_secret =39a3687ec5b2666ed68e7c8b83b26b47 - +xcx_manager_appid=wx2948b3b914a9722e +xcx_manager_secret=1685dfd99a43e213ed8be07870b898ba #微信支付调试开关 wx_pay_debug_onoff = false diff --git a/zq-erp/src/main/resources/config/prd/system.properties b/zq-erp/src/main/resources/config/prd/system.properties index 406595b..6e6d637 100644 --- a/zq-erp/src/main/resources/config/prd/system.properties +++ b/zq-erp/src/main/resources/config/prd/system.properties @@ -12,7 +12,7 @@ default_password=123 #nginx静态资源访问地址 -static_resource_url=https://hive.file.csxuncong.com/uploadeFile/ +static_resource_url=https://filehive2.jyymatrix.cc/uploadeFile/ #文件保存地址 file_storage_path=/mnt/hive/static/uploadeFile/ #文件上传大小字节为单位 10MB @@ -61,7 +61,6 @@ xcx_secret =39a3687ec5b2666ed68e7c8b83b26b47 xcx_manager_appid=wx0d5655a6443807d3 xcx_manager_secret=b04e675224437c4f17c3068b6c2377b6 - #微信支付调试开关 wx_pay_debug_onoff = false diff --git a/zq-erp/src/main/resources/config/test/system.properties b/zq-erp/src/main/resources/config/test/system.properties index da69f97..3f4c0ac 100644 --- a/zq-erp/src/main/resources/config/test/system.properties +++ b/zq-erp/src/main/resources/config/test/system.properties @@ -50,7 +50,6 @@ xcx_secret =facea088aae414e5c2ee86b459887721 xcx_manager_appid=wx2948b3b914a9722e xcx_manager_secret=1685dfd99a43e213ed8be07870b898ba - gzh_appid=wx57e6335559bdbda6 gzh_secret=ecb408af170e3890e6544290cad33760 diff --git a/zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml index d83fb31..2e65db5 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml @@ -761,7 +761,8 @@ com_logo, com_valid, com_functions, - com_plats + com_plats, + com_code from sys_company <where> <if test="record!=null"> diff --git a/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml index 557d4ea..5027633 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml @@ -1341,4 +1341,9 @@ </if> </select> + <update id="updateUserOpenId"> + update sys_users + set open_ids=#{openId} + where su_id=#{suId} + </update> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml index a465730..ae9ebb7 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml @@ -1461,7 +1461,7 @@ c.LEVEL_NAME vipLevel, a.POINT_ALL integral, e.shop_short_name shopName, - sum(IFNULL(b.gift_money, 0) + IFNULL(b.real_money, 0)) totalBalance, + sum(IFNULL(b.real_money, 0)) totalBalance, sum(IFNULL(b.gift_money, 0)) giftBalance, (select sum(IFNULL(d.goods_cash, 0) + IFNULL(d.proj_cash, 0) + IFNULL(d.card_cash, 0)) from achieve_new d where d.vip_id=a.id) totalShopping from sys_vip_info a diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html index 911708e..084a646 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html @@ -92,6 +92,34 @@ .drawer { overflow: scroll; } + + .assembly-style .el-form-item__content{ + margin-left: 0px !important; + display: flex; + align-items: center; + } + .assembly-style .el-input{ + width: 100px !important; + } + .assembly-style i{ + font-size: 30px; + } + .assembly-style .active{ + color: #409eff; + } + + .module-property{ + display: flex; + flex-wrap: wrap; + } + .module-property .el-form-item__content{ + margin-left: 0px !important; + display: flex; + align-items: center; + } + .module-property .el-input{ + width: 100px !important; + } </style> </head> <body> @@ -320,12 +348,36 @@ </el-col>--> </el-form-item> - <el-form-item label="CSS样式"> - <el-input v-model="currentNode.nodeStyleStr"></el-input> +<!-- <el-form-item label="CSS样式">--> +<!-- <el-input v-model="currentNode.nodeStyleStr"></el-input>--> +<!-- </el-form-item>--> + <el-form-item label="组件宽高" class="assembly-style"> + <el-input v-model="zjwidth" v-on:input="widthChange"></el-input> + <i :class="selected ? 'el-icon-link active' : 'el-icon-link'" @click="fixedProportion"></i> + <el-input v-model="zjheight" v-on:input="heightChange"></el-input> </el-form-item> - <el-form-item label="节点属性"> - <el-input v-model="currentNode.nodeAttribute"></el-input> +<!-- <el-form-item label="节点属性">--> +<!-- <el-input v-model="currentNode.nodeAttribute"></el-input>--> +<!-- </el-form-item>--> + <el-form-item label="组件属性"> +<!-- 1.图片--> +<!-- 6.滑块--> +<!-- 3.轮播图--> +<!-- 4.视频--> +<!-- 5.跑马灯文字--> + <el-from class="module-property" > + <el-form-item label="自动切换时间间隔(毫秒)"> + <el-input v-model="interval"></el-input> + </el-form-item> + <el-form-item label="前边距"> + <el-input v-model="previousMargin"></el-input> + </el-form-item> + <el-form-item label="后边距"> + <el-input v-model="nextMargin"></el-input> + </el-form-item> + </el-from> </el-form-item> + <el-form-item label="页面组"> <el-input v-model="currentNode.pageCode"></el-input> @@ -366,7 +418,6 @@ <script> - var id = $.query.get("id"); @@ -390,6 +441,14 @@ pageList:[], //当前编辑页面 currentPage:{}, + zjwidth:'', + zjheight:'', + selected:false, + //宽高比 + aspectRatio:'', + interval:'', + previousMargin:'', + nextMargin:'', }, created: function () { @@ -414,8 +473,17 @@ mounted: function () { }, - methods: { + widthChange(){ + if(this.selected){ + this.zjheight = parseInt(this.zjwidth/this.aspectRatio) + } + }, + heightChange(){ + if(this.selected){ + this.zjwidth = parseInt(this.zjheight*this.aspectRatio) + } + }, getHeight() { this.height = window.innerHeight - 40 + 'px'; }, @@ -431,15 +499,32 @@ spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); + let f = e.target.files[0]; + let reader = new FileReader(); + reader.onload = function (e) { + let data = e.target.result; + //加载图片获取图片真实宽度和高度 + let image = new Image(); + image.onload=function(){ + let width = image.width; + let height = image.height; + _this.aspectRatio= width/height + }; + image.src= data; + }; + reader.readAsDataURL(f); + uploadForImage( basePath + "/admin/multipleUploadFile/doUpload", e.target.files[0], function (d, result) { + _this.process = d + "%"; if (d == 100) { if (result) { if (result.status == 200) { + loading.close(); _this.currentNode.ads[index].imgUrl = result.path; } else { @@ -512,8 +597,38 @@ }, clickNode(node) { + console.log(node) + var _this = this; this.currentNode = node; this.drawer = !this.drawer; + this.zjwidth = node.nodeStyle.width.substring(0,node.nodeStyle.width.length-2); + this.zjheight = node.nodeStyle.height.substring(0,node.nodeStyle.height.length-2); + let nodeAttribute = JSON.parse(node.nodeAttribute) + console.log(1111) + console.log(nodeAttribute) + if(nodeAttribute.interval){ + _this.interval = nodeAttribute['interval']; + _this.previousMargin = nodeAttribute['previous-margin']; + _this.nextMargin = nodeAttribute['next-margin']; + } + + + + + let image = new Image(); + image.onload = function() { + let width = image.width; // 宽 px + let height = image.height; // 高 px + _this.aspectRatio = width/height; + console.log(1111); + console.log(_this.aspectRatio); + } + if(node.ads){ + image.src = node.ads[0].imgUrl; + }else { + image.src = node.nodeValue; + } + }, //改变编辑页面,切换页面元素 @@ -521,7 +636,6 @@ this.currentPage=this.pageList[index]; this.currentPageCode=this.pageList[index].code; - console.log(this.currentPageCode); this.loadPageAds(); }, loadPageAds() { @@ -537,6 +651,8 @@ if (node.nodeStyle != null && node.nodeStyle.length > 1) { node.nodeStyleStr = node.nodeStyle; node.nodeStyle = JSON.parse(node.nodeStyle); + _this.zjwidth = node.nodeStyle.width.substring(0,node.nodeStyle.width.length-2); + _this.zjheight = node.nodeStyle.height.substring(0,node.nodeStyle.height.length-2); } } _this.adNodes = data.rows; @@ -601,9 +717,18 @@ if (!this.validation(cNode)) { return false; } + let zjw = this.zjwidth; + let zjh = this.zjheight; + if(zjw != null && zjh != null){ + cNode.nodeStyleStr = '{"width":"'+zjw+'px","height":"'+zjh+'px"}'; + } + if(this.interval != null && this.previousMargin != null && this.nextMargin != null){ + cNode.nodeAttribute = '{"interval":'+this.interval+',"previous-margin":'+this.previousMargin+',"next-margin":'+this.nextMargin+'}'; + } if (cNode.nodeStyleStr != null && cNode.nodeStyleStr.length > 1) { cNode.nodeStyle = JSON.parse(cNode.nodeStyleStr); + } let data = { @@ -673,7 +798,14 @@ "1" ); }, - + fixedProportion(){ + let _this = this; + _this.selected = !_this.selected + if(_this.selected){ + _this.zjwidth = 0 + _this.zjheight = 0 + } + }, }, destroyed() { -- Gitblit v1.9.1