From 179c4d64313c9b7572778da4aaaf6c6584fe457d Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期二, 20 五月 2025 23:48:08 +0800
Subject: [PATCH] 修改文件上传类型限制

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoIndustryCenterServiceImpl.java |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoIndustryCenterServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoIndustryCenterServiceImpl.java
index f40b094..f97541c 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoIndustryCenterServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoIndustryCenterServiceImpl.java
@@ -1,8 +1,9 @@
 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;
@@ -13,8 +14,8 @@
 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;
@@ -53,6 +54,9 @@
     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);
             //添加
@@ -64,19 +68,16 @@
                 AdministratorsUserVO user=new AdministratorsUserVO();
                 user.setUserId(Snowflake.getId());
                 user.setAccount(comSanShuoIndustryCenterDTO.getAccount());
-                user.setType(11);
                 user.setName(comSanShuoIndustryCenterDTO.getName());
+                user.setType(12);
                 try {
-                    user.setPassword(MyAESUtil.Encrypt(comSanShuoIndustryCenterDTO.getPassword(),"Ryo7M3n8loC5Abcd"));
+                    user.setPassword(comSanShuoIndustryCenterDTO.getPassword());
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                 return userService.sanShuoAddUser(user);
             }
         }else {
-            if (nonNull(comSanshuoIndustryCenter)){
-                return R.fail("业务中心已存在");
-            }
             ComSanshuoIndustryCenter center=new ComSanshuoIndustryCenter();
             BeanUtil.copyProperties(comSanShuoIndustryCenterDTO,center);
             center.setUpdateTime(new Date());
@@ -87,4 +88,14 @@
         }
         return R.fail("操作失败");
     }
+
+    @Override
+    public R resetPassword(ComSanshuoIndustryCenter center) {
+        try {
+            return userService.sanShuoResetPassword(center.getAccount(), center.getPassword());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return R.fail();
+    }
 }

--
Gitblit v1.7.1