From eb35c4f1304e4c3138c81a95030b9e7db07fefb4 Mon Sep 17 00:00:00 2001 From: LHD_HY <2872546851@qq.com> Date: Fri, 13 Jun 2025 17:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=AE=A1=E7=90=86=EF=BC=9A?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E5=92=8C=E5=8B=98=E6=9F=A5?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=90=8E=E7=AB=AF=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bonus-basic/pom.xml | 27 +++ .../java/com/bonus/basic/domain/Project.java | 165 ++++++++++++++++++ .../java/com/bonus/basic/domain/Survey.java | 126 +++++++++++++ .../com/bonus/basic/mapper/ProjectMapper.java | 62 +++++++ .../com/bonus/basic/mapper/SurveyMapper.java | 56 ++++++ .../bonus/basic/service/ProjectService.java | 61 +++++++ .../bonus/basic/service/SurveyService.java | 61 +++++++ .../service/impl/ProjectServiceImpl.java | 102 +++++++++++ .../basic/service/impl/SurveyServiceImpl.java | 89 ++++++++++ .../resources/mapper/basic/ProjectMapper.xml | 109 ++++++++++++ .../resources/mapper/basic/SurveyMapper.xml | 97 ++++++++++ bonus-framework/pom.xml | 8 +- pom.xml | 14 +- water-design-const/pom.xml | 20 ++- .../controller/basic/ProjectController.java | 106 +++++++++++ .../controller/basic/SurveyController.java | 109 ++++++++++++ .../src/main/resources/application.yml | 9 +- 17 files changed, 1204 insertions(+), 17 deletions(-) create mode 100644 bonus-basic/pom.xml create mode 100644 bonus-basic/src/main/java/com/bonus/basic/domain/Project.java create mode 100644 bonus-basic/src/main/java/com/bonus/basic/domain/Survey.java create mode 100644 bonus-basic/src/main/java/com/bonus/basic/mapper/ProjectMapper.java create mode 100644 bonus-basic/src/main/java/com/bonus/basic/mapper/SurveyMapper.java create mode 100644 bonus-basic/src/main/java/com/bonus/basic/service/ProjectService.java create mode 100644 bonus-basic/src/main/java/com/bonus/basic/service/SurveyService.java create mode 100644 bonus-basic/src/main/java/com/bonus/basic/service/impl/ProjectServiceImpl.java create mode 100644 bonus-basic/src/main/java/com/bonus/basic/service/impl/SurveyServiceImpl.java create mode 100644 bonus-basic/src/main/resources/mapper/basic/ProjectMapper.xml create mode 100644 bonus-basic/src/main/resources/mapper/basic/SurveyMapper.xml create mode 100644 water-design-const/src/main/java/com/bonus/waterdesign/controller/basic/ProjectController.java create mode 100644 water-design-const/src/main/java/com/bonus/waterdesign/controller/basic/SurveyController.java diff --git a/bonus-basic/pom.xml b/bonus-basic/pom.xml new file mode 100644 index 0000000..fdb3e7f --- /dev/null +++ b/bonus-basic/pom.xml @@ -0,0 +1,27 @@ + + + + com.bonus + water-design + 3.8.9 + + + 4.0.0 + bonus-basic + + 基础管理模块 + + + + + + + + com.bonus + bonus-common + + + + diff --git a/bonus-basic/src/main/java/com/bonus/basic/domain/Project.java b/bonus-basic/src/main/java/com/bonus/basic/domain/Project.java new file mode 100644 index 0000000..cff037b --- /dev/null +++ b/bonus-basic/src/main/java/com/bonus/basic/domain/Project.java @@ -0,0 +1,165 @@ +package com.bonus.basic.domain; + +import com.bonus.common.annotation.Excel; +import com.bonus.common.annotation.Excel.ColumnType; +import com.bonus.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + * 岗位表 sys_post + * + * @author ruoyi + */ +public class Project extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 序号 */ + @Excel(name = "序号", cellType = ColumnType.NUMERIC) + private Long proId; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String proName; + + /** 项目类型 */ + @Excel(name = "项目类型") + private String proType; + + /** 所属单位 */ + @Excel(name = "所属单位") + private String unit; + + /** 负责人 */ + @Excel(name = "负责人") + private String chargePerson; + + /** 项目所在地 */ + @Excel(name = "项目所在地") + private String location; + + /** 所属单位 */ + @Excel(name = "备注") + private String remark; + + /** 是否删除 */ + private String delFlag; + + private String longitude; + + private String latitude; + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public void setChargePerson(String chargePerson) { + this.chargePerson = chargePerson; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public Long getProId() { + return proId; + } + + public void setProId(Long proId) { + this.proId = proId; + } + + public String getProType() { + return proType; + } + + public void setProType(String proType) { + this.proType = proType; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + @Override + public String getRemark() { + return remark; + } + + @Override + public void setRemark(String remark) { + this.remark = remark; + } + + @NotBlank(message = "项目名称不能为空") + @Size(min = 0, max = 256, message = "项目名称长度不能超过256个字符") + public String getProName() + { + return proName; + } + + public void setProName(String proName) + { + this.proName = proName; + } + + @NotBlank(message = "所属单位不能为空") + @Size(min = 0, max = 64, message = "所属单位长度不能超过64个字符") + public String getUnit() + { + return unit; + } + + @NotBlank(message = "负责人不能为空") + @Size(min = 0, max = 64, message = "项目名称长度不能超过64个字符") + public String getChargePerson() + { + return chargePerson; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getProId()) + .append("proName", getProName()) + .append("proType", getProType()) + .append("unit", getUnit()) + .append("location", getLocation()) + .append("chargePerson", getChargePerson()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/bonus-basic/src/main/java/com/bonus/basic/domain/Survey.java b/bonus-basic/src/main/java/com/bonus/basic/domain/Survey.java new file mode 100644 index 0000000..4ab20f9 --- /dev/null +++ b/bonus-basic/src/main/java/com/bonus/basic/domain/Survey.java @@ -0,0 +1,126 @@ +package com.bonus.basic.domain; + + +import com.bonus.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +/** + * 岗位表 sys_post + * + * @author ruoyi + */ +public class Survey extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + + private Long id; + + /** 项目id */ + + private Long proId; + + /** 勘察时间 */ + + private String surveyTime; + + /** 堪察人 */ + + private String surveyUser; + + /** 勘察内容 */ + + private String surveyContent; + + /** 项目名称 */ + + private String proName; + + /** 勘察附件 */ + + private String surveyAttach; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public void setSurveyTime(String surveyTime) { + this.surveyTime = surveyTime; + } + + public void setSurveyUser(String surveyUser) { + this.surveyUser = surveyUser; + } + + public String getSurveyContent() { + return surveyContent; + } + + public void setSurveyContent(String surveyContent) { + this.surveyContent = surveyContent; + } + + public String getSurveyAttach() { + return surveyAttach; + } + + public void setSurveyAttach(String surveyAttach) { + this.surveyAttach = surveyAttach; + } + + public Long getProId() { + return proId; + } + + public void setProId(Long proId) { + this.proId = proId; + } + + public String getProName() + { + return proName; + } + + public void setProName(String proName) + { + this.proName = proName; + } + + @NotBlank(message = "堪察人不能为空") + @Size(min = 0, max = 64, message = "堪察人长度不能超过64个字符") + public String getSurveyUser() + { + return surveyUser; + } + + public String getSurveyTime() + { + return surveyTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("proId", getProId()) + .append("proName", getProName()) + .append("surveyContent", getSurveyContent()) + .append("surveyUser", getSurveyUser()) + .append("surveyTime", getSurveyTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/bonus-basic/src/main/java/com/bonus/basic/mapper/ProjectMapper.java b/bonus-basic/src/main/java/com/bonus/basic/mapper/ProjectMapper.java new file mode 100644 index 0000000..44379ce --- /dev/null +++ b/bonus-basic/src/main/java/com/bonus/basic/mapper/ProjectMapper.java @@ -0,0 +1,62 @@ +package com.bonus.basic.mapper; + +import com.bonus.basic.domain.Project; + +import java.util.List; + +/** + * 项目信息 数据层 + * + * @author ruoyi + */ +public interface ProjectMapper +{ + /** + * 查询项目数据集合 + * + * @param project 项目信息 + * @return 项目数据集合 + */ + public List selectProjectList(Project project); + + /** + * 通过项目ID查询项目信息 + * + * @param proId 项目ID + * @return 角色对象信息 + */ + public Project selectProjectById(Long proId); + + /** + * 校验项目名称 + * + * @param proName 项目名称 + * @return 结果 + */ + public Project checkProjectNameUnique(String proName); + + /** + * 删除项目信息 + * + * @param proId 项目ID + * @return 结果 + */ + public int deleteProjectById(Long proId); + + /** + * 修改项目信息 + * + * @param project 项目信息 + * @return 结果 + */ + public int updateProject(Project project); + + /** + * 新增项目信息 + * + * @param project 项目信息 + * @return 结果 + */ + public int insertProject(Project project); + +} diff --git a/bonus-basic/src/main/java/com/bonus/basic/mapper/SurveyMapper.java b/bonus-basic/src/main/java/com/bonus/basic/mapper/SurveyMapper.java new file mode 100644 index 0000000..67529ab --- /dev/null +++ b/bonus-basic/src/main/java/com/bonus/basic/mapper/SurveyMapper.java @@ -0,0 +1,56 @@ +package com.bonus.basic.mapper; + +import com.bonus.basic.domain.Survey; + +import java.util.List; + +/** + * 勘察信息 数据层 + * + * @author ruoyi + */ +public interface SurveyMapper +{ + /** + * 查询勘察数据集合 + * + * @param survey 勘察信息 + * @return 勘察数据集合 + */ + public List selectSurveyList(Survey survey); + + /** + * 通过勘察ID查询勘察信息 + * + * @param id 勘察ID + * @return 角色对象信息 + */ + public Survey selectSurveyById(Long id); + + /** + * 删除勘察信息 + * + * @param id 勘察ID + * @return 结果 + */ + public int deleteSurveyById(Long id); + + /** + * 修改勘察信息 + * + * @param survey 勘察信息 + * @return 结果 + */ + public int updateSurvey(Survey survey); + + /** + * 新增勘察信息 + * + * @param survey 勘察信息 + * @return 结果 + */ + public int insertSurvey(Survey survey); + + public List selectProjectList(); + +} diff --git a/bonus-basic/src/main/java/com/bonus/basic/service/ProjectService.java b/bonus-basic/src/main/java/com/bonus/basic/service/ProjectService.java new file mode 100644 index 0000000..6186a9f --- /dev/null +++ b/bonus-basic/src/main/java/com/bonus/basic/service/ProjectService.java @@ -0,0 +1,61 @@ +package com.bonus.basic.service; + +import com.bonus.basic.domain.Project; + +import java.util.List; + +/** + * 项目信息 服务层 + * + * @author ruoyi + */ +public interface ProjectService +{ + /** + * 查询项目信息集合 + * + * @param project 项目信息 + * @return 项目列表 + */ + public List selectProjectList(Project project); + + /** + * 通过项目ID查询项目信息 + * + * @param proId 项目ID + * @return 角色对象信息 + */ + public Project selectProjectById(Long proId); + + /** + * 校验岗位名称 + * + * @param project 项目信息 + * @return 结果 + */ + public boolean checkProjectNameUnique(Project project); + + /** + * 删除项目信息 + * + * @param proId 项目ID + * @return 结果 + */ + public int deleteProjectById(Long proId); + + /** + * 新增保存项目信息 + * + * @param project 项目信息 + * @return 结果 + */ + public int insertProject(Project project); + + /** + * 修改保存项目信息 + * + * @param project 项目信息 + * @return 结果 + */ + public int updateProject(Project project); +} diff --git a/bonus-basic/src/main/java/com/bonus/basic/service/SurveyService.java b/bonus-basic/src/main/java/com/bonus/basic/service/SurveyService.java new file mode 100644 index 0000000..c31fb6d --- /dev/null +++ b/bonus-basic/src/main/java/com/bonus/basic/service/SurveyService.java @@ -0,0 +1,61 @@ +package com.bonus.basic.service; + +import com.bonus.basic.domain.Survey; + +import java.util.List; + +/** + * 勘察信息 服务层 + * + * @author ruoyi + */ +public interface SurveyService +{ + /** + * 查询勘察信息集合 + * + * @param survey 勘察信息 + * @return 勘察列表 + */ + public List selectSurveyList(Survey survey); + + /** + * 通过勘察ID查询勘察信息 + * + * @param id 勘察ID + * @return 角色对象信息 + */ + public Survey selectSurveyById(Long id); + + /** + * 删除勘察信息 + * + * @param id 勘察ID + * @return 结果 + */ + public int deleteSurveyById(Long id); + + /** + * 新增保存勘察信息 + * + * @param survey 勘察信息 + * @return 结果 + */ + public int insertSurvey(Survey survey); + + /** + * 修改保存勘察信息 + * + * @param survey 勘察信息 + * @return 结果 + */ + public int updateSurvey(Survey survey); + + /** + * 获取项目下拉框 + * + * @return 结果 + */ + public List selectProjectList(); +} + diff --git a/bonus-basic/src/main/java/com/bonus/basic/service/impl/ProjectServiceImpl.java b/bonus-basic/src/main/java/com/bonus/basic/service/impl/ProjectServiceImpl.java new file mode 100644 index 0000000..8e20907 --- /dev/null +++ b/bonus-basic/src/main/java/com/bonus/basic/service/impl/ProjectServiceImpl.java @@ -0,0 +1,102 @@ +package com.bonus.basic.service.impl; + +import com.bonus.common.constant.UserConstants; +import com.bonus.common.exception.ServiceException; +import com.bonus.common.utils.StringUtils; +import com.bonus.basic.domain.Project; +import com.bonus.basic.mapper.ProjectMapper; +import com.bonus.basic.service.ProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目信息 服务层处理 + * + * @author ruoyi + */ +@Service +public class ProjectServiceImpl implements ProjectService +{ + @Autowired + private ProjectMapper projectMapper; + + /** + * 查询项目信息集合 + * + * @param project 项目信息 + * @return 项目信息集合 + */ + @Override + public List selectProjectList(Project project) + { + return projectMapper.selectProjectList(project); + } + + /** + * 通过项目ID查询项目信息 + * + * @param proId 项目ID + * @return 角色对象信息 + */ + @Override + public Project selectProjectById(Long proId) + { + return projectMapper.selectProjectById(proId); + } + + /** + * 校验项目名称是否唯一 + * + * @param project 项目信息 + * @return 结果 + */ + @Override + public boolean checkProjectNameUnique(Project project) + { + Long proId = StringUtils.isNull(project.getProId()) ? -1L : project.getProId(); + Project info = projectMapper.checkProjectNameUnique(project.getProName()); + if (StringUtils.isNotNull(info) && info.getProId().longValue() != proId.longValue()) + { + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 删除项目信息 + * + * @param proId 项目ID + * @return 结果 + */ + @Override + public int deleteProjectById(Long proId) + { + return projectMapper.deleteProjectById(proId); + } + + /** + * 新增保存项目信息 + * + * @param project 项目信息 + * @return 结果 + */ + @Override + public int insertProject(Project project) + { + return projectMapper.insertProject(project); + } + + /** + * 修改保存项目信息 + * + * @param project 项目信息 + * @return 结果 + */ + @Override + public int updateProject(Project project) + { + return projectMapper.updateProject(project); + } +} diff --git a/bonus-basic/src/main/java/com/bonus/basic/service/impl/SurveyServiceImpl.java b/bonus-basic/src/main/java/com/bonus/basic/service/impl/SurveyServiceImpl.java new file mode 100644 index 0000000..6cde767 --- /dev/null +++ b/bonus-basic/src/main/java/com/bonus/basic/service/impl/SurveyServiceImpl.java @@ -0,0 +1,89 @@ +package com.bonus.basic.service.impl; + +import com.bonus.basic.domain.Survey; +import com.bonus.basic.mapper.SurveyMapper; +import com.bonus.basic.service.SurveyService; +import com.bonus.common.constant.UserConstants; +import com.bonus.common.utils.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 勘察信息 服务层处理 + * + * @author ruoyi + */ +@Service +public class SurveyServiceImpl implements SurveyService +{ + @Autowired + private SurveyMapper surveyMapper; + + /** + * 查询勘察信息集合 + * + * @param survey 勘察信息 + * @return 勘察信息集合 + */ + @Override + public List selectSurveyList(Survey survey) + { + return surveyMapper.selectSurveyList(survey); + } + + /** + * 通过勘察ID查询勘察信息 + * + * @param id 勘察ID + * @return 角色对象信息 + */ + @Override + public Survey selectSurveyById(Long id) + { + return surveyMapper.selectSurveyById(id); + } + + + /** + * 删除勘察信息 + * + * @param id 勘察ID + * @return 结果 + */ + @Override + public int deleteSurveyById(Long id) + { + return surveyMapper.deleteSurveyById(id); + } + + /** + * 新增保存勘察信息 + * + * @param survey 勘察信息 + * @return 结果 + */ + @Override + public int insertSurvey(Survey survey) + { + return surveyMapper.insertSurvey(survey); + } + + /** + * 修改保存勘察信息 + * + * @param survey 勘察信息 + * @return 结果 + */ + @Override + public int updateSurvey(Survey survey) + { + return surveyMapper.updateSurvey(survey); + } + + @Override + public List selectProjectList(){ + return surveyMapper.selectProjectList(); + } +} diff --git a/bonus-basic/src/main/resources/mapper/basic/ProjectMapper.xml b/bonus-basic/src/main/resources/mapper/basic/ProjectMapper.xml new file mode 100644 index 0000000..bbe83b0 --- /dev/null +++ b/bonus-basic/src/main/resources/mapper/basic/ProjectMapper.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, pro_name, pro_type, unit_name, user_name, pro_location, remark + from tb_project + where del_flag = '0' + + + + + + + + + + update tb_project + + pro_name = #{proName}, + pro_type = #{proType}, + unit_name = #{unit}, + user_name = #{chargePerson}, + pro_location = #{location}, + lon = #{longitude}, + lat = #{latitude}, + remark = #{remark}, + update_user = #{updateBy}, + update_time = sysdate() + + where id = #{proId} + + + + insert into tb_project( + id, + pro_name, + pro_type, + unit_name, + user_name, + pro_location, + lon, + lat, + remark, + create_user, + create_time + )values( + #{proId}, + #{proName}, + #{proType}, + #{unit}, + #{chargePerson}, + #{location}, + #{longitude}, + #{latitude}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + UPDATE `tb_project` SET + del_flag = '1' + WHERE + id = #{proId} + + + + diff --git a/bonus-basic/src/main/resources/mapper/basic/SurveyMapper.xml b/bonus-basic/src/main/resources/mapper/basic/SurveyMapper.xml new file mode 100644 index 0000000..3d66b0f --- /dev/null +++ b/bonus-basic/src/main/resources/mapper/basic/SurveyMapper.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + select tsi.id, tsi.survey_user, tsi.survey_attach, tsi.survey_content,tp.pro_name + from tb_survey_info tsi + left join tb_project tp on tp.id=tsi.pro_id + where tsi.del_flag = '0' + + + + + + + + update tb_survey_info + + pro_id = #{proId}, + survey_time = #{surveyTime}, + survey_user = #{surveyUser}, + survey_content = #{surveyContent}, + survey_attach = #{surveyAttach}, + update_user = #{updateBy}, + update_time = sysdate() + + where id = #{id} + + + + insert into tb_survey_info( + pro_id, + survey_time, + survey_user, + survey_content, + survey_attach, + create_user, + create_time + )values( + #{proId}, + #{surveyTime}, + #{surveyUser}, + #{surveyContent}, + #{surveyAttach}, + #{createBy}, + sysdate() + ) + + + + UPDATE `tb_survey_info` SET + del_flag = '1' + WHERE + id = #{id} + + + + + + diff --git a/bonus-framework/pom.xml b/bonus-framework/pom.xml index 0495996..34fa16b 100644 --- a/bonus-framework/pom.xml +++ b/bonus-framework/pom.xml @@ -59,6 +59,12 @@ bonus-system + + + com.bonus + bonus-basic + + - \ No newline at end of file + diff --git a/pom.xml b/pom.xml index e95cb1b..1fa887c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + com.bonus water-design 3.8.9 @@ -11,7 +11,7 @@ ruoyi http://www.ruoyi.vip 若依管理系统 - + 3.8.9 UTF-8 @@ -204,6 +204,13 @@ ${ruoyi.version} + + + com.bonus + bonus-basic + ${ruoyi.version} + + com.bonus @@ -220,6 +227,7 @@ bonus-generator bonus-system bonus-common + bonus-basic pom @@ -263,4 +271,4 @@ - \ No newline at end of file + diff --git a/water-design-const/pom.xml b/water-design-const/pom.xml index e7b6f25..8fe07d2 100644 --- a/water-design-const/pom.xml +++ b/water-design-const/pom.xml @@ -48,7 +48,11 @@ bonus-framework - + + + com.bonus + bonus-basic + @@ -75,17 +79,17 @@ - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 + + org.apache.maven.plugins + maven-war-plugin + 3.1.0 false ${project.artifactId} - - + + ${project.artifactId} - \ No newline at end of file + diff --git a/water-design-const/src/main/java/com/bonus/waterdesign/controller/basic/ProjectController.java b/water-design-const/src/main/java/com/bonus/waterdesign/controller/basic/ProjectController.java new file mode 100644 index 0000000..56a0b1f --- /dev/null +++ b/water-design-const/src/main/java/com/bonus/waterdesign/controller/basic/ProjectController.java @@ -0,0 +1,106 @@ +package com.bonus.waterdesign.controller.basic; + +import com.bonus.common.annotation.Log; +import com.bonus.common.core.controller.BaseController; +import com.bonus.common.core.domain.AjaxResult; +import com.bonus.common.core.page.TableDataInfo; +import com.bonus.common.enums.BusinessType; +import com.bonus.common.utils.poi.ExcelUtil; +import com.bonus.basic.domain.Project; +import com.bonus.basic.service.ProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 项目信息操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/basic/project") +public class ProjectController extends BaseController +{ + @Autowired + private ProjectService projectService; + + /** + * 获取项目列表 + */ + @PreAuthorize("@ss.hasPermi('basic:project:list')") + @GetMapping("/list") + public TableDataInfo list(Project project) + { + startPage(); + List list = projectService.selectProjectList(project); + return getDataTable(list); + } + + @Log(title = "项目管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('basic:project:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, Project post) + { + List list = projectService.selectProjectList(post); + ExcelUtil util = new ExcelUtil(Project.class); + util.exportExcel(response, list, "项目数据"); + } + + /** + * 根据岗位编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('basic:project:query')") + @GetMapping(value = "/{proId}") + public AjaxResult getInfo(@PathVariable Long proId) + { + return success(projectService.selectProjectById(proId)); + } + + /** + * 新增项目 + */ + @PreAuthorize("@ss.hasPermi('basic:project:add')") + @Log(title = "项目管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody Project project) + { + if (!projectService.checkProjectNameUnique(project)) + { + return error("新增项目'" + project.getProName() + "'失败,项目名称已存在"); + } + project.setCreateBy(getUsername()); + return toAjax(projectService.insertProject(project)); + } + + /** + * 修改项目 + */ + @PreAuthorize("@ss.hasPermi('basic:project:edit')") + @Log(title = "项目管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody Project project) + { + if (!projectService.checkProjectNameUnique(project)) + { + return error("修改项目'" + project.getProName() + "'失败,项目名称已存在"); + } + project.setUpdateBy(getUsername()); + return toAjax(projectService.updateProject(project)); + } + + /** + * 删除项目 + */ + @PreAuthorize("@ss.hasPermi('basic:project:remove')") + @Log(title = "岗位管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{proId}") + public AjaxResult remove(@PathVariable Long proId) + { + return toAjax(projectService.deleteProjectById(proId)); + } + +} diff --git a/water-design-const/src/main/java/com/bonus/waterdesign/controller/basic/SurveyController.java b/water-design-const/src/main/java/com/bonus/waterdesign/controller/basic/SurveyController.java new file mode 100644 index 0000000..0a4b283 --- /dev/null +++ b/water-design-const/src/main/java/com/bonus/waterdesign/controller/basic/SurveyController.java @@ -0,0 +1,109 @@ +package com.bonus.waterdesign.controller.basic; + +import com.bonus.basic.domain.Survey; +import com.bonus.basic.service.SurveyService; +import com.bonus.common.annotation.Log; +import com.bonus.common.core.controller.BaseController; +import com.bonus.common.core.domain.AjaxResult; +import com.bonus.common.core.page.TableDataInfo; +import com.bonus.common.enums.BusinessType; +import com.bonus.common.utils.poi.ExcelUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 勘查信息操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/basic/survey") +public class SurveyController extends BaseController +{ + @Autowired + private SurveyService surveyService; + + /** + * 获取勘查列表 + */ + @PreAuthorize("@ss.hasPermi('basic:survey:list')") + @GetMapping("/list") + public TableDataInfo list(Survey survey) + { + startPage(); + List list = surveyService.selectSurveyList(survey); + return getDataTable(list); + } + + /** + * 获取项目下拉框 + */ + @PreAuthorize("@ss.hasPermi('basic:survey:select')") + @GetMapping("/select") + public List projectList() + { + List list = surveyService.selectProjectList(); + return list; + } + + @Log(title = "勘查管理", businessType = BusinessType.EXPORT) + @PreAuthorize("@ss.hasPermi('basic:survey:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, Survey post) + { + List list = surveyService.selectSurveyList(post); + ExcelUtil util = new ExcelUtil(Survey.class); + util.exportExcel(response, list, "勘查数据"); + } + + /** + * 根据岗位编号获取详细信息 + */ + @PreAuthorize("@ss.hasPermi('basic:survey:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable Long id) + { + return success(surveyService.selectSurveyById(id)); + } + + /** + * 新增勘查 + */ + @PreAuthorize("@ss.hasPermi('basic:survey:add')") + @Log(title = "勘查管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@Validated @RequestBody Survey survey) + { + survey.setCreateBy(getUsername()); + return toAjax(surveyService.insertSurvey(survey)); + } + + /** + * 修改勘查 + */ + @PreAuthorize("@ss.hasPermi('basic:survey:edit')") + @Log(title = "勘查管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@Validated @RequestBody Survey survey) + { + survey.setUpdateBy(getUsername()); + return toAjax(surveyService.updateSurvey(survey)); + } + + /** + * 删除勘查 + */ + @PreAuthorize("@ss.hasPermi('basic:survey:remove')") + @Log(title = "岗位管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(surveyService.deleteSurveyById(id)); + } + +} diff --git a/water-design-const/src/main/resources/application.yml b/water-design-const/src/main/resources/application.yml index 204165e..33cf585 100644 --- a/water-design-const/src/main/resources/application.yml +++ b/water-design-const/src/main/resources/application.yml @@ -68,13 +68,12 @@ spring: # redis 配置 redis: # 地址 - host: localhost - # 端口,默认为6379 + host: 127.0.0.1 port: 6379 + password: liang971108lu@L # 数据库索引 - database: 0 - # 密码 - password: + database: 13 + # 连接超时时间 timeout: 10s lettuce: