| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.db.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.sanshuo.ComSanShuoIndustryCenterDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | import com.panzhihua.service_community.dao.SysUserDao; |
| | | import com.panzhihua.service_community.entity.ComSanshuoIndustryCenter; |
| | | import com.panzhihua.service_community.entity.SysUser; |
| | | import com.panzhihua.service_community.schedule.util.MyAESUtil; |
| | | import com.panzhihua.service_community.service.ComSanShuoIndustryCenterService; |
| | | import com.panzhihua.service_community.util.MyAESUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public R addOrUpdate(ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO) { |
| | | ComSanshuoIndustryCenter comSanshuoIndustryCenter = comSanshuoIndustryCenterDao.selectOne(new QueryWrapper<ComSanshuoIndustryCenter>().eq("name", comSanShuoIndustryCenterDTO.getName())); |
| | | if (isNull(comSanShuoIndustryCenterDTO.getId())){ |
| | | if (nonNull(comSanshuoIndustryCenter)){ |
| | | return R.fail("业务中心已存在"); |
| | | } |
| | | ComSanshuoIndustryCenter center=new ComSanshuoIndustryCenter(); |
| | | BeanUtil.copyProperties(comSanShuoIndustryCenterDTO,center); |
| | | //添加 |
| | |
| | | return userService.sanShuoAddUser(user); |
| | | } |
| | | }else { |
| | | if (nonNull(comSanshuoIndustryCenter)){ |
| | | return R.fail("业务中心已存在"); |
| | | } |
| | | ComSanshuoIndustryCenter center=new ComSanshuoIndustryCenter(); |
| | | BeanUtil.copyProperties(comSanShuoIndustryCenterDTO,center); |
| | | center.setUpdateTime(new Date()); |
| | |
| | | } |
| | | return R.fail("操作失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R resetPassword(ComSanshuoIndustryCenter center) { |
| | | try { |
| | | String pass=MyAESUtil.Encrypt(center.getPassword(), "Ryo7M3n8loC5Abcd"); |
| | | return userService.sanShuoResetPassword(center.getAccount(), pass); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | } |