From e47e795b062e68b55aa28c955a2c8407c6ed9cb5 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Mon, 12 Jul 2021 16:18:20 +0800
Subject: [PATCH] fix
---
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml | 4 ++
zq-erp/src/test/java/com/matrix/DataMoveTest.java | 24 +++++++++--
zq-erp/src/main/java/com/matrix/system/dataMove/DateMoveServiceImpl.java | 44 ++++++++++++++++++++++
zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java | 2 +
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml | 4 ++
zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java | 2 +
6 files changed, 75 insertions(+), 5 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/dataMove/DateMoveServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/dataMove/DateMoveServiceImpl.java
index dd85f30..f3166ca 100644
--- a/zq-erp/src/main/java/com/matrix/system/dataMove/DateMoveServiceImpl.java
+++ b/zq-erp/src/main/java/com/matrix/system/dataMove/DateMoveServiceImpl.java
@@ -1710,4 +1710,48 @@
sysBeauticianStateDao.update(state);
}
}
+
+ public void updateVipInfoStaff() {
+ Map<String, Integer> shopStaff = getRedisIds("shop_staff");
+
+ List<SysVipInfo> sysVipInfos = sysVipInfoDao.selectStaff();
+
+ for (SysVipInfo sysVipInfo : sysVipInfos) {
+ Long staffId = sysVipInfo.getStaffId();
+
+ Integer integer = shopStaff.get(staffId.toString());
+ if (integer == null) {
+ continue;
+ }
+
+ SysVipInfo update = new SysVipInfo();
+ update.setStaffId(integer.longValue());
+ update.setId(sysVipInfo.getId());
+ sysVipInfoDao.update(update);
+ }
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void updateProjUseIsCourse() {
+ List<SysProjUse> sysProjUses = sysProjUseDao.selectProjUse();
+
+ for (SysProjUse sysProjUs : sysProjUses) {
+ ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(sysProjUs.getProjId());
+
+ SysProjUse update = new SysProjUse();
+
+ if (shoppingGoods == null) {
+ continue;
+ }
+
+ if ("Y".equals(shoppingGoods.getIsCourse())) {
+ update.setIsCourse("Y");
+ } else {
+ continue;
+ }
+
+ update.setId(sysProjUs.getId());
+ sysProjUseDao.update(update);
+ }
+ }
}
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java
index c064f18..1598b10 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java
@@ -132,4 +132,6 @@
List<SysProjUseFlow> selectProjUseFlow(@Param("record") SysProjUseFlow projUseFlow, @Param("pageVo")PaginationVO pageVo);
Integer selectProjUseFlowTotal(@Param("record") SysProjUseFlow projUseFlow);
+
+ List<SysProjUse> selectProjUse();
}
\ No newline at end of file
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java
index 853b5c5..cd3b709 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java
@@ -208,4 +208,6 @@
List<VipInfoListVo> selectVipAddressBookByList(@Param("record") VipInfoListDto vipInfoListDto);
com.matrix.system.app.vo.VipInfoVo selectVipInfoById(@Param("id") Long id);
+
+ List<SysVipInfo> selectStaff();
}
\ No newline at end of file
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml
index d05844a..d4f103b 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml
@@ -859,4 +859,8 @@
</select>
+ <select id="selectProjUse" resultMap="SysProjUseMap">
+ select * from sys_proj_use
+ where is_course='N'
+ </select>
</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 5203a47..dd68e77 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
@@ -1366,5 +1366,9 @@
left join sys_shop_info e on a.SHOP_ID=e.ID
where a.ID=#{id}
</select>
+
+ <select id="selectStaff" resultType="com.matrix.system.hive.bean.SysVipInfo">
+ select * from sys_vip_info where 1000 > staff_id;
+ </select>
</mapper>
diff --git a/zq-erp/src/test/java/com/matrix/DataMoveTest.java b/zq-erp/src/test/java/com/matrix/DataMoveTest.java
index 9abb938..d2cfb4d 100644
--- a/zq-erp/src/test/java/com/matrix/DataMoveTest.java
+++ b/zq-erp/src/test/java/com/matrix/DataMoveTest.java
@@ -4,6 +4,7 @@
import com.matrix.system.hive.bean.SysShopInfo;
import com.matrix.system.dataMove.DateMoveServiceImpl;
import com.matrix.system.hive.bean.SysVipLevel;
+import lombok.Data;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -53,6 +54,11 @@
public void vipLevelMove() {
List<SysVipLevel> sysVipLevels = dataMove.vipLevelOld();
dataMove.vipLevelNew(sysVipLevels);
+ }
+
+ // @Test
+ public void shopStaffMoveTest() throws UnsupportedEncodingException, NoSuchAlgorithmException {
+ dataMove.shopStaffInfoNew(dataMove.shopStaffInfoOld());
}
/**
@@ -119,11 +125,6 @@
dataMove.shoppingGoodsZhkNew(dataMove.shoppingGoodsZhkOld());
}
-// @Test
- public void shopStaffMoveTest() throws UnsupportedEncodingException, NoSuchAlgorithmException {
- dataMove.shopStaffInfoNew(dataMove.shopStaffInfoOld());
- }
-
// @Test
public void orderMoveTest() {
dataMove.orderNew(dataMove.orderOld());
@@ -134,6 +135,9 @@
dataMove.bedInfoNew(dataMove.bedInfoOld());
}
+ /**
+ * isCourse 不能默认为N
+ */
@Test
public void projUseMoveTest() {
dataMove.projUseNew(dataMove.projUseMoveOld());
@@ -165,4 +169,14 @@
public void updateServiceOrderStaff() {
dataMove.updateServiceOrderStaff();
}
+
+ @Test
+ public void updateVipInfoStaff() {
+ dataMove.updateVipInfoStaff();
+ }
+
+ @Test
+ public void updateProjUseIsCoures() {
+ dataMove.updateProjUseIsCourse();
+ }
}
--
Gitblit v1.9.1