main
王家东 4 months ago
parent 4ba49e8453
commit 0a2c110591
  1. 23
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java
  2. 1
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/entity/ChooseEdit.java
  3. 2
      jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersion.api.ts
  4. 4
      jeecgboot-vue3-master/src/views/chooseTopicPersion/ChaoseTopicPersionList.vue
  5. 2
      jeecgboot-vue3-master/src/views/chooseTopicPersion/components/ChaoseTopicPersionForm.vue

@ -113,6 +113,7 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
List<DictModel> newList = chooseTopicPersionStatus.get("choose_topic_persion_status"); List<DictModel> newList = chooseTopicPersionStatus.get("choose_topic_persion_status");
DictModel dictModel = newList.get(0); DictModel dictModel = newList.get(0);
String value = dictModel.getText(); String value = dictModel.getText();
if (topicPersion.getTimul()!=null && topicPersion.getBmcode()!=null) {
dto.setBmcode(bmcode); dto.setBmcode(bmcode);
dto.setTimul(topicPersion.getTimul()); dto.setTimul(topicPersion.getTimul());
dto.setTimul_dictText(topicService.getById(topicPersion.getTimul()).getName()); dto.setTimul_dictText(topicService.getById(topicPersion.getTimul()).getName());
@ -124,6 +125,7 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
dto.setEntryFormat(one.getEntryFormat()); dto.setEntryFormat(one.getEntryFormat());
dto.setEntryFormat_dictText(one.getEntryFormat().equals("0") ? "个人" : "团队"); dto.setEntryFormat_dictText(one.getEntryFormat().equals("0") ? "个人" : "团队");
dto.setTeamName(one.getTeamName()); dto.setTeamName(one.getTeamName());
}
chooseDtos.add(dto); chooseDtos.add(dto);
} }
return Result.OK(chooseDtos); return Result.OK(chooseDtos);
@ -232,12 +234,18 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
@ApiOperation(value = "比赛选题-添加", notes = "比赛选题-添加") @ApiOperation(value = "比赛选题-添加", notes = "比赛选题-添加")
// @RequiresPermissions("chooseTopicPersion:chaose_topic_persion:add") // @RequiresPermissions("chooseTopicPersion:chaose_topic_persion:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody ChaoseTopicPersion chaoseTopicPersion) { public Result<String> 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<ChaoseTopicPersion> queryWrapper = new QueryWrapper<>(); QueryWrapper<ChaoseTopicPersion> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("bmcode", chaoseTopicPersion.getBmcode()); queryWrapper.eq("bmcode", enrollCode);
ChaoseTopicPersion one = chaoseTopicPersionService.getOne(queryWrapper); List<ChaoseTopicPersion> one = chaoseTopicPersionService.list(queryWrapper);
if (one != null) { if (one.size()>0) {
return Result.OK("添加失败!"); return Result.OK("当前不可选题!");
} }
chaoseTopicPersionService.save(chaoseTopicPersion); chaoseTopicPersionService.save(chaoseTopicPersion);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
@ -268,12 +276,7 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
QueryWrapper<ChaoseTopicPersion> queryWrapper = new QueryWrapper<>(); QueryWrapper<ChaoseTopicPersion> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("bmcode", enrollCode); queryWrapper.eq("bmcode", enrollCode);
ChaoseTopicPersion one = chaoseTopicPersionService.getOne(queryWrapper); 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")) { if (status.equals("3")) {
one.setBlack(black); one.setBlack(black);
} else { } else {

@ -17,4 +17,5 @@ public class ChooseEdit {
private String enrollCode; private String enrollCode;
private String status; private String status;
private String black; private String black;
private String topicid;
} }

@ -66,7 +66,7 @@ export const batchDelete = (params, handleSuccess) => {
}); });
} }
export const update = (params) => { export const update = (params) => {
return defHttp.post({ url: Api.edit1, params }); return defHttp.post({ url: Api.save, params });
} }
export const update1 = (params) => { export const update1 = (params) => {
return defHttp.post({ url: Api.edit1, params }, { isTransformResponse: false }); return defHttp.post({ url: Api.edit1, params }, { isTransformResponse: false });

@ -65,7 +65,7 @@ import {useListPage} from '/@/hooks/system/useListPage';
import {columns} from './ChaoseTopicPersion.data'; import {columns} from './ChaoseTopicPersion.data';
import { import {
list, list,
update, update1,
deleteOne, deleteOne,
batchDelete, batchDelete,
getImportUrl, getImportUrl,
@ -140,7 +140,7 @@ function handleAdd() {
*/ */
function handleEdit1(record: Recordable) { function handleEdit1(record: Recordable) {
console.log(record, "111112") console.log(record, "111112")
update({enrollCode: record.bmcode, status: 2}) update1({enrollCode: record.bmcode, status: 2})
reload() reload()
} }

@ -22,7 +22,7 @@
<!-- {{formData1}}--> <!-- {{formData1}}-->
<a-select <a-select
v-if="isTimeSelect" v-if="isTimeSelect"
v-model:value="formData.id" v-model:value="formData.timul"
style="width: 400px" :disabled="formData.status!=0&&formData.status!=3" style="width: 400px" :disabled="formData.status!=0&&formData.status!=3"
:default-value="formData.id" :default-value="formData.id"
@change="selectChange" @change="selectChange"

Loading…
Cancel
Save