diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhItemsController.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhItemsController.java index 52e1722..4cdeb79 100644 --- a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhItemsController.java +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhItemsController.java @@ -4,6 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -79,6 +80,20 @@ public class KhItemsController extends BaseController { return toAjax(khItemsService.insertKhItems(khItems)); } + /** + * 批量新增考核项 + */ + @PreAuthorize("@ss.hasPermi('kaohe:items:add')") + @Log(title = "考核项", businessType = BusinessType.INSERT) + @PostMapping("/adds") + @Transactional + public AjaxResult adds(@RequestBody List khItems) + { + for(KhItems item:khItems){ + khItemsService.insertKhItems(item); + } + return AjaxResult.success(); + } /** * 修改考核项 diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhTemItemController.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhTemItemController.java index 969cf3f..b65df79 100644 --- a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhTemItemController.java +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/controller/KhTemItemController.java @@ -2,8 +2,11 @@ package com.ruoyi.kaohe.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.kaohe.domain.KhItems; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -80,6 +83,21 @@ public class KhTemItemController extends BaseController return toAjax(khTemItemService.insertKhTemItem(khTemItem)); } + /** + * 新增模板考核项关联 + */ + @PreAuthorize("@ss.hasPermi('kaohe:tem_item:add')") + @Log(title = "模板考核项关联", businessType = BusinessType.INSERT) + @PostMapping("/adds") + @Transactional + public AjaxResult adds(@RequestBody List khTemItems) + { + for(KhTemItem khTemItem:khTemItems){ + khTemItemService.insertKhTemItem(khTemItem); + } + return AjaxResult.success(); + } + /** * 修改模板考核项关联 */ diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhTemplate.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhTemplate.java index 3382fb9..381122c 100644 --- a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhTemplate.java +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhTemplate.java @@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import java.util.List; + /** * 考核模板对象 kh_template * @@ -22,15 +24,27 @@ public class KhTemplate extends BaseEntity @Excel(name = "模板名称") private String temName; - /** 考核项id */ +/* *//** 考核项id *//* @Excel(name = "考核项id") private Long khitemId; + *//** 考核项名称 *//* + @Excel(name = "考核项名称") + private String itemName;*/ + /** 考核项名称 */ @Excel(name = "考核项名称") - private String itemName; + private List itemList; + + public List getItems() { + return itemList; + } + + public void setItems(List itemList) { + this.itemList = itemList; + } - public void setId(Long id) + public void setId(Long id) { this.id = id; } @@ -50,7 +64,7 @@ public class KhTemplate extends BaseEntity return temName; } - public void setKhitemId(Long khitemId) +/* public void setKhitemId(Long khitemId) { this.khitemId = khitemId; } @@ -68,15 +82,15 @@ public class KhTemplate extends BaseEntity public String getItemName() { return itemName; - } + }*/ @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("temName", getTemName()) - .append("khitemId", getKhitemId()) - .append("itemName", getItemName()) + /* .append("khitemId", getKhitemId()) + .append("itemName", getItemName())*/ .toString(); } } diff --git a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhVote.java b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhVote.java index 5215ef9..ceac548 100644 --- a/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhVote.java +++ b/ruoyi-kaohe/src/main/java/com/ruoyi/kaohe/domain/KhVote.java @@ -9,9 +9,9 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 投票评测对象 kh_vote - * + * * @author hs - * @date 2025-06-17 + * @date 2025-06-18 */ public class KhVote extends BaseEntity { @@ -20,6 +20,22 @@ public class KhVote extends BaseEntity /** 主键 */ private Long id; + /** 评测id */ + @Excel(name = "评测id") + private Long pingceId; + + /** 评测名称 */ + @Excel(name = "评测名称") + private String pingceName; + + /** 考核项id */ + @Excel(name = "考核项id") + private Long khitemId; + + /** 考核项名称 */ + @Excel(name = "考核项名称") + private String khitemName; + /** 投票主题 */ @Excel(name = "投票主题") private String voteTitle; @@ -42,80 +58,139 @@ public class KhVote extends BaseEntity @Excel(name = "最大投票数") private Long maxNum; - public void setId(Long id) + /** 状态(0 未开始 1 进行中 2 完成) */ + @Excel(name = "状态(0 未开始 1 进行中 2 完成)") + private String state; + + public void setId(Long id) { this.id = id; } - public Long getId() + public Long getId() { return id; } - public void setVoteTitle(String voteTitle) + public void setPingceId(Long pingceId) + { + this.pingceId = pingceId; + } + + public Long getPingceId() + { + return pingceId; + } + + public void setPingceName(String pingceName) + { + this.pingceName = pingceName; + } + + public String getPingceName() + { + return pingceName; + } + + public void setKhitemId(Long khitemId) + { + this.khitemId = khitemId; + } + + public Long getKhitemId() + { + return khitemId; + } + + public void setKhitemName(String khitemName) + { + this.khitemName = khitemName; + } + + public String getKhitemName() + { + return khitemName; + } + + public void setVoteTitle(String voteTitle) { this.voteTitle = voteTitle; } - public String getVoteTitle() + public String getVoteTitle() { return voteTitle; } - public void setvDescription(String vDescription) + public void setvDescription(String vDescription) { this.vDescription = vDescription; } - public String getvDescription() + public String getvDescription() { return vDescription; } - public void setsTime(Date sTime) + public void setsTime(Date sTime) { this.sTime = sTime; } - public Date getsTime() + public Date getsTime() { return sTime; } - public void seteTime(Date eTime) + public void seteTime(Date eTime) { this.eTime = eTime; } - public Date geteTime() + public Date geteTime() { return eTime; } - public void setMaxNum(Long maxNum) + public void setMaxNum(Long maxNum) { this.maxNum = maxNum; } - public Long getMaxNum() + public Long getMaxNum() { return maxNum; } + public void setState(String state) + { + this.state = state; + } + + public String getState() + { + return state; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("voteTitle", getVoteTitle()) - .append("vDescription", getvDescription()) - .append("sTime", getsTime()) - .append("eTime", geteTime()) - .append("maxNum", getMaxNum()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + .append("id", getId()) + .append("pingceId", getPingceId()) + .append("pingceName", getPingceName()) + .append("khitemId", getKhitemId()) + .append("khitemName", getKhitemName()) + .append("voteTitle", getVoteTitle()) + .append("vDescription", getvDescription()) + .append("sTime", getsTime()) + .append("eTime", geteTime()) + .append("maxNum", getMaxNum()) + .append("state", getState()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhTemplateMapper.xml b/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhTemplateMapper.xml index 9dc958f..c89bcc0 100644 --- a/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhTemplateMapper.xml +++ b/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhTemplateMapper.xml @@ -7,8 +7,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - + + + + + @@ -16,11 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhVoteMapper.xml b/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhVoteMapper.xml index 14db896..b53327a 100644 --- a/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhVoteMapper.xml +++ b/ruoyi-kaohe/src/main/resources/mapper/kaohe/KhVoteMapper.xml @@ -1,16 +1,21 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + + + + + @@ -19,20 +24,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, vote_title, v_description, s_time, e_time, max_num, create_by, create_time, update_by, update_time, remark from kh_vote + select id, pingce_id, pingce_name, khitem_id, khitem_name, vote_title, v_description, s_time, e_time, max_num, state, create_by, create_time, update_by, update_time, remark from kh_vote - +