diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java index f3bcf1b6..048e76e2 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java @@ -113,17 +113,19 @@ public class ChaoseTopicPersionController extends JeecgController newList = chooseTopicPersionStatus.get("choose_topic_persion_status"); DictModel dictModel = newList.get(0); String value = dictModel.getText(); - dto.setBmcode(bmcode); - dto.setTimul(topicPersion.getTimul()); - dto.setTimul_dictText(topicService.getById(topicPersion.getTimul()).getName()); - dto.setStatus(topicPersion.getStatus()); - dto.setStatus_dictText(value); - dto.setBlack(topicPersion.getBlack()); - dto.setAnnualCompid(one.getAnnualCompid()); - dto.setAnnualCompid_dictText(annualCompPointService.getById(one.getAnnualCompid()).getObjName()); - dto.setEntryFormat(one.getEntryFormat()); - dto.setEntryFormat_dictText(one.getEntryFormat().equals("0") ? "个人" : "团队"); - dto.setTeamName(one.getTeamName()); + if (topicPersion.getTimul()!=null && topicPersion.getBmcode()!=null) { + dto.setBmcode(bmcode); + dto.setTimul(topicPersion.getTimul()); + dto.setTimul_dictText(topicService.getById(topicPersion.getTimul()).getName()); + dto.setStatus(topicPersion.getStatus()); + dto.setStatus_dictText(value); + dto.setBlack(topicPersion.getBlack()); + dto.setAnnualCompid(one.getAnnualCompid()); + dto.setAnnualCompid_dictText(annualCompPointService.getById(one.getAnnualCompid()).getObjName()); + dto.setEntryFormat(one.getEntryFormat()); + dto.setEntryFormat_dictText(one.getEntryFormat().equals("0") ? "个人" : "团队"); + dto.setTeamName(one.getTeamName()); + } chooseDtos.add(dto); } return Result.OK(chooseDtos); @@ -232,12 +234,18 @@ public class ChaoseTopicPersionController extends JeecgController add(@RequestBody ChaoseTopicPersion chaoseTopicPersion) { + public Result add(@RequestBody ChooseEdit chooseEdit) { + System.out.println(chooseEdit); + ChaoseTopicPersion chaoseTopicPersion = new ChaoseTopicPersion(); + String enrollCode = chooseEdit.getEnrollCode(); + chaoseTopicPersion.setBmcode(enrollCode); + chaoseTopicPersion.setTimul(chooseEdit.getTopicid()); + chaoseTopicPersion.setStatus(chooseEdit.getStatus()); QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("bmcode", chaoseTopicPersion.getBmcode()); - ChaoseTopicPersion one = chaoseTopicPersionService.getOne(queryWrapper); - if (one != null) { - return Result.OK("添加失败!"); + queryWrapper.eq("bmcode", enrollCode); + List one = chaoseTopicPersionService.list(queryWrapper); + if (one.size()>0) { + return Result.OK("当前不可选题!"); } chaoseTopicPersionService.save(chaoseTopicPersion); return Result.OK("添加成功!"); @@ -268,12 +276,7 @@ public class ChaoseTopicPersionController extends JeecgController queryWrapper = new QueryWrapper<>(); queryWrapper.eq("bmcode", enrollCode); ChaoseTopicPersion one = chaoseTopicPersionService.getOne(queryWrapper); - if(one.getBmcode().isEmpty()){ - ChaoseTopicPersion chaoseTopicPersion = new ChaoseTopicPersion(); - chaoseTopicPersion.setBmcode(enrollCode); - one.setStatus(status); - } - + one.setStatus(status); if (status.equals("3")) { one.setBlack(black); } else { diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/entity/ChooseEdit.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/entity/ChooseEdit.java index 2be12b32..04106715 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/entity/ChooseEdit.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/entity/ChooseEdit.java @@ -17,4 +17,5 @@ public class ChooseEdit { private String enrollCode; private String status; private String black; + private String topicid; } diff --git a/jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersion.api.ts b/jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersion.api.ts index 9eb1927e..fba0a063 100644 --- a/jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersion.api.ts +++ b/jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersion.api.ts @@ -66,7 +66,7 @@ export const batchDelete = (params, handleSuccess) => { }); } export const update = (params) => { - return defHttp.post({ url: Api.edit1, params }); + return defHttp.post({ url: Api.save, params }); } export const update1 = (params) => { return defHttp.post({ url: Api.edit1, params }, { isTransformResponse: false }); diff --git a/jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersionList.vue b/jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersionList.vue index efeb5692..987b9ef5 100644 --- a/jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersionList.vue +++ b/jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersionList.vue @@ -65,7 +65,7 @@ import {useListPage} from '/@/hooks/system/useListPage'; import {columns} from './ChaoseTopicPersion.data'; import { list, - update, + update1, deleteOne, batchDelete, getImportUrl, @@ -140,7 +140,7 @@ function handleAdd() { */ function handleEdit1(record: Recordable) { console.log(record, "111112") - update({enrollCode: record.bmcode, status: 2}) + update1({enrollCode: record.bmcode, status: 2}) reload() } diff --git a/jeecgboot-vue3-master/src/views/chooseTopicPersion/components/ChaoseTopicPersionForm.vue b/jeecgboot-vue3-master/src/views/chooseTopicPersion/components/ChaoseTopicPersionForm.vue index 76ffab6e..2bca5426 100644 --- a/jeecgboot-vue3-master/src/views/chooseTopicPersion/components/ChaoseTopicPersionForm.vue +++ b/jeecgboot-vue3-master/src/views/chooseTopicPersion/components/ChaoseTopicPersionForm.vue @@ -22,7 +22,7 @@