| | |
| | | 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"); |
| | |
| | | } |
| | | } |
| | | |
| | | if ("否".equals(shoppingGoods.getIsOnce())) { |
| | | shoppingGoods.setIsOnce("0"); |
| | | } else { |
| | | shoppingGoods.setIsOnce("1"); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(shoppingGoods.getIsPresent())) { |
| | | if ("否".equals(shoppingGoods.getIsPresent())) { |
| | | shoppingGoods.setIsPresent("0"); |
| | | } else { |
| | | shoppingGoods.setIsPresent("1"); |
| | | } |
| | | } |
| | | |
| | | Long oldId = shoppingGoods.getId(); |
| | | shoppingGoods.setId(null); |
| | | shoppingGoodsDao.insert(shoppingGoods); |
| | |
| | | |
| | | Long oldIdTc = assembleGood.getAssembleSkuId() == null ? assembleGood.getAssembleProjId() : assembleGood.getAssembleSkuId(); |
| | | if (assembleGood.getShoppingGoods() != null) { |
| | | |
| | | if ("否".equals(assembleGood.getShoppingGoods().getIsOnce())) { |
| | | assembleGood.getShoppingGoods().setIsOnce("0"); |
| | | } else { |
| | | assembleGood.getShoppingGoods().setIsOnce("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); |
| | | shoppingGoodsDao.insert(assembleGood.getShoppingGoods()); |
| | |
| | | Integer cateId = goodsCategory.get(shoppingGoods.getCateId().toString()); |
| | | if (cateId != null) { |
| | | shoppingGoods.setCateId(Long.parseLong(cateId.toString())); |
| | | } |
| | | } |
| | | |
| | | if ("否".equals(shoppingGoods.getIsOnce())) { |
| | | shoppingGoods.setIsOnce("0"); |
| | | } else { |
| | | shoppingGoods.setIsOnce("1"); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(shoppingGoods.getIsPresent())) { |
| | | if ("否".equals(shoppingGoods.getIsPresent())) { |
| | | shoppingGoods.setIsPresent("0"); |
| | | } else { |
| | | shoppingGoods.setIsPresent("1"); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @DS("slave") |
| | | public Map<String, List<Long>> roleOld() { |
| | | List<Map<String, Object>> maps = jdbcTemplate.queryForList("select a.id, a.name, a.role_id, b.role_name from users a inner join sys_role b on find_in_set(b.role_id, a.role_id)"); |
| | | |
| | | List<Long> jkgw = new ArrayList<>(); |
| | | List<Long> mls = new ArrayList<>(); |
| | | for (Map<String, Object> map : maps) { |
| | | String roleName = map.get("role_name").toString(); |
| | | |
| | | if ("健康顾问".equals(roleName)) { |
| | | jkgw.add((Long) map.get("id")); |
| | | } else { |
| | | mls.add((Long) map.get("id")); |
| | | } |
| | | } |
| | | |
| | | Map<String, List<Long>> result = new HashMap<>(); |
| | | result.put("jkgw", jkgw); |
| | | result.put("mls", mls); |
| | | return result; |
| | | } |
| | | |
| | | public void roleNew(Map<String, List<Long>> role) { |
| | | List<Long> jkgw = role.get("jkgw"); |
| | | List<Long> mls = role.get("mls"); |
| | | Map<String, Integer> sysUsersMap = getRedisIds("sys_users"); |
| | | |
| | | for (Long aLong : jkgw) { |
| | | Integer id = sysUsersMap.get(aLong.toString()); |
| | | SysUsers sysUsers = new SysUsers(); |
| | | sysUsers.setSuId(id.longValue()); |
| | | sysUsers.setRoleIds("56"); |
| | | sysUsersDao.updateByModel(sysUsers); |
| | | } |
| | | |
| | | for (Long ml : mls) { |
| | | Integer id = sysUsersMap.get(ml.toString()); |
| | | SysUsers sysUsers = new SysUsers(); |
| | | sysUsers.setSuId(id.longValue()); |
| | | sysUsers.setRoleIds("55"); |
| | | sysUsersDao.updateByModel(sysUsers); |
| | | } |
| | | |
| | | } |
| | | |
| | | @DS("slave") |
| | | public Map<String, String> roleOld2() { |
| | | List<Map<String, Object>> maps = jdbcTemplate.queryForList("select * from sys_shopstaff_info where find_in_set('美疗师', POST_TYPE_NAME) or find_in_set('健康顾问', POST_TYPE_NAME)"); |
| | | Map<String, String> result = new HashMap<>(); |
| | | for (Map<String, Object> map : maps) { |
| | | |
| | | result.put(map.get("id").toString(), map.get("POST_TYPE_NAME").toString()); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public void roleNew2(Map<String, String> map) { |
| | | |
| | | Map<String, Integer> shopStaff = getRedisIds("shop_staff"); |
| | | for (Map.Entry<String, String> entry : map.entrySet()) { |
| | | String id = entry.getKey(); |
| | | Integer newId = shopStaff.get(id); |
| | | |
| | | SysUsers sysUsers = new SysUsers(); |
| | | sysUsers.setSuId(newId.longValue()); |
| | | if (entry.getValue().contains("健康顾问,")) { |
| | | sysUsers.setRoleIds("56"); |
| | | } |
| | | |
| | | if (entry.getValue().contains("美疗师,")) { |
| | | sysUsers.setRoleIds("55"); |
| | | } |
| | | |
| | | if (entry.getValue().contains("健康顾问,美疗师,")) { |
| | | sysUsers.setRoleIds("55,56"); |
| | | } |
| | | |
| | | sysUsersDao.updateByModel(sysUsers); |
| | | } |
| | | } |
| | | |
| | | } |