From 840d78d6ff875d36e6a602772ea9b49b0732ae63 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Mon, 19 Apr 2021 16:57:08 +0800 Subject: [PATCH] modify --- zq-erp/src/main/java/com/matrix/system/dataMove/DateMoveServiceImpl.java | 97 ++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 89 insertions(+), 8 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 086cf75..08800f8 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 @@ -491,6 +491,11 @@ shoppingGood.setIsDel(1); shoppingGood.setZjm(StringUtils.toHanyuPinyin(shoppingGood.getName()) + "," + StringUtils.toHeadWordHanyuPinyin(shoppingGood.getName())); + if (shoppingGood.getCarUseCount() != null) { + shoppingGood.setIsCourse("Y"); + shoppingGood.setIsInfinite("N"); + } + shoppingGood.setWeiDescription("数据迁移-tc"); List<ShoppingGoodsAssemble> assembleList = mapsToListBean(assembles, ShoppingGoodsAssemble.class); @@ -632,6 +637,7 @@ } shoppingGood.setAssembleGoods(assembleList); + shoppingGood.setIsInfinite("N"); } return shoppingGoods; @@ -1073,7 +1079,7 @@ "\t\ta.balance,\n" + "\t\ta.remark,\n" + " b.name projName,\n" + - " sum(a.SURPLUS_COUNT) SURPLUS_COUNT\n" + + " a.SURPLUS_COUNT\n" + "\t\tfrom sys_proj_use a\n" + "\t\tleft join shopping_goods b on a.TAOCAN_ID= b.ID\n" + "where TAOCAN_ID IS NOT NULL\n" + @@ -1223,10 +1229,11 @@ Map<String, Integer> vipInfos = getRedisIds("vip_info"); Map<String, Integer> bedInfos = getRedisIds("bed_info"); - Map<String, Integer> sysUsers = getRedisIds("sys_users"); +// Map<String, Integer> sysUsers = getRedisIds("sys_users"); Map<String, Integer> projUses = getRedisIds("proj_use"); Map<String, Integer> goodProj = getRedisIds("shopping_goods_proj"); Map<String, Integer> shopIds = getRedisIds("shopId"); + Map<String, Integer> shopStaff = getRedisIds("shop_staff"); for (SysProjServices sysProjServices : list) { List<Map<String, Object>> beauticiansMap = jdbcTemplate.queryForList("select * from sys_beautician_state where SERVICES_ID=" + sysProjServices.getId()); // Map<String, Object> bedStatesMap = jdbcTemplate.queryForMap("select * from sys_bed_state where SERVICE_ID=" + sysProjServices.getId()); @@ -1264,7 +1271,7 @@ } if (sysProjServices.getBeauticianId() != null) { - Integer beautyId = sysUsers.get(sysProjServices.getBeauticianId().toString()); + Integer beautyId = shopStaff.get(sysProjServices.getBeauticianId().toString()); if (beautyId != null) { sysProjServices.setBeauticianId(beautyId.longValue()); } else { @@ -1273,7 +1280,7 @@ } if (sysProjServices.getDevisionId() != null) { - Integer devisionId = sysUsers.get(sysProjServices.getDevisionId().toString()); + Integer devisionId = shopStaff.get(sysProjServices.getDevisionId().toString()); if (devisionId != null) { sysProjServices.setDevisionId(devisionId.longValue()); } else { @@ -1282,7 +1289,7 @@ } if (sysProjServices.getCreateStaffId() != null) { - Integer staffId = sysUsers.get(sysProjServices.getCreateStaffId().toString()); + Integer staffId = shopStaff.get(sysProjServices.getCreateStaffId().toString()); if (staffId != null) { sysProjServices.setCreateStaffId(staffId.longValue()); } else { @@ -1318,7 +1325,7 @@ } beauticianState.setCount(1); - beauticianState.setExtract("数据迁移"); +// beauticianState.setcreate("数据迁移"); newBeautician.add(beauticianState); } } @@ -1330,10 +1337,10 @@ achieveNew.setShopId(shopId != null ? shopId.longValue() : -achieveNew.getShopId()); achieveNew.setVipId(vipId != null ? vipId.longValue() : -achieveNew.getVipId()); - Integer saleIdInt = sysUsers.get(achieveNew.getSaleId() == null ? "" : achieveNew.getSaleId().toString()); + Integer saleIdInt = shopStaff.get(achieveNew.getSaleId() == null ? "" : achieveNew.getSaleId().toString()); achieveNew.setSaleId(saleIdInt == null ? -achieveNew.getSaleId() : saleIdInt); - Integer beaultyIdInt = sysUsers.get(achieveNew.getBeaultId() == null ? "" : achieveNew.getBeaultId().toString()); + Integer beaultyIdInt = shopStaff.get(achieveNew.getBeaultId() == null ? "" : achieveNew.getBeaultId().toString()); achieveNew.setBeaultId(beaultyIdInt == null ? -achieveNew.getBeaultId() : beaultyIdInt); if (achieveNew.getShoppingGoodsId() != null) { @@ -1461,5 +1468,79 @@ redisClient.saveMapValue("shop_staff", shopStaff); } + @DS("slave") + public List<MoneyCardUse> moneyCardUseOld() { + List<Map<String, Object>> maps = jdbcTemplate.queryForList("select * from money_card_use"); + List<MoneyCardUse> moneyCardUses = mapsToListBean(maps, MoneyCardUse.class); + + Map<String, Integer> goodCzk = getRedisIds("shopping_goods_czk"); + Map<String, Integer> vipInfos = getRedisIds("vip_info"); + for (MoneyCardUse moneyCardUse : moneyCardUses) { + moneyCardUse.setIsVipCar("N"); + + Integer vipId = null; + if (moneyCardUse.getVipId() != null) { + vipId = vipInfos.get(moneyCardUse.getVipId().toString()); + if (vipId != null) { + moneyCardUse.setVipId(vipId.longValue()); + } else { + moneyCardUse.setVipId(-moneyCardUse.getVipId()); + } + } + + if (moneyCardUse.getGoodsId() != null) { + Integer goodsId = goodCzk.get(moneyCardUse.getGoodsId().toString()); + if (goodsId != null) { + moneyCardUse.setGoodsId(goodsId.longValue()); + } else { + moneyCardUse.setGoodsId(-moneyCardUse.getGoodsId()); + } + } + } + + return moneyCardUses; + } + + @Transactional(rollbackFor = Exception.class) + public void moneyCardUseNew(List<MoneyCardUse> list) { + if (CollUtil.isNotEmpty(list)) { + for (MoneyCardUse moneyCardUse : list) { + moneyCardUse.setId(null); + moneyCardUse.setSource("美度-数据迁移"); + moneyCardUseDao.insert(moneyCardUse); + } + } + } + + + @Transactional(rollbackFor = Exception.class) + public void tyOrderAndAchieveMove() { + jdbcTemplate.update("update sys_order set order_type=1, is_has_refund=2 where 1=1"); + + List<SysOrderFlow> flows = sysOrderFlowDao.selectOrderFlowByType(); + if (CollUtil.isNotEmpty(flows)) { + for (SysOrderFlow flow : flows) { + SysOrder sysOrder = sysOrderDao.selectById(flow.getOrderId()); + sysOrder.setIsHasRefund(1); + sysOrderDao.update(sysOrder); + } + } + + List<AchieveNew> achieveNews = achieveNewDao.selectAchieveForOrder(); + if (CollUtil.isNotEmpty(achieveNews)) { + for (AchieveNew achieveNew : achieveNews) { + if ("现金业绩".equalsIgnoreCase(achieveNew.getAchieveType())) { + achieveNew.setPayMethod("现金"); + } else { + achieveNew.setPayMethod("划扣"); + } + achieveNew.setAchieveType("顾问业绩"); + achieveNew.setGoodsCash(Double.parseDouble(achieveNew.getT1())); + achieveNewDao.updateByModel(achieveNew); + } + + } + + } } -- Gitblit v1.9.1