单项工程管理

This commit is contained in:
马三炮 2025-04-15 09:04:33 +08:00
parent c7a6bfeea3
commit 034bc42cad
8 changed files with 652 additions and 1 deletions

View File

@ -0,0 +1,101 @@
package com.bonus.base.basic.controller;
import com.bonus.base.basic.domain.TtProjectSingleReqVo;
import com.bonus.base.basic.domain.TtSysTeamReqVo;
import com.bonus.base.basic.domain.vo.TtProjectSingleVo;
import com.bonus.base.basic.domain.vo.TtSysTeamVo;
import com.bonus.base.basic.service.TtProjectSingleService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.security.annotation.RequiresPermissions;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* 单项工程管理
*/
@Slf4j
@RestController
@RequestMapping("/ttProjectSingle")
public class TtProjectSingleController extends BaseController {
@Resource
private TtProjectSingleService ttProjectSingleService;
@ApiOperation(value = "查询单项工程列表")
@RequiresPermissions("tt:single:list")
@PostMapping("/ttProjectSingleList")
public TableDataInfo ttProjectSingleList(@RequestBody TtProjectSingleReqVo ttProjectSingleReqVo) {
try {
startPage();
List<TtProjectSingleVo> ttProjectSingleList = ttProjectSingleService.ttProjectSingleList(ttProjectSingleReqVo);
return getDataTable(ttProjectSingleList);
}catch (Exception e){
log.info("查询列表失败",e.getMessage());
return getDataTableError(null);
}
}
@ApiOperation(value = "查询单项工程详情")
@RequiresPermissions("tt:single:attr")
@PostMapping("/ttProjectSingleById")
public AjaxResult ttProjectSingleById(@RequestBody TtProjectSingleReqVo ttProjectSingleReqVo) {
try {
TtProjectSingleVo ttProjectSingle = ttProjectSingleService.ttProjectSingleById(ttProjectSingleReqVo);
return success(ttProjectSingle);
}catch (Exception e){
log.info("查询单项工程详情失败",e.getMessage());
return error("查询单项工程详情失败");
}
}
@ApiOperation(value = "新增单项工程")
@RequiresPermissions("tt:single:add")
@PostMapping("/addTtProjectSingle")
public AjaxResult addTtProjectSingle(@RequestBody TtProjectSingleReqVo ttProjectSingleReqVo) {
try {
ttProjectSingleService.addTtProjectSingle(ttProjectSingleReqVo);
return success("新增单项工程成功");
}catch (Exception e){
log.info("新增单项工程失败",e.getMessage());
return error("新增单项工程失败");
}
}
@ApiOperation(value = "修改单项工程")
@RequiresPermissions("tt:single:update")
@PostMapping("/updateTtProjectSingle")
public AjaxResult updateTtProjectSingle(@RequestBody TtProjectSingleReqVo ttProjectSingleReqVo) {
try {
ttProjectSingleService.updateTtProjectSingle(ttProjectSingleReqVo);
return success("修改单项工程成功");
}catch (Exception e){
log.info("修改单项工程失败",e.getMessage());
return error("修改单项工程失败");
}
}
@ApiOperation(value = "删除单项工程")
@RequiresPermissions("tt:single:del")
@PostMapping("/delTtProjectSingle")
public AjaxResult delTtProjectSingle(@RequestBody TtProjectSingleReqVo ttProjectSingleReqVo) {
try {
ttProjectSingleService.delTtProjectSingle(ttProjectSingleReqVo);
return success("删除单项工程成功");
}catch (Exception e){
log.info("删除单项工程失败",e.getMessage());
return error("删除单项工程失败");
}
}
}

View File

@ -51,7 +51,7 @@ public class TtSysTeamController extends BaseController {
return success(ttSysTeamVo);
}catch (Exception e){
log.info("查询详情失败",e.getMessage());
return error("查询失败");
return error("查询详情失败");
}
}

View File

