From 2a7a159b136805612e241e4e8e24affedfc23cc2 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Sat, 20 Nov 2021 21:07:43 +0800
Subject: [PATCH] Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop
---
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/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java | 4
zq-erp/src/main/resources/config/application.properties | 12 +-
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/SysUsersDao.xml | 5 +
13 files changed, 189 insertions(+), 21 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 40e7422..ee23831 100644
--- a/zq-erp/src/main/resources/config/application.properties
+++ b/zq-erp/src/main/resources/config/application.properties
@@ -4,13 +4,13 @@
#线上测试环境
#
-#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=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!@#
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..dd2ef97 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.gift_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