Преглед на файлове

新增员工管理修改状态接口

zhangxin преди 9 часа
родител
ревизия
45d3be01c5

+ 11 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppInstructorController.java

@@ -379,7 +379,17 @@ public class AppInstructorController extends JeecgController<AppInstructor, IApp
 	//@AutoLog(value = "教练表-通过id查询")
 	@Operation(summary="员工信息-修改状态")
 	@PutMapping(value = "/updateStatus")
-	public Result<String> updateStatus(SysUser sysUser) {
+	public Result<String> updateStatus(@RequestBody  SysUser sysUser) {
+		StaffVO staffVO = appInstructorService.findById(sysUser.getId());
+		if(staffVO==null) {
+			return Result.error("未找到对应数据");
+		}
+		if (StringUtils.isNotEmpty(staffVO.getInstructorId())){
+			AppInstructor appInstructor = new AppInstructor();
+			appInstructor.setId(staffVO.getInstructorId());
+			appInstructor.setStatus(sysUser.getStatus());
+			appInstructorService.updateById(appInstructor);
+		}
 		sysUserService.updateById(sysUser);
 		return Result.OK("修改状态成功");
 	}

+ 3 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppSiteServiceImpl.java

@@ -49,7 +49,9 @@ public class AppSiteServiceImpl extends ServiceImpl<AppSiteMapper, AppSite> impl
         if (null == siteCuDTO.getType()) throw new JeecgBootException("商户类型不能为空", SC_INTERNAL_SERVER_ERROR_500);
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         AppSite site = new AppSite();
-        SysDepart departById = sysDepartMapper.getDepartById(siteCuDTO.getTenantId());
+//        SysDepart departById = sysDepartMapper.getDepartById(siteCuDTO.getTenantId());
+        //根据当前登录的orgcode去查询所属部门id
+        SysDepart departById = sysDepartMapper.findByOrgCode(sysUser.getOrgCode());
         if (null == departById) throw new JeecgBootException("商户部门不存在", SC_INTERNAL_SERVER_ERROR_500);
         if (!departById.getOrgType().equals("3")) throw new JeecgBootException("商户部门类型错误", SC_INTERNAL_SERVER_ERROR_500);
         BeanUtils.copyProperties(siteCuDTO, site);

+ 2 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java

@@ -688,7 +688,7 @@ public class SysDepartController {
 	 * 查询当前用户所拥有的部门信息
 	 * @return
 	 */
-	@GetMapping("findByDeptList")
+	@GetMapping("/findByDeptList")
 	public Result<List<SysDepart>> findByDeptList() {
 		LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 		return sysDepartService.findByDeptList(loginUser.getOrgCode());
@@ -699,7 +699,7 @@ public class SysDepartController {
 	 * @return
 	 */
 	@Operation(summary="查询当前用户所拥有的部门信息数状结构")
-	@GetMapping("findByDepTree")
+	@GetMapping("/findByDepTree")
 	public Result<List<SysDepartTreeModel>> findByDepTree() {
 		LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 		return sysDepartService.findByDepTree(loginUser.getOrgCode());

+ 3 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDepartMapper.java

@@ -206,4 +206,7 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
 	FindByMerchantIdResponseDTO findByMerchntId(@Param("id")  String id);
 
 	List<SysDepart> findByDeptList(@Param("orgCode") String orgCode);
+
+	@Select("select * from sys_depart where del_flag = '0' and org_code= #{orgCode}")
+	SysDepart findByOrgCode(@Param("orgCode") String orgCode);
 }