fix
Helius
2021-07-12 e47e795b062e68b55aa28c955a2c8407c6ed9cb5
zq-erp/src/main/java/com/matrix/system/dataMove/DateMoveServiceImpl.java
@@ -64,7 +64,7 @@
    private RedisClient redisClient;
    private Long companyId = 35L;
    private Long shopId = 38L;
    private Long shopId = 60L;
    public List<Map<String, Object>> dataMove() {
        return jdbcTemplate.queryForList("select * from sys_vip_info limit 10");
@@ -678,11 +678,13 @@
                } else {
                    shoppingGoods.setIsOnce("1");
                }
                if ("否".equals(shoppingGoods.getIsPresent())) {
                    shoppingGoods.setIsPresent("0");
                } else {
                    shoppingGoods.setIsPresent("1");
                if (StrUtil.isNotBlank(shoppingGoods.getIsPresent())) {
                    if ("否".equals(shoppingGoods.getIsPresent())) {
                        shoppingGoods.setIsPresent("0");
                    } else {
                        shoppingGoods.setIsPresent("1");
                    }
                }
                Long oldId = shoppingGoods.getId();
@@ -705,10 +707,12 @@
                                    assembleGood.getShoppingGoods().setIsOnce("1");
                                }
                                if ("否".equals(assembleGood.getShoppingGoods().getIsPresent())) {
                                    assembleGood.getShoppingGoods().setIsPresent("0");
                                } else {
                                    assembleGood.getShoppingGoods().setIsPresent("1");
                                if (StrUtil.isNotBlank(assembleGood.getShoppingGoods().getIsPresent())) {
                                    if ("否".equals(assembleGood.getShoppingGoods().getIsPresent())) {
                                        assembleGood.getShoppingGoods().setIsPresent("0");
                                    } else {
                                        assembleGood.getShoppingGoods().setIsPresent("1");
                                    }
                                }
                                assembleGood.getShoppingGoods().setId(null);
@@ -790,10 +794,12 @@
                    shoppingGoods.setIsOnce("1");
                }
                if ("否".equals(shoppingGoods.getIsPresent())) {
                    shoppingGoods.setIsPresent("0");
                } else {
                    shoppingGoods.setIsPresent("1");
                if (StrUtil.isNotBlank(shoppingGoods.getIsPresent())) {
                    if ("否".equals(shoppingGoods.getIsPresent())) {
                        shoppingGoods.setIsPresent("0");
                    } else {
                        shoppingGoods.setIsPresent("1");
                    }
                }
                Long oldId = shoppingGoods.getId();
@@ -1435,7 +1441,7 @@
                        serviceItem.setServicesId(newId);
                        Long beautyOldId = serviceItem.getId();
                        serviceItem.setId(null);
                        serviceItem.setExtract("数据迁移");
//                        serviceItem.setExtract("数据迁移");
                        sysBeauticianStateDao.insert(serviceItem);
                        beautyMaps.put(beautyOldId, serviceItem.getId());
                    }
@@ -1530,7 +1536,8 @@
            moneyCardUse.setIsVipCar("N");
            ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(moneyCardUse.getGoodsId());
            moneyCardUse.setCardName(shoppingGoods.getName());
            if (shoppingGoods != null)
            {            moneyCardUse.setCardName(shoppingGoods.getName());}
            Integer vipId = null;
            if (moneyCardUse.getVipId() != null) {
@@ -1686,4 +1693,65 @@
        }
    }
    public void updateServiceOrderStaff() {
        Map<String, Integer> shopStaff = getRedisIds("shop_staff");
        List<SysBeauticianState> sysBeauticianStates = sysBeauticianStateDao.selectByModel(null);
        for (SysBeauticianState state : sysBeauticianStates) {
            Long staffId = state.getStaffId();
            Integer integer = shopStaff.get(staffId.toString());
            if (integer == null) {
                state.setStaffId(-staffId);
            } else {
                state.setStaffId(integer.longValue());
            }
            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);
        }
    }
}