diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java index c01315a..e5d35b3 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java @@ -193,6 +193,7 @@ public class ExpertController extends JeecgController { String depid = expertService.getdeps(sysUser.getId()); SysDepart sysDepart = sysDepartService.getById(depid); experttemp.setRealname(sysUser.getRealname()); + experttemp.setSepsd(sysUser.getPassword()); experttemp.setWorkon(sysUser.getWorkNo()); experttemp.setSex(sysUser.getSex()); experttemp.setTopPic(sysUser.getAvatar()); @@ -394,7 +395,7 @@ public class ExpertController extends JeecgController { expert.setCompopen("2"); //开始添加到用户表 - SysUser user = new SysUser(); +/* SysUser user = new SysUser(); user.setAvatar(expert.getTopPic()); user.setSex(expert.getSex()); user.setRealname(expert.getRealname()); @@ -409,7 +410,8 @@ public class ExpertController extends JeecgController { user.setPassword(passwordEncode); user.setStatus(1); user.setDelFlag(CommonConstant.DEL_FLAG_0); - sysUserService.saveUser(user, "1843478958968647681", expert.getSsdep(), ""); + sysUserService.saveUser(user, "1843478958968647681", expert.getSsdep(), "");*/ + expertService.updateuser(expert.getTopPic(),expert.getSex(),expert.getSeusername()); expertService.save(expert); // return Result.OK("添加成功!"); @@ -438,7 +440,7 @@ public class ExpertController extends JeecgController { public Result edit(@RequestBody Expert expert) { expertService.updateById(expert); //开始添加到用户表 - SysUser user = new SysUser(); + /*SysUser user = new SysUser(); user.setAvatar(expert.getTopPic()); user.setSex(expert.getSex()); user.setRealname(expert.getRealname()); @@ -453,7 +455,8 @@ public class ExpertController extends JeecgController { user.setPassword(passwordEncode); user.setStatus(1); user.setDelFlag(CommonConstant.DEL_FLAG_0); - sysUserService.editUser(user,"1843478958968647681", expert.getSsdep(), "", ""); + sysUserService.editUser(user,"1843478958968647681", expert.getSsdep(), "", "");*/ + expertService.updateuser(expert.getTopPic(),expert.getSex(),expert.getSeusername()); return Result.OK("编辑成功!"); } @@ -507,7 +510,7 @@ public class ExpertController extends JeecgController { expert.setCompopen("1"); expertService.updateById(expert); //开始添加到用户表 - SysUser user = new SysUser(); + /* SysUser user = new SysUser(); user.setAvatar(expert.getTopPic()); user.setSex(expert.getSex()); user.setRealname(expert.getRealname()); @@ -522,7 +525,8 @@ public class ExpertController extends JeecgController { user.setPassword(passwordEncode); user.setStatus(1); user.setDelFlag(CommonConstant.DEL_FLAG_0); - sysUserService.editUser(user,"1843478958968647681", expert.getSsdep(), "", ""); + sysUserService.editUser(user,"1843478958968647681", expert.getSsdep(), "", "");*/ + expertService.updateuser(expert.getTopPic(),expert.getSex(),expert.getSeusername()); return Result.OK("编辑成功!"); } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/mapper/ExpertMapper.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/mapper/ExpertMapper.java index 7711d40..d605ea3 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/mapper/ExpertMapper.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/mapper/ExpertMapper.java @@ -58,4 +58,7 @@ public interface ExpertMapper extends BaseMapper { @Update("UPDATE expert SET adminopen = '3' , isdone = 'N' WHERE id = #{id}") void handlebackcount(String id); + + @Update("UPDATE sys_user SET sex = #{sex} , avatar = #{topPic} WHERE username = #{seusername}") + void updateuser(String topPic, Integer sex, String seusername); } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/IExpertService.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/IExpertService.java index a52cb4f..8b40466 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/IExpertService.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/IExpertService.java @@ -43,4 +43,6 @@ public interface IExpertService extends IService { void handleupcount(String id); void handlebackcount(String id); + + void updateuser(String topPic, Integer sex, String seusername); } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java index 8076c5b..56e21c4 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java @@ -107,4 +107,9 @@ public class ExpertServiceImpl extends ServiceImpl impleme public void handlebackcount(String id) { expertMapper.handlebackcount(id); } + + @Override + public void updateuser(String topPic, Integer sex, String seusername) { + expertMapper.updateuser(topPic,sex,seusername); + } }