diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java index b282d1d3..49a669a3 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java @@ -1,5 +1,6 @@ package org.jeecg.modules.demo.upfilegroup.controller; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -15,13 +16,21 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.anncomgrotop.entity.AnnComGroTop; +import org.jeecg.modules.demo.anncomgrotop.service.IAnnComGroTopService; +import org.jeecg.modules.demo.anncomgrotopp.entity.AnnComGroTopP; +import org.jeecg.modules.demo.anncomgrotopp.service.IAnnComGroTopPService; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup; +import org.jeecg.modules.demo.chooseTopicPersion.entity.ChaoseTopicPersion; +import org.jeecg.modules.demo.chooseTopicPersion.service.IChaoseTopicPersionService; import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.service.ICompService; +import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion; +import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService; import org.jeecg.modules.demo.upfilegroup.entity.UpfileGroup; import org.jeecg.modules.demo.upfilegroup.service.IUpfileGroupService; @@ -30,6 +39,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.demo.upfilegroupassociation.entity.UpfileGroupAssociation; +import org.jeecg.modules.demo.upfilegroupassociation.service.IUpfileGroupAssociationService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -70,6 +81,21 @@ public class UpfileGroupController extends JeecgController> bdzpzlist(UpfileGroup upfileGroup, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) { + AnnComGroTop annComGroTop = new AnnComGroTop(); + QueryWrapper queryWrappertop = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap()); + queryWrappertop.eq("ann_com_p_g",xmtmid); + List listtop = annComGroTopService.list(queryWrappertop); + if(listtop.size()>0){ + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(upfileGroup, req.getParameterMap()); + queryWrapper.eq("annid",listtop.get(0).getAnnid()); + queryWrapper.eq("ann_com_p",listtop.get(0).getAnnComP()); + Page page = new Page(pageNo, pageSize); + IPage pageList = upfileGroupService.page(page, queryWrapper); + return Result.OK(pageList); + }else { + return Result.OK(null); + } + + } + /** + * 绑定作品组添加 + * + * @param + * @return + */ + @AutoLog(value = "绑定作品组添加-添加") + @ApiOperation(value = "绑定作品组添加-添加", notes = "绑定作品组添加-添加") +// @RequiresPermissions("chooseTopicPersion:chaose_topic_persion:add") + @GetMapping(value = "/bdzpzlistadd") + public Result bdzpzlistadd(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="xmtmid",required=true) String xmtmid,HttpServletRequest req) { + String strs[] = ids.split(","); + //根据作品组id查询该组下有哪些作品需要绑定 + List zpidslist = new ArrayList<>(); + for (int o = 0 ; o < strs.length ; o++){ + QueryWrapper queryWrapperuga = new QueryWrapper<>(); + queryWrapperuga.eq("upfile_group_id",strs[o]); + List listuga = upfileGroupAssociationService.list(queryWrapperuga); + for (int p = 0 ; p < listuga.size() ; p++){ + UpfilePersion upfilePersion = upfilePersionService.getById(listuga.get(p).getUpfileId()); + QueryWrapper queryWrapperctp1 = new QueryWrapper<>(); + queryWrapperctp1.eq("bmcode",upfilePersion.getApplyCode()); + List listctp1 = chaoseTopicPersionService.list(queryWrapperctp1); + if(listctp1.size()==0){ + return Result.error(upfileGroupService.getById(strs[o]).getName()+"中"+upfilePersion.getTopicName()+"未选题,绑定失败!"); + } + + } + if(listuga.size()>0){ + List zpids = listuga.stream().map(UpfileGroupAssociation::getUpfileId).collect(Collectors.toList()); + zpidslist.addAll(zpids); + } + + } + //去除已绑定作品id + List zpidslisttemp = new ArrayList<>(); + zpidslisttemp.addAll(zpidslist); + for (int h = 0 ; h < zpidslisttemp.size() ; h++){ + QueryWrapper queryWrappertpp = new QueryWrapper<>(); + queryWrappertpp.eq("ann_com_p_g",xmtmid); + List listtopp = annComGroTopPService.list(queryWrappertpp); + for (int r = 0 ; r < listtopp.size() ; r++){ + if(listtopp.get(r).getBmcode().equals(upfilePersionService.getById(zpidslisttemp.get(h)).getApplyCode())){ + zpidslist.remove(zpidslisttemp.get(h)); + } + } + + } + if(zpidslist.size()>0){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("ann_com_p_g",xmtmid); + List listtop = annComGroTopService.list(queryWrapper); + for (int i = 0 ; i < zpidslist.size() ; i++){ + for (int k = 0 ; k < listtop.size() ;k++){ + UpfilePersion upfilePersion = upfilePersionService.getById(zpidslist.get(i)); + QueryWrapper queryWrapperctp = new QueryWrapper<>(); + queryWrapperctp.eq("bmcode",upfilePersion.getApplyCode()); + List listctp = chaoseTopicPersionService.list(queryWrapperctp); + if(listtop.get(k).getTopid().equals(listctp.get(0).getTimul())){ + AnnComGroTopP annComGroTopP = new AnnComGroTopP(); + annComGroTopP.setAnnComGroTopid(listtop.get(k).getId()); + annComGroTopP.setBmcode(upfilePersion.getApplyCode()); + annComGroTopP.setAnnid(listtop.get(k).getAnnid()); + annComGroTopP.setAnnComP(listtop.get(k).getAnnComP()); + annComGroTopP.setAnnComPG(listtop.get(k).getAnnComPG()); + annComGroTopP.setTopicName(upfilePersion.getTopicName()); + annComGroTopP.setTopid(listtop.get(k).getTopid()); + annComGroTopPService.save(annComGroTopP); + } + } + } + } + + return Result.OK("绑定成功!"); + } + + /** * 添加 * diff --git a/jeecgboot-vue3-master/src/views/anncomgrotopp/components/AnnComGroTopPModal1.vue b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/AnnComGroTopPModal1.vue new file mode 100644 index 00000000..499722d4 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/AnnComGroTopPModal1.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroup.api.ts b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroup.api.ts new file mode 100644 index 00000000..bb1c7670 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroup.api.ts @@ -0,0 +1,75 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/upfilegroup/upfileGroup/bdzpzlist', + save='/upfilegroup/upfileGroup/bdzpzlistadd', + edit='/upfilegroup/upfileGroup/edit', + deleteOne = '/upfilegroup/upfileGroup/delete', + deleteBatch = '/upfilegroup/upfileGroup/deleteBatch', + importExcel = '/upfilegroup/upfileGroup/importExcel', + exportXls = '/upfilegroup/upfileGroup/exportXls', + queryCompId = '/annualcompgroup/annualCompGroup/queryCompId', +} + +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; + +/** + * 列表接口 + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 删除单个 + * @param params + * @param handleSuccess + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} + +/** + * 批量删除 + * @param params + * @param handleSuccess + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} + +/** + * 保存或者更新 + * @param params + * @param isUpdate + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.get({ url: url, params }, { isTransformResponse: false }); +} + +export const queryCompId = (params) => defHttp.get({ url: Api.queryCompId, params }, { successMessageMode: 'none' }); diff --git a/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroup.data.ts b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroup.data.ts new file mode 100644 index 00000000..c8c3bec5 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroup.data.ts @@ -0,0 +1,58 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '年度', + align: "center", + dataIndex: 'annid_dictText' + }, + { + title: '年度比赛', + align: "center", + dataIndex: 'annalComp_dictText' + }, + { + title: '年度比赛项目', + align: "center", + dataIndex: 'annComP_dictText' + }, + { + title: '作品组名称', + align: "center", + dataIndex: 'name' + }, +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = [ + { + label: "作品组名称", + field: 'name', + component: 'Input', + colProps: {span: 6}, + }, +]; + +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '作品组名称', + field: 'name', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入作品组名称!'}, + ]; + }, + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, +]; diff --git a/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroupList.vue b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroupList.vue new file mode 100644 index 00000000..14165d00 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/UpfileGroupList.vue @@ -0,0 +1,279 @@ + + + + +