From cec63755e6f95f6d2dfd8601f0b696c1f79e8c04 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Mon, 26 Aug 2024 15:23:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9B=A2=E9=98=9F=E8=B5=9B=E9=98=9F?= =?UTF-8?q?=E5=91=98=E4=BD=8D=E6=AC=A1=E6=AF=94=E5=80=BC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/AnnualCompPoint.java | 64 +---- .../impl/PersonalCompScoreServiceImpl.java | 28 +- .../teamseq/controller/TeamSeqController.java | 9 +- .../modules/demo/teamseq/entity/TeamSeq.java | 61 +---- .../components/AnnualCompPointForm.vue | 244 ++++++------------ 5 files changed, 107 insertions(+), 299 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java index 3eafb0d9..bbfeafa3 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java @@ -273,68 +273,20 @@ public class AnnualCompPoint implements Serializable { /** - * 第1序号 + * 位次号 */ - @ApiModelProperty(value = "第1序号") @TableField(exist = false) - private Integer teamSeqFirst; - /** - * 第1序号比值 - */ - @TableField(exist = false) - @ApiModelProperty(value = "第1序号比值") - private Integer teamSeqFirstVal; - - /** - * 第2序号 - */ - @TableField(exist = false) - @ApiModelProperty(value = "第1序号") - private Integer teamSeqSecond; - /** - * 第2序号比值 - */ - @ApiModelProperty(value = "第2序号比值") - @TableField(exist = false) - private Integer teamSeqSecondVal; - - /** - * 第3序号 - */ - @ApiModelProperty(value = "第3序号") - @TableField(exist = false) - private Integer teamSeqThird; - /** - * 第3序号比值 - */ - @ApiModelProperty(value = "第3序号比值") - @TableField(exist = false) - private Integer teamSeqThirdVal; + @Excel(name = "队员在队伍中的位次序号", width = 15) + @ApiModelProperty(value = "队员在队伍中的位次序号") + private Integer teamSeq; /** - * 第4序号 - */ - @ApiModelProperty(value = "第4序号") - @TableField(exist = false) - private Integer teamSeqFourth; - /** - * 第4序号比值 + * 位次号比值 */ - @ApiModelProperty(value = "第4序号比值") @TableField(exist = false) - private Integer teamSeqFourthVal; - /** - * 第5序号 - */ - @ApiModelProperty(value = "第5序号") - @TableField(exist = false) - private Integer teamSeqFifth; - /** - * 第5序号比值 - */ - @ApiModelProperty(value = "第5序号比值") - @TableField(exist = false) - private Integer teamSeqFifthVal; + @Excel(name = "队员在队伍中的位次序号比值", width = 15) + @ApiModelProperty(value = "队员在队伍中的位次序号比值") + private Integer teamSeqVal; } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java index 703d7326..16c7f1cf 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java @@ -39,6 +39,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; /** * @Description: 个人比赛积分 @@ -174,7 +175,8 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl seqList = iTeamSeqService.list(new LambdaQueryWrapper().eq(TeamSeq::getPointId, annualCompPoint.getId())); + score.set(ComputeUtils.mul2(baseScore, this.covertVal(seqList, e))); PersonalCompScore bean = new PersonalCompScore(); bean.setAnnualCompId(annualCompId); bean.setAnnualCompP(annualCompPoint.getId()); @@ -228,27 +230,11 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl teamSeq, TeamManagement en) { Integer weightVal = 100; - if (!ObjectUtils.isEmpty(teamSeq)) { - switch (en.getTeamSeq()) { - case 1: - weightVal = teamSeq.getTeamSeqFifthVal(); - break; - case 2: - weightVal = teamSeq.getTeamSeqSecondVal(); - break; - case 3: - weightVal = teamSeq.getTeamSeqThirdVal(); - break; - case 4: - weightVal = teamSeq.getTeamSeqFourthVal(); - break; - case 5: - weightVal = teamSeq.getTeamSeqFifthVal(); - break; - } + if (!ObjectUtils.isEmpty(teamSeq) && !ObjectUtils.isEmpty(en.getTeamSeq())) { + List seqSet = teamSeq.stream().filter(b -> b.getTeamSeq() == en.getTeamSeq()).collect(Collectors.toList()); + weightVal = seqSet.get(0).getTeamSeqVal(); } double val = ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED); return val; diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java index d4188c8f..ca8b49ae 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java @@ -21,7 +21,9 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; /** * @Description: 团队赛队员积分计算配置 @@ -61,8 +63,11 @@ public class TeamSeqController extends JeecgController @ApiOperation(value = "团队赛队员积分计算配置-分页列表查询", notes = "团队赛队员积分计算配置-分页列表查询") @GetMapping(value = "/listByPointId") - public Result> queryPageList(String pointId) { - return Result.OK(teamSeqService.list(new LambdaQueryWrapper().eq(TeamSeq::getPointId,pointId))); + public Result queryPageList(String pointId) { + List list = teamSeqService.list(new LambdaQueryWrapper().eq(TeamSeq::getPointId, pointId)); + Map map = new LinkedHashMap<>(); + map.put("records",list); + return Result.OK(map); } /** diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java index 01504454..316c056b 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java @@ -68,61 +68,16 @@ public class TeamSeq implements Serializable { @ApiModelProperty(value = "年度比赛项目id") private String pointId; - - /** - * 第1序号 - */ - @Excel(name = "第1序号", width = 15) - @ApiModelProperty(value = "第1序号") - private Integer teamSeqFirst; - /** - * 第1序号比值 - */ - @Excel(name = "第1序号比值", width = 15) - @ApiModelProperty(value = "第1序号比值") - private Integer teamSeqFirstVal; - - /** - * 第2序号 - */ - @ApiModelProperty(value = "第1序号") - private Integer teamSeqSecond; - /** - * 第2序号比值 - */ - @ApiModelProperty(value = "第2序号比值") - private Integer teamSeqSecondVal; - - /** - * 第3序号 - */ - @ApiModelProperty(value = "第3序号") - private Integer teamSeqThird; - /** - * 第3序号比值 - */ - @ApiModelProperty(value = "第3序号比值") - private Integer teamSeqThirdVal; - - /** - * 第4序号 - */ - @ApiModelProperty(value = "第4序号") - private Integer teamSeqFourth; - /** - * 第4序号比值 - */ - @ApiModelProperty(value = "第4序号比值") - private Integer teamSeqFourthVal; - /** - * 第5序号 + * 位次号 */ - @ApiModelProperty(value = "第5序号") - private Integer teamSeqFifth; + @Excel(name = "队员在队伍中的位次序号", width = 15) + @ApiModelProperty(value = "队员在队伍中的位次序号") + private Integer teamSeq; /** - * 第5序号比值 + * 位次号比值 */ - @ApiModelProperty(value = "第5序号比值") - private Integer teamSeqFifthVal; + @Excel(name = "队员在队伍中的位次序号比值", width = 15) + @ApiModelProperty(value = "队员在队伍中的位次序号比值") + private Integer teamSeqVal; } diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue index 75f53436..39c4a9be 100644 --- a/jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue @@ -92,98 +92,22 @@ - - - + - 队伍比值配置 - - + + 配置队伍位次比值 - - - @@ -319,7 +243,8 @@ @register="register" title="比值配置" :height="800" - @ok="handleOk" + :width="800" + :footer="null" > @@ -330,17 +255,18 @@ @@ -364,62 +290,43 @@ const disableSubmit = ref(false); const realForm = ref(); import {JVxeTable} from '/@/components/jeecg/JVxeTable'; import {JVxeColumn, JVxeTypes} from '/@/components/jeecg/JVxeTable/types'; +import {result} from "lodash-es"; // 是否正在加载 const loading = ref(false); -// 分页器参数 -const pagination = reactive({ - // 当前页码 - current: 1, - // 每页的条数 - pageSize: 200, - // 可切换的条数 - pageSizeOptions: ['10', '20', '30', '100', '200'], - // 数据总数(目前并不知道真实的总数,所以先填写0,在后台查出来后再赋值) - total: 0, -}); // 选择的行 const selectedRows = ref([]); // 数据源,控制表格的数据 const dataSource = ref([]); +// 工具栏的按钮配置 +const toolbarConfig = reactive({ + // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮 + btn: ['add', 'save', 'remove', 'clearSelection'], +}); // 列配置,控制表格显示的列 const columns = ref([ // { key: 'num', title: '序号', width: 80, type: JVxeTypes.normal }, - { key: 'teamSeqFirst', title: '序号1', width: 80, type: JVxeTypes.normal }, + // { key: 'pointId', title: '项目id', width: 80, type: JVxeTypes.hidden,}, + { key: 'teamSeq', title: '位次号', width: 180, type: JVxeTypes.inputNumber, + placeholder: '请输入${title}', + validateRules: [ + { + required: true, // 必填 + message: '请输入${title}', // 显示的文本 + } + ], + }, { title: '比值', - key: 'teamSeqFirstVal', - type: JVxeTypes.input, + key: 'teamSeqVal', + type: JVxeTypes.inputNumber, width: 180, - defaultValue: '', + defaultValue: 100, placeholder: '请输入${title}', validateRules: [ { required: true, // 必填 message: '请输入${title}', // 显示的文本 - }, - // { - // pattern: /^[a-z|A-Z][a-z|A-Z\d_-]*$/, // 正则 - // message: '必须以字母开头,可包含数字、下划线、横杠', - // }, - // { - // unique: true, - // message: '${title}不能重复', - // }, - { - handler({cellValue, row, column}, callback, target) { - // cellValue 当前校验的值 - // callback(flag, message) 方法必须执行且只能执行一次 - // flag = 是否通过了校验,不填写或者填写 null 代表不进行任何操作 - // message = 提示的类型,默认使用配置的 message - // target 行编辑的实例对象 - if (cellValue === 'abc') { - callback(false, '${title}不能是abc') // false = 未通过校验 - } else { - callback(true) // true = 通过验证 - } - }, - message: '${title}默认提示', - }, + } ], }, ]) @@ -434,12 +341,11 @@ enum Api { } // 加载数据 -async function loadData() { - alert(formData.id) +function loadData() { + // alert(formData.id) // loading.value = true; // 调用查询数据接口 - await defHttp - .get({ + defHttp.get({ // 请求地址 url: Api.getData, // // 封装查询条件 @@ -448,23 +354,17 @@ async function loadData() { // pageNo: pagination.current, // pageSize: pagination.pageSize, }, - }) - .then((result) => { + }).then((result) => { // 后台查询回来的 total,数据总数量 // pagination.total = result.total; - // 将查询的数据赋值给 dataSource - dataSource.value = result.records; - // 重置选择 - selectedRows.value = []; - }) - .finally(() => { - // 这里是无论成功或失败都会执行的方法,在这里关闭loading - loading.value = false; - }); -} - -function handleOk() { - alert("handleOk") + // 将查询的数据赋值给 dataSource + dataSource.value = result.records; + // 重置选择 + selectedRows.value = []; + }).finally(() => { + // 这里是无论成功或失败都会执行的方法,在这里关闭loading + loading.value = false; + }); } function handleTableSave({$table, target}) { @@ -474,30 +374,53 @@ function handleTableSave({$table, target}) { if (!errMap) { // 获取所有数据 let tableData = target.getTableData(); - console.log('当前保存的数据是:', tableData); + // console.log('$table:', $table); + // console.log('target:', target); + console.log('当前保存的数据(tableData)是:', JSON.stringify(tableData)); + tableData.forEach(item => { + item.pointId = formData.id + }) // 获取新增的数据 - let newData = target.getNewData(); - console.log('-- 新增的数据:', newData); - // 获取删除的数据 - let deleteData = target.getDeleteData(); - console.log('-- 删除的数据:', deleteData); + // let newData = target.getNewData(); + // console.log('-- 新增的数据:', newData); + // for (let itemindex = 0; itemindex < newData.length; itemindex++) { + // this.$set(jsonObject, newData[itemindex].key+"", newData[itemindex].value+""); + // } // 【模拟保存】 - loading.value = true; + // loading.value = true; defHttp .post({ url: Api.saveAll, params: tableData, }) .then(() => { - createMessage.success(`保存成功!`); + // createMessage.success(`保存成功!`); }) .finally(() => { - loading.value = false; + // loading.value = false; }); } }); } +// 触发单元格删除事件 +function handleTableRemove(event) { + // 把 event.deleteRows 传给后台进行删除(注意:这里不会传递前端逻辑新增的数据,因为不需要请求后台删除) + console.log('待删除的数据: ', event.deleteRows); + // 也可以只传ID,因为可以根据ID删除 + let deleteIds = event.deleteRows.map((row) => row.id); + console.log('待删除的数据ids: ', deleteIds); + + // 模拟请求后台删除 + loading.value = true; + window.setTimeout(() => { + loading.value = false; + createMessage.success('删除成功'); + // 假设后台返回删除成功,必须要调用 confirmRemove() 方法,才会真正在表格里移除(会同时删除选中的逻辑新增的数据) + event.confirmRemove(); + }, 1000); +} + const props = defineProps({ // objLevelll: { type: Array, default: () => [] }, formDisabled: {type: Boolean, default: false}, @@ -511,10 +434,7 @@ const [register, {openModal}] = useModal(); // const [register, { closeModal, setModalProps,openModal }] = useModalInner(); const showModel = () => { loadData(); - openModal() - - // console.log(1111) } let num = ref([ @@ -567,16 +487,6 @@ const formData = reactive>({ uploadEndTime: '', scoreStartTime: '', scoreEndTime: '', - teamSeqFirst: 1, - teamSeqSecond: 2, - teamSeqThird: 3, - teamSeqFourth: 4, - teamSeqFifth: 5, - teamSeqFifthVal: '', - teamSeqFourthVal: '', - teamSeqThirdVal: '', - teamSeqSecondVal: '', - teamSeqFirstVal: '', }); const {createMessage} = useMessage(); const labelCol = ref({xs: {span: 24}, sm: {span: 6}}); From 6085628bf974d92d52bd7e909ca4aacd1744f2db Mon Sep 17 00:00:00 2001 From: Gitea Date: Mon, 26 Aug 2024 20:43:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=B9=B3=E5=9D=87?= =?UTF-8?q?=E5=88=86=E9=85=8D=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualCompGroupController.java | 130 ++++++++++++++++++ .../controller/UpfileGroupController.java | 7 +- .../annualcompgroup/AnnualCompGroup.api.ts | 6 + .../annualcompgroup/AnnualCompGroupList1.vue | 16 ++- 4 files changed, 157 insertions(+), 2 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java index 4f72232e..edbb7b0b 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java @@ -15,6 +15,10 @@ 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; @@ -28,10 +32,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; +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.scoresta.entity.ScoreSta; import org.jeecg.modules.demo.scoresta.service.IScoreStaService; +import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion; +import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -75,6 +83,18 @@ public class AnnualCompGroupController extends JeecgController zdfpzp(AnnualCompGroup annualCompGroup, HttpServletRequest req) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + QueryWrapper queryWrappercomp = new QueryWrapper<>(); + queryWrappercomp.eq("comp_admin", user.getUsername()); + List list = compService.list(queryWrappercomp); + if (list.size() == 0) { + return Result.error("分配失败,该用户无负责比赛"); + } + List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.in("compid", ids); + List listAnnual = annualCompService.list(queryWrapperAnnual); + if (listAnnual.size() == 0) { + return Result.error("分配失败,该用户无负责年度比赛"); + } + List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompGroup, req.getParameterMap()); + queryWrapper.in(annualIds.size() != 0, "annal_comp", annualIds); + + + QueryWrapper queryWrapperacp = new QueryWrapper<>(); + queryWrapperacp.in("annual_comp_id", annualIds); + queryWrapperacp.eq("annual_comp_switch", "Y"); // 比赛必须是开启的 + List listacp = annualCompPointService.list(queryWrapperacp); + if (listacp.size() == 0) { + return Result.error("分配失败,该用户无负责年度比赛项目"); + } + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in(acpIds.size() != 0, "ann_comp_p", acpIds); + + List pageList = annualCompGroupService.list(queryWrapper); + if (pageList.size() == 0) { + return Result.error("分配失败,无可分配的专家组"); + } + List annualids = pageList.stream().map(AnnualCompGroup::getAnnal).collect(Collectors.toList()); + List annualcpids = pageList.stream().map(AnnualCompGroup::getAnnCompP).collect(Collectors.toList()); + QueryWrapper queryWrapperup = new QueryWrapper<>(); + queryWrapperup.in("annual_id", annualids); + queryWrapperup.in("annual_comp_point_id", annualcpids); + queryWrapperup.eq("status", "0"); + + QueryWrapper queryWrapperagt = new QueryWrapper<>(); + //queryWrapperagt.eq("ann_com_gro_topid",xmtmid); + queryWrapperagt.in("annid", annualids); + queryWrapperagt.in("ann_com_p", annualcpids); + List listact = annComGroTopPService.list(queryWrapperagt); + String str = ""; + for (int i = 0; i < listact.size(); i++) { + str = str + listact.get(i).getBmcode() + ","; + } + if (str != "") { + queryWrapperup.notIn("apply_code", str.split(",")); + } + List listup = upfilePersionService.list(queryWrapperup); + //作品的年度比赛项目必须和组的年度比赛项目相同才可以分配作品 + for (int o = 0; o < listup.size(); o++) { + QueryWrapper queryWrapperctp1 = new QueryWrapper<>(); + queryWrapperctp1.eq("bmcode", listup.get(o).getApplyCode()); + List listctp1 = chaoseTopicPersionService.list(queryWrapperctp1); + if (listctp1.size() == 0) { + return Result.error(listup.get(o).getTopicName() + "未选题,绑定失败!"); + } + } + //List acgids = pageList.stream().map(AnnualCompGroup::getId).collect(Collectors.toList()); + int upsum = listup.size(); + int acgsum = pageList.size(); + int pjz = upsum / acgsum; + int syz = upsum % acgsum; + + for (int y = 0; y < pageList.size(); y++) { + QueryWrapper queryWrapperatp = new QueryWrapper<>(); + queryWrapperatp.eq("ann_com_p_g", pageList.get(y).getId()); + List listtop = annComGroTopService.list(queryWrapperatp); + int upnum = 0; + for (int i = 0; i < listup.size(); i++) { + if(upnum==pjz&&pjz!=0&&listup.size()>syz){ + break; + } + for (int k = 0; k < listtop.size(); k++) { + QueryWrapper queryWrapperctp = new QueryWrapper<>(); + queryWrapperctp.eq("bmcode", listup.get(i).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(listup.get(i).getApplyCode()); + annComGroTopP.setAnnid(listtop.get(k).getAnnid()); + annComGroTopP.setAnnComP(listtop.get(k).getAnnComP()); + annComGroTopP.setAnnComPG(listtop.get(k).getAnnComPG()); + annComGroTopP.setTopicName(listup.get(i).getTopicName()); + annComGroTopP.setTopid(listtop.get(k).getTopid()); + annComGroTopPService.save(annComGroTopP); + listup.remove(i); + upnum++; + i=-1; + break; + } + } + } + } + return Result.OK("自动分配作品成功"); + } + } 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 49a669a3..9ed2ed75 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 @@ -25,6 +25,7 @@ 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.annualcompgroup.service.IAnnualCompGroupService; import org.jeecg.modules.demo.chooseTopicPersion.entity.ChaoseTopicPersion; import org.jeecg.modules.demo.chooseTopicPersion.service.IChaoseTopicPersionService; import org.jeecg.modules.demo.comp.entity.Comp; @@ -96,6 +97,9 @@ public class UpfileGroupController extends JeecgController zpidslisttemp = new ArrayList<>(); zpidslisttemp.addAll(zpidslist); + String ndbsxmid = annualCompGroupService.getById(xmtmid).getAnnCompP(); for (int h = 0 ; h < zpidslisttemp.size() ; h++){ QueryWrapper queryWrappertpp = new QueryWrapper<>(); - queryWrappertpp.eq("ann_com_p_g",xmtmid); + queryWrappertpp.eq("ann_com_p",ndbsxmid); 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())){ diff --git a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts index 677c1406..8616152f 100644 --- a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts +++ b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts @@ -13,6 +13,12 @@ enum Api { exportXls = '/annualcompgroup/annualCompGroup/exportXls', queryCompId = '/annualcompgroup/annualCompGroup/queryCompId', saveTop = '/topic/topic/szadd', + zdfpzp = '/annualcompgroup/annualCompGroup/zdfpzp', +} + +export const zdfpzp = () => { + let url = Api.zdfpzp; + return defHttp.get({ url: url}, { isTransformResponse: false }); } /** diff --git a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList1.vue b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList1.vue index 76289887..63812aa2 100644 --- a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList1.vue +++ b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList1.vue @@ -36,6 +36,7 @@ + 自动分配作品