|
@@ -1,15 +1,15 @@
|
|
|
package com.qmth.teachcloud.report.api;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
-import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
|
import com.qmth.teachcloud.common.bean.dto.OrgDto;
|
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
|
+import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
|
import com.qmth.teachcloud.common.service.SysOrgService;
|
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
@@ -31,14 +31,15 @@ import java.util.List;
|
|
|
@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.sys}/org")
|
|
|
public class SysOrgController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private SysOrgService sysOrgService;
|
|
|
+ @Resource
|
|
|
+ SysOrgService sysOrgService;
|
|
|
|
|
|
@Resource
|
|
|
- PrintCommonService printCommonService;
|
|
|
+ BasicCourseService basicCourseService;
|
|
|
|
|
|
/**
|
|
|
* 查询机构树
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "查询")
|
|
@@ -50,38 +51,40 @@ public class SysOrgController {
|
|
|
|
|
|
/**
|
|
|
* 新增/修改
|
|
|
+ *
|
|
|
* @param org
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "新增/修改")
|
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
public Result save(@RequestBody SysOrg org) {
|
|
|
- boolean isSuccess = sysOrgService.saveOrg(org);
|
|
|
- return ResultUtil.ok(isSuccess);
|
|
|
+ return ResultUtil.ok(sysOrgService.saveOrg(org));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 启用/禁用
|
|
|
+ *
|
|
|
* @param org
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "启用/禁用")
|
|
|
@RequestMapping(value = "/enable", method = RequestMethod.POST)
|
|
|
public Result enable(@RequestBody SysOrg org) {
|
|
|
- boolean isSuccess = printCommonService.enable(org);
|
|
|
- return ResultUtil.ok(isSuccess);
|
|
|
+ UpdateWrapper<SysOrg> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.lambda().set(SysOrg::getEnable, org.getEnable()).eq(SysOrg::getId, org.getId());
|
|
|
+ return ResultUtil.ok(sysOrgService.update(updateWrapper));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除
|
|
|
+ *
|
|
|
* @param org
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "删除")
|
|
|
@RequestMapping(value = "/remove", method = RequestMethod.POST)
|
|
|
public Result remove(@RequestBody SysOrg org) {
|
|
|
- boolean isSuccess = printCommonService.remove(org.getId());
|
|
|
- return ResultUtil.ok(isSuccess);
|
|
|
+ return ResultUtil.ok(basicCourseService.removeById(org.getId()));
|
|
|
}
|
|
|
|
|
|
}
|