@ -0,0 +1,153 @@
package com.bonus.base.basic.domain;
import lombok.Data;
@Data
public class TtProjectSingleReqVo {
/**
* 主键,单项工程ID
*/
private Long projectSingleId;
/**
* 单项工程名称
*/
private String projectSingleName;
/**
* 工程ID
*/
private Long projectId;
/**
* 单项工程编码
*/
private String projectSingleCode;
/**
* 安全编码
*/
private String safeCode;
/**
* 单项工程类型
*/
private String projectType;
/**
* 单项明细类型
*/
private String detailType;
/**
* 工程状态
*/
private String projectStatus;
/**
* 是否在施
*/
private String constructionStatus;
/**
* 电压等级
*/
private String voltageLevel;
/**
* 建设性质
*/
private String constructionNature;
/**
* 是否重点工程
*/
private String majorProject;
/**
* 省公司名称
*/
private String provincialCompany;
/**
* 建管单位名称
*/
private String constructionManagement;
/**
* 建设单位统一信用代码
*/
private String comCode;
/**
* 项目地址
*/
private String address;
/**
* 当前降压率
*/
private String currentCurrent;
/**
* 线路长度
*/
private String lineLength;
/**
* 变电容量
*/
private String substationCapacity;
/**
* 计划开工日期
*/
private String planStartTime;
/**
* 计划竣工日期
*/
private String planEndTime;
/**
* 实际开工日期
*/
private String startTime;
/**
* 实际竣工日期
*/
private String endTime;
/**
* 铁塔基数
*/
private String towerNum;
/**
* 工程基础完工数
*/
private String engineeringCompleted;
/**
* 工程组塔完工数
*/
private String towerCompleted;
/**
* 架线完成数
*/
private String erectionCompleted;
/**
* 工程备注
*/
private String remark;
/**
* 关键字
*/
private String keyWord;
}

View File

@ -0,0 +1,148 @@
package com.bonus.base.basic.domain.vo;
import lombok.Data;
@Data
public class TtProjectSingleVo {
/**
* 主键,单项工程ID
*/
private Long projectSingleId;
/**
* 单项工程名称
*/
private String projectSingleName;
/**
* 工程ID
*/
private Long projectId;
/**
* 单项工程编码
*/
private String projectSingleCode;
/**
* 安全编码
*/
private String safeCode;
/**
* 单项工程类型
*/
private String projectType;
/**
* 单项明细类型
*/
private String detailType;
/**
* 工程状态
*/
private String projectStatus;
/**
* 是否在施
*/
private String constructionStatus;
/**
* 电压等级
*/
private String voltageLevel;
/**
* 建设性质
*/
private String constructionNature;
/**
* 是否重点工程
*/
private String majorProject;
/**
* 省公司名称
*/
private String provincialCompany;
/**
* 建管单位名称
*/
private String constructionManagement;
/**
* 建设单位统一信用代码
*/
private String comCode;
/**
* 项目地址
*/
private String address;
/**
* 当前降压率
*/
private String currentCurrent;
/**
* 线路长度
*/
private String lineLength;
/**
* 变电容量
*/
private String substationCapacity;
/**
* 计划开工日期
*/
private String planStartTime;
/**
* 计划竣工日期
*/
private String planEndTime;
/**
* 实际开工日期
*/
private String startTime;
/**
* 实际竣工日期
*/
private String endTime;
/**
* 铁塔基数
*/
private String towerNum;
/**
* 工程基础完工数
*/
private String engineeringCompleted;
/**
* 工程组塔完工数
*/
private String towerCompleted;
/**
* 架线完成数
*/
private String erectionCompleted;
/**
* 工程备注
*/
private String remark;
}

View File

@ -0,0 +1,19 @@
package com.bonus.base.basic.mapper;
import com.bonus.base.basic.domain.TtProjectSingleReqVo;
import com.bonus.base.basic.domain.vo.TtProjectSingleVo;
import java.util.List;
public interface TtProjectSingleMapper {
List<TtProjectSingleVo> ttProjectSingleList(TtProjectSingleReqVo ttProjectSingleReqVo);
TtProjectSingleVo ttProjectSingleById(TtProjectSingleReqVo ttProjectSingleReqVo);
void addTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo);
void updateTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo);
void delTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo);
}

View File

@ -0,0 +1,40 @@
package com.bonus.base.basic.service;
import com.bonus.base.basic.domain.TtProjectSingleReqVo;
import com.bonus.base.basic.domain.vo.TtProjectSingleVo;
import java.util.List;
public interface TtProjectSingleService {
/**
* 查询单项工程列表
* @param ttProjectSingleReqVo
* @return
*/
List<TtProjectSingleVo> ttProjectSingleList(TtProjectSingleReqVo ttProjectSingleReqVo);
/**
* 查询单项工程详情
* @param ttProjectSingleReqVo
* @return
*/
TtProjectSingleVo ttProjectSingleById(TtProjectSingleReqVo ttProjectSingleReqVo);
/**
* 新增单项工程
* @param ttProjectSingleReqVo
*/
void addTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo);
/**
* 修改单项工程
* @param ttProjectSingleReqVo
*/
void updateTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo);
/**
* 删除单项工程
* @param ttProjectSingleReqVo
*/
void delTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo);
}

View File

@ -0,0 +1,62 @@
package com.bonus.base.basic.service.impl;
import com.bonus.base.basic.domain.TtProjectSingleReqVo;
import com.bonus.base.basic.domain.vo.TtProjectSingleVo;
import com.bonus.base.basic.mapper.TtProjectSingleMapper;
import com.bonus.base.basic.service.TtProjectSingleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Service
public class TtProjectSingleServiceImpl implements TtProjectSingleService {
@Resource
private TtProjectSingleMapper ttProjectSingleMapper;
/**
* 查询单项工程列表
* @param ttProjectSingleReqVo
* @return
*/
@Override
public List<TtProjectSingleVo> ttProjectSingleList(TtProjectSingleReqVo ttProjectSingleReqVo) {
return ttProjectSingleMapper.ttProjectSingleList(ttProjectSingleReqVo);
}
/**
* 查询单项工程详情
* @param ttProjectSingleReqVo
* @return
*/
@Override
public TtProjectSingleVo ttProjectSingleById(TtProjectSingleReqVo ttProjectSingleReqVo) {
return ttProjectSingleMapper.ttProjectSingleById(ttProjectSingleReqVo);
}
/**
* 新增单项工程
* @param ttProjectSingleReqVo
*/
@Override
public void addTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo) {
ttProjectSingleMapper.addTtProjectSingle(ttProjectSingleReqVo);
}
/**
* 修改单项工程
* @param ttProjectSingleReqVo
*/
@Override
public void updateTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo) {
ttProjectSingleMapper.updateTtProjectSingle(ttProjectSingleReqVo);
}
@Override
public void delTtProjectSingle(TtProjectSingleReqVo ttProjectSingleReqVo) {
ttProjectSingleMapper.delTtProjectSingle(ttProjectSingleReqVo);
}
}

View File

@ -0,0 +1,128 @@
<?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.base.basic.mapper.TtProjectSingleMapper">
<insert id="addTtProjectSingle">
insert into tt_project_single
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectSingleName != null and projectSingleName != ''">project_single_name,</if>
<if test="projectId != null">project_id,</if>
<if test="projectSingleCode != null and projectSingleCode != ''">project_single_code,</if>
<if test="safeCode != null">safe_code,</if>
<if test="projectType != null and projectType != ''">project_type,</if>
<if test="detailType != null and detailType != ''">detail_type,</if>
<if test="projectStatus != null and projectStatus != ''">project_status,</if>
<if test="constructionStatus != null and constructionStatus != ''">construction_status,</if>
<if test="voltageLevel != null and voltageLevel != ''">voltage_level,</if>
<if test="constructionNature != null and constructionNature != ''">construction_nature,</if>
<if test="majorProject != null and majorProject != ''">major_project,</if>
<if test="provincialCompany != null and provincialCompany != ''">provincial_company,</if>
<if test="constructionManagement != null and constructionManagement != ''">construction_management,</if>
<if test="comCode != null and comCode != ''">com_code,</if>
<if test="address != null and address != ''">address,</if>
<if test="currentCurrent != null and currentCurrent != ''">current_current,</if>
<if test="lineLength != null and lineLength != ''">line_length,</if>
<if test="substationCapacity != null and substationCapacity != ''">substation_capacity,</if>
<if test="planStartTime != null ">plan_start_time,</if>
<if test="planEndTime != null ">plan_end_time,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null ">end_time,</if>
<if test="towerNum != null and towerNum != ''">tower_num,</if>
<if test="engineeringCompleted != null and engineeringCompleted != ''">engineering_completed,</if>
<if test="towerCompleted != null and towerCompleted != ''">tower_completed,</if>
<if test="erectionCompleted != null and erectionCompleted != ''">erection_completed,</if>
<if test="remark != null and remark != ''">remark,</if>
del_flag
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectSingleName != null and projectSingleName != ''">#{projectSingleName},</if>
<if test="projectId != null">#{projectId},</if>
<if test="projectSingleCode != null and projectSingleCode != ''">#{projectSingleCode},</if>
<if test="safeCode != null">#{safeCode},</if>
<if test="projectType != null and projectType != ''">#{projectType},</if>
<if test="detailType != null and detailType != ''">#{detailType},</if>
<if test="projectStatus != null and projectStatus != ''">#{projectStatus},</if>
<if test="constructionStatus != null and constructionStatus != ''">#{constructionStatus},</if>
<if test="voltageLevel != null and voltageLevel != ''">#{voltageLevel},</if>
<if test="constructionNature != null and constructionNature != ''">#{constructionNature},</if>
<if test="majorProject != null and majorProject != ''">#{majorProject},</if>
<if test="provincialCompany != null and provincialCompany != ''">#{provincialCompany},</if>
<if test="constructionManagement != null and constructionManagement != ''">#{constructionManagement},</if>
<if test="comCode != null and comCode != ''">#{comCode},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="currentCurrent != null and currentCurrent != ''">#{currentCurrent},</if>
<if test="lineLength != null and lineLength != ''">#{lineLength},</if>
<if test="substationCapacity != null and substationCapacity != ''">#{substationCapacity},</if>
<if test="planStartTime != null ">#{planStartTime},</if>
<if test="planEndTime != null ">#{planEndTime},</if>
<if test="startTime != null ">#{startTime},</if>
<if test="endTime != null ">#{endTime},</if>
<if test="towerNum != null and towerNum != ''">#{towerNum},</if>
<if test="engineeringCompleted != null and engineeringCompleted != ''">#{engineeringCompleted},</if>
<if test="towerCompleted != null and towerCompleted != ''">#{towerCompleted},</if>
<if test="erectionCompleted != null and erectionCompleted != ''">#{erectionCompleted},</if>
<if test="remark != null and remark != ''">#{remark},</if>
1
</trim>
</insert>
<update id="updateTtProjectSingle">
update tt_project_single set project_single_name = #{projectSingleName},project_id = #{projectId},
project_single_code = #{projectSingleCode},safe_code = #{safeCode},project_type=#{projectType},
detail_type = #{detailType},project_status= #{projectStatus},construction_status= #{constructionStatus},
voltage_level = #{voltageLevel},construction_nature = #{constructionNature},
major_project=#{majorProject},provincial_company = #{provincialCompany},
construction_management = #{constructionManagement},com_code = #{comCode},address = #{address},
current_current = #{currentCurrent},line_length = #{lineLength},
substation_capacity = #{substationCapacity}, plan_start_time = #{planStartTime},
plan_end_time = #{planEndTime}, start_time = #{start_time},end_time = #{endTime},
tower_num = #{towerNum},engineering_completed = #{engineeringCompleted},
tower_completed = #{towerCmpleted},erection_completed = #{erectionCompleted},remark = #{remark}
where project_single_id = #{projectSingleId}
</update>
<delete id="delTtProjectSingle">
update tt_project_single set del_flag = 0 where project_single_id = #{projectSingleId}
</delete>
<select id="ttProjectSingleList" resultType="com.bonus.base.basic.domain.vo.TtProjectSingleVo">
select project_single_id as projectSingleId, project_single_name as projectSingleName,
project_id as projectId, project_single_code as projectSingleCode,safe_code as safeCode,
project_type as projectType,detail_type as detailType,project_status as projectStatus,
construction_status as constructionStatus,voltage_level as voltageLevel,
construction_nature as constructionNature,major_project as majorProject,
provincial_company as provincialCompany,construction_management as constructionManagement,
com_code as comCode,address as address,current_current as currentCurrent,line_length as lineLength,
substation_capacity as substationCapacity,plan_start_time as planStartTime,
plan_end_time as planEndTime,start_time as startTime,end_time as endTime,tower_num as towerNum,
engineering_completed as engineeringCompleted,tower_completed as towerCmpleted,
erection_completed as erectionCompleted, remark as remark
from tt_project_single
where del_flag=1
<if test="projectId != '' and projectId != null"> and project_id = #{projectId}</if>
<if test="provincialCompany != '' and provincialCompany != null"> and provincial_company = #{provincialCompany}</if>
<if test="majorProject != '' and majorProject != null"> and major_project = #{majorProject}</if>
<if test="keyWord != null and keyWord != ''">
and (
address like concat('%', #{keyWord}, '%') or
construction_nature like concat('%', #{keyWord}, '%') or
com_code like concat('%', #{keyWord}, '%') or
safe_code like concat('%', #{keyWord}, '%')
)
</if>
</select>
<select id="ttProjectSingleById" resultType="com.bonus.base.basic.domain.vo.TtProjectSingleVo">
select project_single_id as projectSingleId, project_single_name as projectSingleName,
project_id as projectId, project_single_code as projectSingleCode,safe_code as safeCode,
project_type as projectType,detail_type as detailType,project_status as projectStatus,
construction_status as constructionStatus,voltage_level as voltageLevel,
construction_nature as constructionNature,major_project as majorProject,
provincial_company as provincialCompany,construction_management as constructionManagement,
com_code as comCode,address as address,current_current as currentCurrent,line_length as lineLength,
substation_capacity as substationCapacity,plan_start_time as planStartTime,
plan_end_time as planEndTime,start_time as startTime,end_time as endTime,tower_num as towerNum,
engineering_completed as engineeringCompleted,tower_completed as towerCmpleted,
erection_completed as erectionCompleted, remark as remark
from tt_project_single
where project_single_id = #{projectSingleId}
</select>
</mapper>