From a149333947d4e5f5c0407e4dd4e3ab514c653998 Mon Sep 17 00:00:00 2001 From: paidaxing444 <12qwaszx> Date: Fri, 21 Aug 2020 11:10:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E5=9C=B0=E6=A0=A1=E5=88=9D=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jxjs/TsbzJxjsjbxxController.java | 53 ++++++++++++------- ruoyi-ui/src/api/jxjs/jxjsjbxx.js | 10 +++- ruoyi-ui/src/views/jxjs/jdx/data.vue | 3 ++ ruoyi-ui/src/views/jxjs/jdx/index.vue | 47 +++++++++++----- ruoyi-ui/src/views/jxjs/jdxcx/index.vue | 0 5 files changed, 82 insertions(+), 31 deletions(-) create mode 100644 ruoyi-ui/src/views/jxjs/jdxcx/index.vue diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJxjsjbxxController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJxjsjbxxController.java index 153acb8d2..a7742db10 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJxjsjbxxController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJxjsjbxxController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.jxjs; import java.util.List; + import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -22,14 +23,13 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 见习教师基本信息Controller - * + * * @author ruoyi * @date 2020-08-20 */ @RestController @RequestMapping("/jxjs/jxjsjbxx") -public class TsbzJxjsjbxxController extends BaseController -{ +public class TsbzJxjsjbxxController extends BaseController { @Autowired private ITsbzJxjsjbxxService tsbzJxjsjbxxService; @@ -38,8 +38,7 @@ public class TsbzJxjsjbxxController extends BaseController */ @PreAuthorize("@ss.hasPermi('jxjs:jdx:list')") @GetMapping("/listnotjdx") - public TableDataInfo listnotjdx(TsbzJxjsjbxx tsbzJxjsjbxx) - { + public TableDataInfo listnotjdx(TsbzJxjsjbxx tsbzJxjsjbxx) { startPage(); List list = tsbzJxjsjbxxService.selectTsbzJxjsjbxxListnotjdx(tsbzJxjsjbxx); return getDataTable(list); @@ -50,8 +49,7 @@ public class TsbzJxjsjbxxController extends BaseController */ @PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:list')") @GetMapping("/list") - public TableDataInfo list(TsbzJxjsjbxx tsbzJxjsjbxx) - { + public TableDataInfo list(TsbzJxjsjbxx tsbzJxjsjbxx) { startPage(); List list = tsbzJxjsjbxxService.selectTsbzJxjsjbxxList(tsbzJxjsjbxx); return getDataTable(list); @@ -63,8 +61,7 @@ public class TsbzJxjsjbxxController extends BaseController @PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:export')") @Log(title = "见习教师基本信息", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(TsbzJxjsjbxx tsbzJxjsjbxx) - { + public AjaxResult export(TsbzJxjsjbxx tsbzJxjsjbxx) { List list = tsbzJxjsjbxxService.selectTsbzJxjsjbxxList(tsbzJxjsjbxx); ExcelUtil util = new ExcelUtil(TsbzJxjsjbxx.class); return util.exportExcel(list, "jxjsjbxx"); @@ -75,8 +72,7 @@ public class TsbzJxjsjbxxController extends BaseController */ @PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(tsbzJxjsjbxxService.selectTsbzJxjsjbxxById(id)); } @@ -86,8 +82,7 @@ public class TsbzJxjsjbxxController extends BaseController @PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:add')") @Log(title = "见习教师基本信息", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody TsbzJxjsjbxx tsbzJxjsjbxx) - { + public AjaxResult add(@RequestBody TsbzJxjsjbxx tsbzJxjsjbxx) { return toAjax(tsbzJxjsjbxxService.insertTsbzJxjsjbxx(tsbzJxjsjbxx)); } @@ -97,19 +92,41 @@ public class TsbzJxjsjbxxController extends BaseController @PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:edit')") @Log(title = "见习教师基本信息", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody TsbzJxjsjbxx tsbzJxjsjbxx) - { + public AjaxResult edit(@RequestBody TsbzJxjsjbxx tsbzJxjsjbxx) { return toAjax(tsbzJxjsjbxxService.updateTsbzJxjsjbxx(tsbzJxjsjbxx)); } + /** + * 修改见习教师基本信息 + */ + @PreAuthorize("@ss.hasPermi('jxjs:jdx:edit')") + @Log(title = "见习教师基本信息", businessType = BusinessType.UPDATE) + @PostMapping("/updatejsjdx/{ids}/{jdxid}") + public AjaxResult updateJsJdx(@PathVariable Long[] ids, @PathVariable String jdxid) { + int iCount = 0; + System.out.println("jsid=" + ids[0]); + System.out.println("jdxid=" + jdxid); + if (ids == null || ids.length == 0) { + return AjaxResult.error("请选择要分配的见习教师"); + } + TsbzJxjsjbxx tsbzJxjsjbxx = null; + for (int i = 0; i < ids.length; i++) { + + tsbzJxjsjbxx = new TsbzJxjsjbxx(); + tsbzJxjsjbxx.setId(ids[i]); + tsbzJxjsjbxx.setJdxid(jdxid); + iCount = iCount + (tsbzJxjsjbxxService.updateTsbzJxjsjbxx(tsbzJxjsjbxx)); + } + return toAjax(iCount); + } + /** * 删除见习教师基本信息 */ @PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:remove')") @Log(title = "见习教师基本信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tsbzJxjsjbxxService.deleteTsbzJxjsjbxxByIds(ids)); } } diff --git a/ruoyi-ui/src/api/jxjs/jxjsjbxx.js b/ruoyi-ui/src/api/jxjs/jxjsjbxx.js index 44fa2dd45..9cf721d16 100644 --- a/ruoyi-ui/src/api/jxjs/jxjsjbxx.js +++ b/ruoyi-ui/src/api/jxjs/jxjsjbxx.js @@ -35,6 +35,14 @@ export function addJxjsjbxx(data) { }) } +// 新增基地校 +export function updateJxjsJdx(id, jdxid) { + return request({ + url: '/jxjs/jxjsjbxx/updatejsjdx/' + id + "/" + jdxid, + method: 'post' + }) +} + // 修改见习教师基本信息 export function updateJxjsjbxx(data) { return request({ @@ -59,4 +67,4 @@ export function exportJxjsjbxx(query) { method: 'get', params: query }) -} \ No newline at end of file +} diff --git a/ruoyi-ui/src/views/jxjs/jdx/data.vue b/ruoyi-ui/src/views/jxjs/jdx/data.vue index 298031144..75a4c77ca 100644 --- a/ruoyi-ui/src/views/jxjs/jdx/data.vue +++ b/ruoyi-ui/src/views/jxjs/jdx/data.vue @@ -285,6 +285,9 @@ export default { }; }, created() { + const jdxId = this.$route.params && this.$route.params.id; + //console.log(jdxId); + this.queryParams.jdxid = jdxId; this.getList(); this.getDicts("sys_user_sex").then((response) => { this.xbOptions = response.data; diff --git a/ruoyi-ui/src/views/jxjs/jdx/index.vue b/ruoyi-ui/src/views/jxjs/jdx/index.vue index 475a47d40..1982a0c11 100644 --- a/ruoyi-ui/src/views/jxjs/jdx/index.vue +++ b/ruoyi-ui/src/views/jxjs/jdx/index.vue @@ -192,22 +192,20 @@ - - - - - - + + - - - + --> + + @@ -217,7 +215,11 @@