diff --git a/src/main/java/club/joylink/rtss/configuration/WebConfig.java b/src/main/java/club/joylink/rtss/configuration/WebConfig.java index 0b7af8003..0170426ad 100644 --- a/src/main/java/club/joylink/rtss/configuration/WebConfig.java +++ b/src/main/java/club/joylink/rtss/configuration/WebConfig.java @@ -62,6 +62,9 @@ public class WebConfig implements WebMvcConfigurer { whiteList.add("/api/test/**"); whiteList.add("/api/project/viewSetting/simple/all"); whiteList.add("/api/project/viewSetting/project/{project}"); + //旧数据处理 + whiteList.add("/api/org/oldData/handle"); + whiteList.add("/api/mapFunction/oldDataHandle"); registry.addInterceptor(authenticateInterceptor).excludePathPatterns(whiteList); } diff --git a/src/main/java/club/joylink/rtss/controller/org/OrgProjectController.java b/src/main/java/club/joylink/rtss/controller/org/OrgProjectController.java index 283fdda6d..652f3a889 100644 --- a/src/main/java/club/joylink/rtss/controller/org/OrgProjectController.java +++ b/src/main/java/club/joylink/rtss/controller/org/OrgProjectController.java @@ -1,15 +1,16 @@ package club.joylink.rtss.controller.org; -import club.joylink.rtss.dao.org.OrgProjectDao; -import club.joylink.rtss.entity.org.OrgProject; +import club.joylink.rtss.dao.OrgDAO; +import club.joylink.rtss.dao.OrgProjectDAO; +import club.joylink.rtss.entity.Org; +import club.joylink.rtss.entity.OrgExample; +import club.joylink.rtss.entity.OrgProject; import club.joylink.rtss.services.org.IOrgProjectService; -import club.joylink.rtss.services.org.OrgService; import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.client.org.OrgProjectVO; -import club.joylink.rtss.vo.client.org.OrgVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; @@ -42,9 +43,9 @@ public class OrgProjectController { } @Autowired - private OrgProjectDao orgProjectDao; + private OrgProjectDAO orgProjectDAO; @Autowired - private OrgService orgService; + private OrgDAO orgDAO; /** * 旧数据处理(用完删除) @@ -52,20 +53,22 @@ public class OrgProjectController { @Transactional(rollbackFor = Exception.class) @PostMapping("/oldData/handle") public void oldDataHandle() { - orgProjectDao.deleteByExample(null); + orgProjectDAO.deleteByExample(null); OrgProject orgProject = new OrgProject(); orgProject.setCreateTime(LocalDateTime.now()); orgProject.setCreatorId(1L); - List orgs = orgService.queryAllTopOrg(); - for (OrgVO org : orgs) { - List projectCodes = org.getProjectCodes(); - if (!CollectionUtils.isEmpty(projectCodes)) { - for (String projectCode : projectCodes) { + OrgExample orgExample = new OrgExample(); + orgExample.createCriteria().andStatusEqualTo("1").andParentIdIsNull(); + List orgs = orgDAO.selectByExample(orgExample); + for (Org org : orgs) { + String projectCodeStr = org.getProjectCode(); + if (StringUtils.hasText(projectCodeStr)) { + for (String projectCode : projectCodeStr.split(",")) { orgProject.setId(null); orgProject.setOrgId(org.getId()); orgProject.setProjectCode(projectCode); - orgProjectDao.insert(orgProject); + orgProjectDAO.insert(orgProject); } } } diff --git a/src/main/java/club/joylink/rtss/controller/paper/PaperCompositionController.java b/src/main/java/club/joylink/rtss/controller/paper/PaperCompositionController.java index 5a455a005..3a6d33ddb 100644 --- a/src/main/java/club/joylink/rtss/controller/paper/PaperCompositionController.java +++ b/src/main/java/club/joylink/rtss/controller/paper/PaperCompositionController.java @@ -2,16 +2,10 @@ package club.joylink.rtss.controller.paper; import club.joylink.rtss.constants.RoleEnum; import club.joylink.rtss.controller.advice.Role; -import club.joylink.rtss.dao.ExamDefinitionDAO; -import club.joylink.rtss.dao.OrgDAO; -import club.joylink.rtss.dao.UserExamMapper; -import club.joylink.rtss.dao.org.OrgProjectDao; +import club.joylink.rtss.dao.*; import club.joylink.rtss.dao.paper.PaperCompositionDAO; import club.joylink.rtss.dao.paper.PaperUserDAO; -import club.joylink.rtss.entity.ExamDefinitionExample; -import club.joylink.rtss.entity.UserExam; -import club.joylink.rtss.entity.UserExamExample; -import club.joylink.rtss.entity.org.OrgProject; +import club.joylink.rtss.entity.*; import club.joylink.rtss.entity.paper.PaperUser; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.services.IMapService; @@ -160,13 +154,15 @@ public class PaperCompositionController { @Autowired OrgDAO orgDAO; @Autowired - OrgProjectDao orgProjectDao; + OrgProjectDAO orgProjectDAO; @Autowired UserExamMapper userExamMapper; @Autowired private PaperUserDAO paperUserDAO; @Autowired PaperCompositionDAO paperCompositionDAO; + @Autowired + LsLessonDAO lsLessonDAO; /** * 旧数据处理接口(用完删除) @@ -180,11 +176,16 @@ public class PaperCompositionController { List msg = new ArrayList<>(); //所有在线地图 Map onlineMaps = iMapService.listOnline().stream().collect(Collectors.toMap(MapVO::getId, Function.identity())); + //在线地图的有效试卷 + LsLessonExample lsLessonExample = new LsLessonExample(); + lsLessonExample.createCriteria().andMapIdIn(new ArrayList<>(onlineMaps.keySet())).andStatusEqualTo("1"); + List validLessonIds = lsLessonDAO.selectByExample(lsLessonExample) + .stream().map(LsLesson::getId).collect(Collectors.toList()); //所有项目-组织对应关系 - Map projectCode_orgId_map = orgProjectDao.selectByExample(null).stream().collect(Collectors.toMap(OrgProject::getProjectCode, OrgProject::getOrgId)); + Map projectCode_orgId_map = orgProjectDAO.selectByExample(null).stream().collect(Collectors.toMap(OrgProject::getProjectCode, OrgProject::getOrgId)); //转化试卷并记录试卷id变化 ExamDefinitionExample examDefinitionExample = new ExamDefinitionExample(); - examDefinitionExample.createCriteria().andStatusEqualTo("1").andMapIdIn(new ArrayList<>(onlineMaps.keySet())); + examDefinitionExample.createCriteria().andStatusEqualTo("1").andLessonIdIn(validLessonIds); Map old_newExamIdMap = new HashMap<>(); examDefinitionDAO.selectByExample(examDefinitionExample).stream() .peek(exam -> { diff --git a/src/main/java/club/joylink/rtss/dao/OrgProjectDAO.java b/src/main/java/club/joylink/rtss/dao/OrgProjectDAO.java new file mode 100644 index 000000000..9e86371ff --- /dev/null +++ b/src/main/java/club/joylink/rtss/dao/OrgProjectDAO.java @@ -0,0 +1,12 @@ +package club.joylink.rtss.dao; + +import club.joylink.rtss.entity.OrgProject; +import club.joylink.rtss.entity.OrgProjectExample; +import org.springframework.stereotype.Repository; + +/** + * OrgProjectDAO继承基类 + */ +@Repository +public interface OrgProjectDAO extends MyBatisBaseDao { +} diff --git a/src/main/java/club/joylink/rtss/dao/org/OrgProjectDao.java b/src/main/java/club/joylink/rtss/dao/org/OrgProjectDao.java deleted file mode 100644 index 9993ffdea..000000000 --- a/src/main/java/club/joylink/rtss/dao/org/OrgProjectDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package club.joylink.rtss.dao.org; - -import club.joylink.rtss.dao.MyBatisBaseDao; -import club.joylink.rtss.entity.org.OrgProject; -import club.joylink.rtss.entity.org.OrgProjectExample; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 组织与项目关系 - */ -@Repository -public interface OrgProjectDao extends MyBatisBaseDao { - - int deleteByExampleSelective(@Param("example") OrgProjectExample example); -} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/OrgProject.java b/src/main/java/club/joylink/rtss/entity/OrgProject.java new file mode 100644 index 000000000..1959f81e2 --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/OrgProject.java @@ -0,0 +1,124 @@ +package club.joylink.rtss.entity; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @author + * + */ +public class OrgProject implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 组织ID + */ + private Long orgId; + + /** + * 项目编码 + */ + private String projectCode; + + /** + * 创建者 + */ + private Long creatorId; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public String getProjectCode() { + return projectCode; + } + + public void setProjectCode(String projectCode) { + this.projectCode = projectCode; + } + + public Long getCreatorId() { + return creatorId; + } + + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + OrgProject other = (OrgProject) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getOrgId() == null ? other.getOrgId() == null : this.getOrgId().equals(other.getOrgId())) + && (this.getProjectCode() == null ? other.getProjectCode() == null : this.getProjectCode().equals(other.getProjectCode())) + && (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getOrgId() == null) ? 0 : getOrgId().hashCode()); + result = prime * result + ((getProjectCode() == null) ? 0 : getProjectCode().hashCode()); + result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", orgId=").append(orgId); + sb.append(", projectCode=").append(projectCode); + sb.append(", creatorId=").append(creatorId); + sb.append(", createTime=").append(createTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/src/main/java/club/joylink/rtss/entity/org/OrgProjectExample.java b/src/main/java/club/joylink/rtss/entity/OrgProjectExample.java similarity index 85% rename from src/main/java/club/joylink/rtss/entity/org/OrgProjectExample.java rename to src/main/java/club/joylink/rtss/entity/OrgProjectExample.java index 7fff5a11f..7ec6e2012 100644 --- a/src/main/java/club/joylink/rtss/entity/org/OrgProjectExample.java +++ b/src/main/java/club/joylink/rtss/entity/OrgProjectExample.java @@ -1,7 +1,7 @@ -package club.joylink.rtss.entity.org; +package club.joylink.rtss.entity; +import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Date; import java.util.List; public class OrgProjectExample { @@ -11,6 +11,10 @@ public class OrgProjectExample { protected List oredCriteria; + private Integer limit; + + private Long offset; + public OrgProjectExample() { oredCriteria = new ArrayList(); } @@ -64,6 +68,22 @@ public class OrgProjectExample { distinct = false; } + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + protected abstract static class GeneratedCriteria { protected List criteria; @@ -115,52 +135,52 @@ public class OrgProjectExample { return (Criteria) this; } - public Criteria andIdEqualTo(Integer value) { + public Criteria andIdEqualTo(Long value) { addCriterion("id =", value, "id"); return (Criteria) this; } - public Criteria andIdNotEqualTo(Integer value) { + public Criteria andIdNotEqualTo(Long value) { addCriterion("id <>", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThan(Integer value) { + public Criteria andIdGreaterThan(Long value) { addCriterion("id >", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(Integer value) { + public Criteria andIdGreaterThanOrEqualTo(Long value) { addCriterion("id >=", value, "id"); return (Criteria) this; } - public Criteria andIdLessThan(Integer value) { + public Criteria andIdLessThan(Long value) { addCriterion("id <", value, "id"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(Integer value) { + public Criteria andIdLessThanOrEqualTo(Long value) { addCriterion("id <=", value, "id"); return (Criteria) this; } - public Criteria andIdIn(List values) { + public Criteria andIdIn(List values) { addCriterion("id in", values, "id"); return (Criteria) this; } - public Criteria andIdNotIn(List values) { + public Criteria andIdNotIn(List values) { addCriterion("id not in", values, "id"); return (Criteria) this; } - public Criteria andIdBetween(Integer value1, Integer value2) { + public Criteria andIdBetween(Long value1, Long value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } - public Criteria andIdNotBetween(Integer value1, Integer value2) { + public Criteria andIdNotBetween(Long value1, Long value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } @@ -305,52 +325,52 @@ public class OrgProjectExample { return (Criteria) this; } - public Criteria andCreatorIdEqualTo(Integer value) { + public Criteria andCreatorIdEqualTo(Long value) { addCriterion("creator_id =", value, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdNotEqualTo(Integer value) { + public Criteria andCreatorIdNotEqualTo(Long value) { addCriterion("creator_id <>", value, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdGreaterThan(Integer value) { + public Criteria andCreatorIdGreaterThan(Long value) { addCriterion("creator_id >", value, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdGreaterThanOrEqualTo(Integer value) { + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { addCriterion("creator_id >=", value, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdLessThan(Integer value) { + public Criteria andCreatorIdLessThan(Long value) { addCriterion("creator_id <", value, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdLessThanOrEqualTo(Integer value) { + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { addCriterion("creator_id <=", value, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdIn(List values) { + public Criteria andCreatorIdIn(List values) { addCriterion("creator_id in", values, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdNotIn(List values) { + public Criteria andCreatorIdNotIn(List values) { addCriterion("creator_id not in", values, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdBetween(Integer value1, Integer value2) { + public Criteria andCreatorIdBetween(Long value1, Long value2) { addCriterion("creator_id between", value1, value2, "creatorId"); return (Criteria) this; } - public Criteria andCreatorIdNotBetween(Integer value1, Integer value2) { + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { addCriterion("creator_id not between", value1, value2, "creatorId"); return (Criteria) this; } @@ -365,57 +385,59 @@ public class OrgProjectExample { return (Criteria) this; } - public Criteria andCreateTimeEqualTo(Date value) { + public Criteria andCreateTimeEqualTo(LocalDateTime value) { addCriterion("create_time =", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeNotEqualTo(Date value) { + public Criteria andCreateTimeNotEqualTo(LocalDateTime value) { addCriterion("create_time <>", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeGreaterThan(Date value) { + public Criteria andCreateTimeGreaterThan(LocalDateTime value) { addCriterion("create_time >", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + public Criteria andCreateTimeGreaterThanOrEqualTo(LocalDateTime value) { addCriterion("create_time >=", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeLessThan(Date value) { + public Criteria andCreateTimeLessThan(LocalDateTime value) { addCriterion("create_time <", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + public Criteria andCreateTimeLessThanOrEqualTo(LocalDateTime value) { addCriterion("create_time <=", value, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeIn(List values) { + public Criteria andCreateTimeIn(List values) { addCriterion("create_time in", values, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeNotIn(List values) { + public Criteria andCreateTimeNotIn(List values) { addCriterion("create_time not in", values, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeBetween(Date value1, Date value2) { + public Criteria andCreateTimeBetween(LocalDateTime value1, LocalDateTime value2) { addCriterion("create_time between", value1, value2, "createTime"); return (Criteria) this; } - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + public Criteria andCreateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { addCriterion("create_time not between", value1, value2, "createTime"); return (Criteria) this; } } + /** + */ public static class Criteria extends GeneratedCriteria { protected Criteria() { @@ -508,4 +530,4 @@ public class OrgProjectExample { this(condition, value, secondValue, null); } } -} \ No newline at end of file +} diff --git a/src/main/java/club/joylink/rtss/entity/org/OrgProject.java b/src/main/java/club/joylink/rtss/entity/org/OrgProject.java deleted file mode 100644 index 120e468f1..000000000 --- a/src/main/java/club/joylink/rtss/entity/org/OrgProject.java +++ /dev/null @@ -1,18 +0,0 @@ -package club.joylink.rtss.entity.org; - -import lombok.Data; - -import java.time.LocalDateTime; - -@Data -public class OrgProject { - private Long id; - - private Long orgId; - - private String projectCode; - - private Long creatorId; - - private LocalDateTime createTime; -} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/services/org/IOrgProjectService.java b/src/main/java/club/joylink/rtss/services/org/IOrgProjectService.java index ffc62c8c3..60a348a9d 100644 --- a/src/main/java/club/joylink/rtss/services/org/IOrgProjectService.java +++ b/src/main/java/club/joylink/rtss/services/org/IOrgProjectService.java @@ -1,6 +1,6 @@ package club.joylink.rtss.services.org; -import club.joylink.rtss.entity.org.OrgProject; +import club.joylink.rtss.entity.OrgProject; import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.client.org.OrgProjectVO; diff --git a/src/main/java/club/joylink/rtss/services/org/OrgProjectService.java b/src/main/java/club/joylink/rtss/services/org/OrgProjectService.java index fb2da28c5..533e33f9a 100644 --- a/src/main/java/club/joylink/rtss/services/org/OrgProjectService.java +++ b/src/main/java/club/joylink/rtss/services/org/OrgProjectService.java @@ -2,14 +2,9 @@ package club.joylink.rtss.services.org; import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.dao.OrgDAO; +import club.joylink.rtss.dao.OrgProjectDAO; import club.joylink.rtss.dao.OrgUserDAO; -import club.joylink.rtss.dao.org.OrgProjectDao; -import club.joylink.rtss.entity.Org; -import club.joylink.rtss.entity.OrgExample; -import club.joylink.rtss.entity.OrgUser; -import club.joylink.rtss.entity.OrgUserExample; -import club.joylink.rtss.entity.org.OrgProject; -import club.joylink.rtss.entity.org.OrgProjectExample; +import club.joylink.rtss.entity.*; import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.vo.AccountVO; @@ -33,7 +28,7 @@ import java.util.stream.Collectors; @Service public class OrgProjectService implements IOrgProjectService { @Autowired - private OrgProjectDao orgProjectDao; + private OrgProjectDAO orgProjectDAO; @Autowired private OrgUserDAO orgUserDAO; @@ -49,7 +44,7 @@ public class OrgProjectService implements IOrgProjectService { public List queryOrgProjectListByOrgId(Long orgId) { OrgProjectExample orgProjectExample = new OrgProjectExample(); orgProjectExample.createCriteria().andOrgIdEqualTo(orgId); - return orgProjectDao.selectByExample(orgProjectExample); + return orgProjectDAO.selectByExample(orgProjectExample); } @Override @@ -100,7 +95,7 @@ public class OrgProjectService implements IOrgProjectService { orgProject.setProjectCode(code); orgProject.setCreateTime(LocalDateTime.now()); orgProject.setCreatorId(user.getId()); - orgProjectDao.insert(orgProject); + orgProjectDAO.insert(orgProject); }); } @@ -110,16 +105,16 @@ public class OrgProjectService implements IOrgProjectService { OrgProjectExample orgProjectExample = new OrgProjectExample(); orgProjectExample.createCriteria().andOrgIdEqualTo(orgId); if (CollectionUtils.isEmpty(projectList)) { // 为空,直接删除项目列表 - orgProjectDao.deleteByExampleSelective(orgProjectExample); + orgProjectDAO.deleteByExample(orgProjectExample); } else { - List orgProjects = orgProjectDao.selectByExample(orgProjectExample); + List orgProjects = orgProjectDAO.selectByExample(orgProjectExample); if (checkChange(orgProjects, projectList)) { List oldProjectList = orgProjects.stream().map(OrgProject::getProjectCode).collect(Collectors.toList()); // 删除不存在的 List delCodeList = oldProjectList.stream().filter(code -> !projectList.contains(code)).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(delCodeList)) { orgProjectExample.createCriteria().andOrgIdEqualTo(orgId).andProjectCodeIn(delCodeList); - orgProjectDao.deleteByExampleSelective(orgProjectExample); + orgProjectDAO.deleteByExample(orgProjectExample); } // 插入信息的 List newCodeList = projectList.stream().filter(code -> !oldProjectList.contains(code)).collect(Collectors.toList()); @@ -137,7 +132,7 @@ public class OrgProjectService implements IOrgProjectService { } else { OrgProjectExample example = new OrgProjectExample(); example.createCriteria().andOrgIdIn(orgIds); - return orgProjectDao.selectByExample(example); + return orgProjectDAO.selectByExample(example); } } @@ -163,7 +158,7 @@ public class OrgProjectService implements IOrgProjectService { private List queryOrgProjectList(String projectCode) { OrgProjectExample orgProjectExample = new OrgProjectExample(); orgProjectExample.createCriteria().andProjectCodeEqualTo(projectCode); - return orgProjectDao.selectByExample(orgProjectExample); + return orgProjectDAO.selectByExample(orgProjectExample); } /** diff --git a/src/main/java/club/joylink/rtss/services/org/OrgScoringRuleService.java b/src/main/java/club/joylink/rtss/services/org/OrgScoringRuleService.java index 644bcfee7..6c73086a3 100644 --- a/src/main/java/club/joylink/rtss/services/org/OrgScoringRuleService.java +++ b/src/main/java/club/joylink/rtss/services/org/OrgScoringRuleService.java @@ -4,7 +4,6 @@ import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.dao.OrgScoringRuleDAO; import club.joylink.rtss.dao.OrgScoringRuleRelDAO; import club.joylink.rtss.entity.*; -import club.joylink.rtss.entity.org.OrgProject; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.services.IExamService; import club.joylink.rtss.services.ISysUserService; diff --git a/src/main/java/club/joylink/rtss/services/org/OrgService.java b/src/main/java/club/joylink/rtss/services/org/OrgService.java index efc3d4a0f..7f654e3d0 100644 --- a/src/main/java/club/joylink/rtss/services/org/OrgService.java +++ b/src/main/java/club/joylink/rtss/services/org/OrgService.java @@ -2,11 +2,7 @@ package club.joylink.rtss.services.org; import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.dao.OrgDAO; -import club.joylink.rtss.entity.Org; -import club.joylink.rtss.entity.OrgExample; -import club.joylink.rtss.entity.OrgUser; -import club.joylink.rtss.entity.SysAccount; -import club.joylink.rtss.entity.org.OrgProject; +import club.joylink.rtss.entity.*; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.services.ISysUserService; import club.joylink.rtss.services.QRCodeManager; diff --git a/src/main/java/club/joylink/rtss/services/permission/OldPermissionDataSyncService.java b/src/main/java/club/joylink/rtss/services/permission/OldPermissionDataSyncService.java index 2987eb4f8..3cf7e060b 100644 --- a/src/main/java/club/joylink/rtss/services/permission/OldPermissionDataSyncService.java +++ b/src/main/java/club/joylink/rtss/services/permission/OldPermissionDataSyncService.java @@ -101,7 +101,7 @@ public class OldPermissionDataSyncService { for (MapInfo mapInfo : mapInfoList) { this.generate(mapInfo); }*/ - this.abilityService.autoSynchMapSystemData(0L); + this.abilityService.autoSynchMapSystemData(1L); }catch (Exception e){ log.error("用户权限初始化失败 msg:" + e.getMessage(),e); ISRUN.compareAndSet(true,false); @@ -425,7 +425,7 @@ public class OldPermissionDataSyncService { ps.setDistributeId(userPermissionVO.getDistributeId()); return ps; } - + public static DistributeDataVO createDistributeDataVO(SyncVO vo){ DistributeDataVO dataVO = new DistributeDataVO(); dataVO.setCreatorId(vo.permission.getCreatorId()); diff --git a/src/main/java/club/joylink/rtss/services/project/ProjectServiceImpl.java b/src/main/java/club/joylink/rtss/services/project/ProjectServiceImpl.java index 2cb8e0a49..be7f829e8 100644 --- a/src/main/java/club/joylink/rtss/services/project/ProjectServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/project/ProjectServiceImpl.java @@ -2,13 +2,11 @@ package club.joylink.rtss.services.project; import club.joylink.rtss.dao.MapInfoDAO; import club.joylink.rtss.dao.OrgDAO; +import club.joylink.rtss.dao.OrgProjectDAO; import club.joylink.rtss.dao.RtsMapFunctionDAO; -import club.joylink.rtss.dao.org.OrgProjectDao; import club.joylink.rtss.dao.project.ProjectDAO; import club.joylink.rtss.dao.project.ProjectViewDAO; import club.joylink.rtss.entity.*; -import club.joylink.rtss.entity.org.OrgProject; -import club.joylink.rtss.entity.org.OrgProjectExample; import club.joylink.rtss.entity.project.Project; import club.joylink.rtss.entity.project.ProjectExample; import club.joylink.rtss.entity.project.ProjectView; @@ -48,7 +46,7 @@ public class ProjectServiceImpl implements ProjectService { private ProjectViewDAO projectViewDAO; @Autowired - private OrgProjectDao orgProjectDao; + private OrgProjectDAO orgProjectDAO; @Autowired private OrgDAO orgDAO; @@ -322,7 +320,7 @@ public class ProjectServiceImpl implements ProjectService { private List getOrgProjectList(List projectCodeList) { OrgProjectExample orgProjectExample = new OrgProjectExample(); orgProjectExample.createCriteria().andProjectCodeIn(projectCodeList); - return orgProjectDao.selectByExample(orgProjectExample); + return orgProjectDAO.selectByExample(orgProjectExample); } private List getOrgList(List orgIdList) { diff --git a/src/main/java/club/joylink/rtss/vo/client/org/OrgVO.java b/src/main/java/club/joylink/rtss/vo/client/org/OrgVO.java index 20825a035..4638bae7b 100644 --- a/src/main/java/club/joylink/rtss/vo/client/org/OrgVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/org/OrgVO.java @@ -1,8 +1,8 @@ package club.joylink.rtss.vo.client.org; import club.joylink.rtss.entity.Org; +import club.joylink.rtss.entity.OrgProject; import club.joylink.rtss.entity.SysAccount; -import club.joylink.rtss.entity.org.OrgProject; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; diff --git a/src/main/resources/mybatis/mapper/OrgProjectDao.xml b/src/main/resources/mybatis/mapper/OrgProjectDao.xml index 4e8b1b923..f225ccf8e 100644 --- a/src/main/resources/mybatis/mapper/OrgProjectDao.xml +++ b/src/main/resources/mybatis/mapper/OrgProjectDao.xml @@ -1,208 +1,213 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + - - - - id, org_id, project_code, creator_id, create_time - - - - - delete from rts_org_project where id = #{id,jdbcType=BIGINT} - - - delete from rts_org_project - - - - - - insert into rts_org_project (org_id, project_code, creator_id, create_time) - values (#{orgId,jdbcType=BIGINT}, #{projectCode,jdbcType=VARCHAR}, - #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}) - - - insert into rts_org_project - - - id, - - - org_id, - - - project_code, - - - creator_id, - - - create_time, - - - - - #{id,jdbcType=BIGINT}, - - - #{orgId,jdbcType=BIGINT}, - - - #{projectCode,jdbcType=VARCHAR}, - - - #{creatorId,jdbcType=BIGINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - - - update rts_org_project - - - id = #{record.id,jdbcType=BIGINT}, - - - org_id = #{record.orgId,jdbcType=BIGINT}, - - - project_code = #{record.projectCode,jdbcType=VARCHAR}, - - - creator_id = #{record.creatorId,jdbcType=BIGINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - - - - - - update rts_org_project - set id = #{record.id,jdbcType=BIGINT}, + + + + + id, org_id, project_code, creator_id, create_time + + + + + delete from rts_org_project + where id = #{id,jdbcType=BIGINT} + + + delete from rts_org_project + + + + + + insert into rts_org_project (org_id, project_code, creator_id, + create_time) + values (#{orgId,jdbcType=BIGINT}, #{projectCode,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, + #{createTime,jdbcType=TIMESTAMP}) + + + insert into rts_org_project + + + org_id, + + + project_code, + + + creator_id, + + + create_time, + + + + + #{orgId,jdbcType=BIGINT}, + + + #{projectCode,jdbcType=VARCHAR}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + + + + update rts_org_project + + + id = #{record.id,jdbcType=BIGINT}, + + org_id = #{record.orgId,jdbcType=BIGINT}, + + project_code = #{record.projectCode,jdbcType=VARCHAR}, + + creator_id = #{record.creatorId,jdbcType=BIGINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP} - - - - - - update rts_org_project - - - org_id = #{orgId,jdbcType=BIGINT}, - - - project_code = #{projectCode,jdbcType=VARCHAR}, - - - creator_id = #{creatorId,jdbcType=BIGINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - update rts_org_project - set org_id = #{orgId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + + + + + + update rts_org_project + set id = #{record.id,jdbcType=BIGINT}, + org_id = #{record.orgId,jdbcType=BIGINT}, + project_code = #{record.projectCode,jdbcType=VARCHAR}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=TIMESTAMP} + + + + + + update rts_org_project + + + org_id = #{orgId,jdbcType=BIGINT}, + + project_code = #{projectCode,jdbcType=VARCHAR}, + + creator_id = #{creatorId,jdbcType=BIGINT}, - create_time = #{createTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=BIGINT} + + + update rts_org_project + set org_id = #{orgId,jdbcType=BIGINT}, + project_code = #{projectCode,jdbcType=VARCHAR}, + creator_id = #{creatorId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + +