基础管理:项目管理和勘查日志后端开发

This commit is contained in:
LHD_HY 2025-06-13 17:52:43 +08:00
parent 15a4b04487
commit eb35c4f130
17 changed files with 1204 additions and 17 deletions

27
bonus-basic/pom.xml Normal file
View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
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">
<parent>
<groupId>com.bonus</groupId>
<artifactId>water-design</artifactId>
<version>3.8.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bonus-basic</artifactId>
<description>
基础管理模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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<Project> 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);
}

View File

@ -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<Survey> 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<Survey> selectProjectList();
}

View File

@ -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<Project> 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);
}

View File

@ -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<Survey> 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<Survey> selectProjectList();
}

View File

@ -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<Project> 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);
}
}

View File

@ -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<Survey> 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<Survey> selectProjectList(){
return surveyMapper.selectProjectList();
}
}

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.basic.mapper.ProjectMapper">
<resultMap type="Project" id="ProjectResult">
<id property="proId" column="id" />
<result property="proName" column="pro_name" />
<result property="proType" column="pro_type" />
<result property="unit" column="unit_name" />
<result property="chargePerson" column="user_name" />
<result property="location" column="pro_location" />
<result property="longitude" column="lon" />
<result property="latitude" column="lat" />
<result property="createBy" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectProject">
select id, pro_name, pro_type, unit_name, user_name, pro_location, remark
from tb_project
where del_flag = '0'
</sql>
<select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
<include refid="selectProject"/>
<if test="proName != null and proName != ''">
AND pro_name like concat('%', #{proName}, '%')
</if>
<if test="unit != null and unit != ''">
AND unit_name = #{unit}
</if>
<if test="chargePerson != null and chargePerson != ''">
AND user_name like concat('%', #{chargePerson}, '%')
</if>
</select>
<select id="selectProjectById" parameterType="Long" resultMap="ProjectResult">
select id, pro_name, pro_type, unit_name, user_name, pro_location, remark
from tb_project
where del_flag = '0' and id = #{proId}
</select>
<select id="checkProjectNameUnique" parameterType="String" resultMap="ProjectResult">
select id, pro_name, pro_type, unit_name, user_name, pro_location, remark
from tb_project
where del_flag = '0' and pro_name=#{proName} limit 1
</select>
<update id="updateProject" parameterType="Project">
update tb_project
<set>
<if test="proName != null and proName != ''">pro_name = #{proName},</if>
<if test="proType != null and proType != ''">pro_type = #{proType},</if>
<if test="unit != null and unit != ''">unit_name = #{unit},</if>
<if test="chargePerson != null and chargePerson != ''">user_name = #{chargePerson},</if>
<if test="location != null and location != ''">pro_location = #{location},</if>
<if test="longitude != null and longitude != ''">lon = #{longitude},</if>
<if test="latitude != null and latitude != ''">lat = #{latitude},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_user = #{updateBy},</if>
update_time = sysdate()
</set>
where id = #{proId}
</update>
<insert id="insertProject" parameterType="Project" useGeneratedKeys="true" keyProperty="proId">
insert into tb_project(
<if test="proId != null and proId != 0">id,</if>
<if test="proName != null and proName != ''">pro_name,</if>
<if test="proType != null and proType != ''">pro_type,</if>
<if test="unit != null and unit != ''">unit_name,</if>
<if test="chargePerson != null and chargePerson != ''">user_name,</if>
<if test="location != null and location != ''">pro_location,</if>
<if test="longitude != null and longitude != ''">lon,</if>
<if test="latitude != null and latitude != ''">lat,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_user,</if>
create_time
)values(
<if test="proId != null and proId != 0">#{proId},</if>
<if test="proName != null and proName != ''">#{proName},</if>
<if test="proType != null and proType != ''">#{proType},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="chargePerson != null and chargePerson != ''">#{chargePerson},</if>
<if test="location != null and location != ''">#{location},</if>
<if test="longitude != null and longitude != ''">#{longitude},</if>
<if test="latitude != null and latitude != ''">#{latitude},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deleteProjectById" parameterType="Long">
UPDATE `tb_project` SET
del_flag = '1'
WHERE
id = #{proId}
</delete>
</mapper>

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.basic.mapper.SurveyMapper">
<resultMap type="Survey" id="SurveyResult">
<id property="id" column="id" />
<result property="proId" column="pro_id" />
<result property="proName" column="pro_name" />
<result property="surveyContent" column="survey_content" />
<result property="surveyUser" column="survey_user" />
<result property="surveyTime" column="survey_time" />
<result property="surveyAttach" column="survey_attach" />
<result property="createBy" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSurvey">
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'
</sql>
<select id="selectSurveyList" parameterType="Survey" resultMap="SurveyResult">
<include refid="selectSurvey"/>
<if test="proName != null and proName != ''">
AND tp.pro_name like concat('%', #{proName}, '%')
</if>
<if test="surveyUser != null and surveyUser != ''">
AND tsi.surveyUser like concat('%', #{surveyUser}, '%')
</if>
<if test="surveyTime != null and surveyTime != ''">
AND tsi.survey_time like concat('%', #{surveyTime}, '%')
</if>
</select>
<select id="selectSurveyById" parameterType="Long" resultMap="SurveyResult">
select tsi.id, tsi.survey_user, tsi.survey_attach, tsi.survey_content,tsi.survey_time,tp.pro_name
from tb_survey_info tsi
left join tb_project tp on tp.id=tsi.pro_id
where tsi.del_flag = '0' and tsi.id = #{id}
</select>
<update id="updateSurvey" parameterType="Survey">
update tb_survey_info
<set>
<if test="proId != null and proId != ''">pro_id = #{proId},</if>
<if test="surveyTime != null and surveyTime != ''">survey_time = #{surveyTime},</if>
<if test="surveyUser != null and surveyUser != ''">survey_user = #{surveyUser},</if>
<if test="surveyContent != null and surveyContent != ''">survey_content = #{surveyContent},</if>
<if test="surveyAttach != null and surveyAttach != ''">survey_attach = #{surveyAttach},</if>
<if test="updateBy != null and updateBy != ''">update_user = #{updateBy},</if>
update_time = sysdate()
</set>
where id = #{id}
</update>
<insert id="insertSurvey" parameterType="Survey" useGeneratedKeys="true" keyProperty="id">
insert into tb_survey_info(
<if test="proId != null and proId != 0">pro_id,</if>
<if test="surveyTime != null and surveyTime != ''">survey_time,</if>
<if test="surveyUser != null and surveyUser != ''">survey_user,</if>
<if test="surveyContent != null and surveyContent != ''">survey_content,</if>
<if test="surveyAttach != null and surveyAttach != ''">survey_attach,</if>
<if test="createBy != null and createBy != ''">create_user,</if>
create_time
)values(
<if test="proId != null and proId != 0">#{proId},</if>
<if test="surveyTime != null and surveyTime != ''">#{surveyTime},</if>
<if test="surveyUser != null and surveyUser != ''">#{surveyUser},</if>
<if test="surveyContent != null and surveyContent != ''">#{surveyContent},</if>
<if test="surveyAttach != null and surveyAttach != ''">#{surveyAttach},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deleteSurveyById" parameterType="Long">
UPDATE `tb_survey_info` SET
del_flag = '1'
WHERE
id = #{id}
</delete>
<select id="selectProjectList">
select pro_id as proId,pro_name as proName
from tb_project
where del_flag = '0'
</select>
</mapper>

View File

@ -59,6 +59,12 @@
<artifactId>bonus-system</artifactId>
</dependency>
<!-- 基础管理模块-->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-basic</artifactId>
</dependency>
</dependencies>
</project>
</project>

14
pom.xml
View File

@ -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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bonus</groupId>
<artifactId>water-design</artifactId>
<version>3.8.9</version>
@ -11,7 +11,7 @@
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.8.9</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -204,6 +204,13 @@
<version>${ruoyi.version}</version>
</dependency>
<!-- 基础管理模块-->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-basic</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.bonus</groupId>
@ -220,6 +227,7 @@
<module>bonus-generator</module>
<module>bonus-system</module>
<module>bonus-common</module>
<module>bonus-basic</module>
</modules>
<packaging>pom</packaging>
@ -263,4 +271,4 @@
</pluginRepository>
</pluginRepositories>
</project>
</project>

View File

@ -48,7 +48,11 @@
<artifactId>bonus-framework</artifactId>
</dependency>
<!-- 基础管理模块-->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-basic</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
@ -75,17 +79,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>
</project>

View File

@ -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<Project> 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<Project> list = projectService.selectProjectList(post);
ExcelUtil<Project> util = new ExcelUtil<Project>(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));
}
}

View File

@ -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<Survey> list = surveyService.selectSurveyList(survey);
return getDataTable(list);
}
/**
* 获取项目下拉框
*/
@PreAuthorize("@ss.hasPermi('basic:survey:select')")
@GetMapping("/select")
public List<Survey> projectList()
{
List<Survey> 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<Survey> list = surveyService.selectSurveyList(post);
ExcelUtil<Survey> util = new ExcelUtil<Survey>(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));
}
}

View File

@ -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: